SNMP Monitoring conundrum

Israel Brewster israel at frontierflying.com
Fri Jul 17 18:03:07 CEST 2009


On Jul 16, 2009, at 2:06 PM, Mark Gius wrote:

> I would suggest you use custom object variables (http://nagios.sourceforge.net/docs/3_0/customobjectvars.html 
> ).  This is a nagios 3 feature, so if you're on 2.0 you'll need to  
> upgrade.
>
> Basically, you can define custom variables into hosts/services/ 
> whatever.  So you'd have a custom object var in the host
> define host {
>   name   UPS-thing
>   _OIDS <List of OIDs Here> <-- This being the custom variable that  
> you define.
> }
>
> and in your service you'll have
>
> define service {
>    name    snmp-check
>    check_command check_snmp!$_HOSTOIDS$  <-- Use it like so
> }
>
> -Gius

Ah, I KNEW I had seen something about that sort of thing somewhere! I  
think I'll probably combine this with Jon Angliss's suggestion (adding  
a version argument). Although if I start having more than a couple of  
sets of OID's to worry about, I may rethink that approach to avoid my  
scripts becoming unmaintainably large. Thanks.
-----------------------------------------------
Israel Brewster
Computer Support Technician II
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------

>
> Israel Brewster wrote:
>> I have a number of scripts I have developed to monitor our UPS  
>> units via SNMP - I found the included plugins didn't give me enough  
>> power/flexibility with the monitoring, so I made my own.  
>> Unfortunately, we have just added a new UPS to the system which,  
>> although made by the same company, uses different OID's for the  
>> data I am pulling. Thus the issue: I want the same data, so other  
>> than the OID's the existing scripts would work. But how do I deal  
>> with different OID's on different devices?
>>
>> So far I've thought of the following:
>> 1) Make a second copy of my scripts with the new OID's. Also  
>> implies creating new contacts to use the new script (the  
>> notification script pulls data such as estimated run time via snmp)  
>> and maintaining two copies of each check/notification script
>>
>> 2) Somehow pass the OID's to the scripts from nagios. Not quite  
>> sure how I would manage this, as the OID's would need to be  
>> associated with the hosts, and further complicated by the fact that  
>> some scripts use 3 or more OID's - for example, the main script  
>> looks at UPS state(On battery, on line power, etc) estimated run  
>> time (if on battery) and time on battery - so it would need to be  
>> passed three separate OIDS. Perhaps this approach could be  
>> simplified by simply passing a code identifying which set of OID's  
>> the script should use, at the expense of a more complicated script.  
>> Still need to find some way of getting that into Nagios so it can  
>> pass the appropriate value to the script though.
>>
>> Anyone else run into a similar situation? What does everyone else  
>> think the best approach here is? Thanks.
>>
>> -----------------------------------------------
>> Israel Brewster
>> Computer Support Technician II
>> Frontier Flying Service Inc.
>> 5245 Airport Industrial Rd
>> Fairbanks, AK 99709
>> (907) 450-7250 x293
>> -----------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Israel Brewster.vcf
Type: text/directory
Size: 397 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090717/828a9db5/attachment.bin>
-------------- next part --------------
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list