[Nagiosplug-devel] SNMP community in host configuration

Andreas Ericsson ae at op5.se
Thu Dec 16 12:12:03 CET 2004


Bob Myers wrote:
>>
>>
>> Patrick Proy wrote:
>>
>>>> Hi again,
>>>> Maybe some more information : I'm using service templates that's why 
>>>> I have
>>>> this problem. I need one service template per snmp community...
>>>
>>>   
>>
>>
>> That's the best way to do it then I suppose. You might be able to put 
>> the community in the notes variable of the hostextinfo and then use it 
>> from there (I don't know to what extent the host macros are expanded 
>> for checks, but it could be worth a try).
>>
>> The main problem is that you'll HAVE to write down the authentication 
>> info somewhere. Templates makes you do it once, I suppose, so that's 
>> most likely the best solution (assuming you don't want to set your 
>> read-only authinfo to the same thing everywhere).
>>
>>  
>>
> 
> The problem with this is that the SNMP community really is set for a 
> host, not for a service.  You can put in the community for every service 
> template you use, but if you do a lot of SNMP monitoring, it ends up 
> separately in every template.   It's not at all unreasonable to run many 
> SNMP checks on any given host.
> 
> I for one would like to see Nagios have a little tighter integration 
> with SNMP.
> 
> What I've done is use an external config file with the SNMP community 
> defined for each Nagios host.  Then each of my SNMP Nagios plugins 
> references this config file to find out the SNMP community for that 
> host.  I think a much cleaner implementation would be for Nagios to 
> provide the SNMP community for a given host as a macro.
> 

It's open-source, so feel free to hack it up yourself. I'm sure ethan 
wouldn't mind adding it to the official distro, so long as the code is 
clean enough.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer




More information about the Devel mailing list