I'm very new to nagios, and trying to get a custom command to bend to my will.
I have looked through various examples, and can't find anyone appending the $HOSTADDRESS$ macro, so maybe I have to go about this a different route, but what I need, is to pass an argument to command that looks something like this:
HOST_ADDRESS/StatusCheck?auth=secretKey
Here is an example that works (for only 1 host)
define service {
use generic-service
hostgroup_name my-hostgroup
service_description my custom check
check_command check_custom_status!http://example.com/StatusCheck?auth=secretKey
}
Obviously that doesn't work for me as it only checks a single host (example.com in this case).
Here is an example that doesn't work, but I wish it did, can I switch the syntax a bit to get this to work?
define service {
use generic-service
hostgroup_name my-hostgroup
service_description my custom check
check_command check_custom_status!$HOSTADDRESS$/StatusCheck?auth=secretKey
}
(it doesn't check the /StatusCheck
page). How do I append the $HOSTADDRESS$ macro?
I'm hoping there is a really easy fix for this, apologies if I overlooked something very simple.
Command Definition
define command {
command_name check_custom_status
command_line $USER1$/check_custom_status.pl -U $ARG1$
}
My perl script takes in a single url parameter (-U
)