Defining per host resources?


#1

IS it possible to define per-host resource (logins.passwords, …) Otherwise i’d have to define about 100 different checkcommands or services, which is stupid. I need it for my snmpv3 checks.


#2

define macro, user3 etc. check in doc or in the google


#3

I did rtfm and found the macros, but there are only 32 possible macros for let say snmp auth login. If I have 33 hosts with each different snmp auth I run out of macros. And either way I’d had to use many service definitions because USERXY would need to be different for each host.

define service{ use generic-service host_name server12 check_command check_snmp_example!$USER12$ } define service{ use generic-service host_name server13 check_command check_snmp_example!$USER13$ }

I would need something like this:

define service{ use generic-service check_command check_snmp_example! $HOST_SNMP_PASS$ hostgroup_name snmp_check_disk }

and a per-host resource:

HOST_SNMP_PASS,server12 = password1ababab HOST_SNMP_PASS,server13 = password2xyxyxy HOST_SNMP_PASS,server14 = password2gfgfg ... HOST_SNMP_PASS,server97 = password2gfgfg HOST_SNMP_PASS,server98 = password3342gfgfg HOST_SNMP_PASS,server99 = password23wgfgfg

this way we could have 1 service definition for what really is only same service but running on multiple hosts. Enabling and disabling services on new hosts would be easy as adding to a hostgroup

The is some discussion about per-host macros here, but the only solution seems to be EXTERNAL resources via perl: mail-archive.com/nagios-user … 04904.html


#4
Understood! 
I have no other solution. Except the obvious solution to create a ldap or AD user with very limited permissions and use it to access all the servers.
Since you are asking I assume thats not an option.

Understood!
I have no other solution. Except the obvious solution to create a ldap or AD user with very limited permissions and use it to access all the servers.
Since you are asking I assume thats not an option.


#5

Here is the solution, little ill named but there already (Custom Object Variables):

nagios.sourceforge.net/docs/3_0/ … tvars.html