-1

I have a nagios system, working well and i wanted to check a specific url with check_http. The command is defined:

define command{
    command_name    check_http_with_folder
    command_line    $USER1$/check_http -H $HOSTADRESS$ -u http://$HOSTADRESS$$ARG1$
}

and i call it correct ... But it throws me an

"Name or service not known"

When i call it from my nagios machine from command line, it works well and i get an status result 200, so all okay. The problem is now, that i want the nagios command working and not throwing an error.

Any Ideas?

P.S. The problem is only in the part with the -u xxx param, without it (in the normal check_http command without -u) it all works well.

Paladin
  • 1,637
  • 13
  • 28

2 Answers2

2

You've misspelled $HOSTADDRESS$ in your command definition. It needs 2 D's. Also, you might want to ensure there is a slash in between $HOSTADDRESS$ and $ARG1$ in the value you pass in to your -u command argument, or make sure that $ARGS1$ has a preceding slash.

Joe Young
  • 5,749
  • 3
  • 28
  • 27
1

Building on Joe's observations...

Note the corrections:

define command{
    command_name    check_http_with_folder
    command_line    $USER1$/check_http -H $HOSTADDRESS$ -u $ARG1$
}

Then the $HOSTADDRESS$ should be just that. For example, www.example.com. And $ARG1$ should be the location at the host only. For example, /blog/index.php. The check_http check will build it into an actual http request.

JonB
  • 836
  • 1
  • 11
  • 15