I could not figure out how to get this to work. I think it’s because I didn’t understand that the $ signs were being used to call a macro. I would like to document this in detail here for others in case you’re in the same boat.
Here is the command I’m using.
command_line /usr/lib/nagios/plugins/check_cluster --service -c $ARG1$ -d "$ARG2$" -v
When using this command ARG1 indicates the threshold for non-ok data points at which a critical alert is returned. It uses the special threshold syntax.
@2:2 This means if there are exactly 2 data points in non-ok state return critical
ARG2 should be a comma-separated list of service statuses. The number 0 = OK. The number 2 = CRITICAL. A macro like the following will return the status of a service:
The following are two macros for two services separated by a comma:
The following check_command argument will monitor two services. The @2:2 means it will fail if 2 services are in a non-OK state. The service name is service1 and it will look on host1 and host2.