Page 1 of 1

Re: Error: Service check command

Posted: Tue May 30, 2017 10:22 am
by mcapra
Your service definition looks malformed. When passing arguments to a check_command in your service definition, you delimit them with the ! character.

So if you have a check command like this:

Code: Select all

# 'check_url_status' command definition
define command{
command_name check_url_status
command_line $USER1$/check_url_status.pl -U $ARG1$
}
And you wanted to pass in http://xxxx.com as the $ARG1$ value, then based on the structure of your check_url_status command definition, you could do something like this:

Code: Select all

define service{
use websites
host_name xxxx
service_description website
servicegroups websites
check_command check_url_status!http://xxxx.com
}
Notice how I have omitted the -U because it is already included in the check_url_status command definition. In the context of a service definition's check_command directive, you are referencing the command definition itself; Not the script.

If your command definition instead looked like this:

Code: Select all

# 'check_url_status' command definition
define command{
command_name check_url_status
command_line $USER1$/check_url_status.pl $ARG1$
}
Then it would be totally valid to include the -U in your service's check_command directive like so:

Code: Select all

check_command check_url_status!-U http://xxxx.com

Re: Error: Service check command

Posted: Tue May 30, 2017 10:42 am
by dappa_don
of course youre right. here is what i did


define command{
command_name check_url_status
command_line $USER1$/check_url_status.pl $ARG1$
}

define service{
use websites
host_name xxxxx
service_description website
servicegroups websites
check_command check_url_status! -U http://xxxx.com
}

this resolved it

Re: Error: Service check command

Posted: Tue May 30, 2017 10:52 am
by tmcdonald
Moderator Note: Wondering where the first post went? It was a very complicated workflow involving no small amount of arcane wizardry and techno-babble. To even begin describing what occurred here would require years of study and personal sacrifice on the part of the reader.







Okay I might have hit disapprove on a pending edit which apparently deletes the post. My bad.