When defining services and check commands in Nagios macros can be used to send data to the external command. My question is ... is it possible to modify the host.cfg schema to include community string? Im not sure why it wouldnt already be there. Or is there another way of accomplishing what I am trying to do.
If you look below I am trying to define a generic snmp check command which I them can customize through different services. In the service I do not have to specify the host address as the command picks this up from the host in question through the $HOSTADDRESS$. How can I do this for the community string? We poll devices from different customers which have different community strings. I am trying to avoid duplicating a service for every different customer with a different community string. In the examples below I send argument 1 as the community string "public", but I'd rather not have to define this and have the command just get this from the host like it did its ip address.
Hope this makes sense... see below for my configs.
An example of my check snmp command looks like this...
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o $ARG2$ -w $ARG3$ -c $ARG4$
The service that alls this command looks like this...
use generic-service ; Name of service template to use