Page 1 of 2

how to create services of various OIDs of a mib file in one

Posted: Thu Apr 02, 2015 9:23 am
by alef1_nagiosxi
Hi!

I am using Nagios XI 2014R2.6 on below mentioned platform
[root@amtnagios2 ~]# uname -mrs
Linux 2.6.32-504.el6.x86_64 x86_64
[root@amtnagios2 ~]# cat /etc/issue
CentOS release 6.6 (Final)

I would like to understand how to create services of various OIDs of a mib file in one shot.

Please guide me.

Thanks
Rajesh

Re: how to create services of various OIDs of a mib file in

Posted: Thu Apr 02, 2015 10:26 am
by jdalrymple
Custom plugin... it's possible someone has already written one for you.

Here's a great example of one:
http://exchange.nagios.org/components/c ... 5&cf_id=35

Re: how to create services of various OIDs of a mib file in

Posted: Mon Apr 06, 2015 5:50 am
by alef1_nagiosxi
This is a plugin link, but how to use it?

Can u please provide me a link with step by step procedure..

Thanks
Rajesh

Re: how to create services of various OIDs of a mib file in

Posted: Mon Apr 06, 2015 8:52 am
by tmcdonald
We have a doc already written up for that:

http://assets.nagios.com/downloads/nagi ... ios-XI.pdf

Re: how to create services of various OIDs of a mib file in

Posted: Mon Apr 06, 2015 9:27 am
by alef1_nagiosxi
Hi,

Firstly...
The above document explains, to add services one by one, I want to add all services defined in a mib file in one shot. Is it possible to add all services for all oids defined in a mib file. if possible please provide me the document for the same. This is very helpful if possible.

2ndly I would like to know..
How we can add Linux snmp host with different snmp port using config wizard?

Thanks
Rajesh
Mob. 9986499201

Re: how to create services of various OIDs of a mib file in

Posted: Mon Apr 06, 2015 10:47 am
by jdalrymple
To answer your question regarding the SNMP port number on the Linux SNMP Monitoring Wizard, that is just not an option in the wizard. You can approach that problem in 2 different ways:

1) Create the checks using the wizard then go back into each individual service and specify the alternate port number through CCM
2) Alternatively use the SNMP walk or just plan SNMP wizard to create your services, these wizards allow you to change the port number

The other question - Nagios base configuration does not have a single plugin to monitor multiple OIDs. Nagios design philosophy is that each OID represents a service and as such it breaks them out that way. If you want to aggregate these seperate OIDs into a single service such as a check like "check_all_interfaces_are_up" you will have to do some custom work or as I mentioned look on the exchange; odds are someone has already done what you want.

This is just one example -there are thousands and thousands of plugins available on the Exchange that might provide the functionality you want.

Re: how to create services of various OIDs of a mib file in

Posted: Mon Apr 06, 2015 10:42 pm
by alef1_nagiosxi
Thanks.

I am ok with your suggestions for my first query of Linux snmp server with different port.

But for my second query, I would like to clarify that, I don't want to add all oids in a single service, as I also very much aware that each oid is a different service. My requirement is add all services for different oids defined in a mib file in one go not one by one. Like config wizards does for us, config wizards add multiple oids/services in one shot. So please suggest something related to this customization.

Thanks
Rajesh
Mob:9986499201

Re: how to create services of various OIDs of a mib file in

Posted: Tue Apr 07, 2015 9:01 am
by jdalrymple
alef1_nagiosxi,

In what way does the SNMP Walk wizard not achieve this goal? Just put whatever top level OID you want into the "OID:" field?

Re: how to create services of various OIDs of a mib file in

Posted: Thu Apr 09, 2015 5:26 am
by alef1_nagiosxi
Ok this is fine and working. Great thanks.

Now I have another issue that is
COMMAND: /usr/local/nagios/libexec/check_snmp -H 192.168.50.170 -C public -P 2c -o .1.3.6.1.4.1.45390.1.3.1.2.0
OUTPUT: SNMP OK - 51000639 | iso.3.6.1.4.1.45390.1.3.1.2.0=51000639c

This output comes with c and makes value alphanumeric and graphical representations get disturbed.

Can you please help me why this is happening and how I can solve this?

Thanks
Rajesh

Re: how to create services of various OIDs of a mib file in

Posted: Thu Apr 09, 2015 4:54 pm
by abrist
This is a counter, and honestly, will most likely overflow the buffer as it grows. A custom warpper script could strip it from the output (or a sed at the end of the command).
What does this oid represent?