Monitor SNMP table in Nagios

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
manishj
Posts: 2
Joined: Mon Aug 12, 2013 1:31 am

Monitor SNMP table in Nagios

Post by manishj »

How do I monitor SNMP table in Nagios? Here, the row count is dynamic.

On my server, there are multiple instances of various services (Service1,2,3)
I want to display following service status table in Nagios.

Code: Select all

Instance_ID | Service1 Status | Service2 Status | Service3 Status  
------------|-----------------|-----------------|----------------  
      1     |       OK        |     Crashed     | Stopped  
      2     |       OK        |     OK          |  OK  
This is just like SNMP "Interface MIB" - which has lot of packet/byte statistics as columns and multiple interfaces as rows of SNMP table.

How can I do this in Nagios? Is it possible? Do I need any plugin to display tabular data? Relevant part of MIB is:

Code: Select all

instanceProcessStatusTable  OBJECT-TYPE  
                            SYNTAX      SEQUENCE OF InstanceProcessStatusEntry  
                        MAX-ACCESS  not-accessible  
                        STATUS      current  
                        DESCRIPTION  
                            ""  
                        ::= { statusInfo 1 }  

instanceProcessStatusEntry  OBJECT-TYPE
                        SYNTAX      InstanceProcessStatusEntry
                        MAX-ACCESS  not-accessible
                        STATUS      current
                        DESCRIPTION
                            "A row indicating status of instance specific processes for a given instance."
                        INDEX   { instanceID }
                        ::= { instanceProcessStatusTable 1 }

InstanceProcessStatusEntry  ::= SEQUENCE {
                            instanceID              Integer32,
                            service1Status          OCTET STRING,
                            service2Status          OCTET STRING,
                            service3Status          OCTET STRING
                        }

instanceID                  OBJECT-TYPE
                        SYNTAX  Integer32(0..1024)
                        MAX-ACCESS  read-create
                        STATUS  current
                        DESCRIPTION
                            "Instance ID."
                        ::= { instanceProcessStatusEntry 1 }

service1Status              OBJECT-TYPE
                        SYNTAX  OCTET STRING
                        MAX-ACCESS  read-create
                        STATUS  current
                        DESCRIPTION
                            "Status of Service-1."
                        ::= { instanceProcessStatusEntry 2 }

... Same for service2Status and service3Status
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Monitor SNMP table in Nagios

Post by sreinhardt »

Nagios plugins should include the check_snmp plugin by default. This would allow you to request a specific oid or shortname and get an appropriate response from your snmp server. Would this be what you are looking for?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
manishj
Posts: 2
Joined: Mon Aug 12, 2013 1:31 am

Re: Monitor SNMP table in Nagios

Post by manishj »

I will check this out.

Basically, I want to see tabular view of a SNMP table - this table may contain dynamic number of rows. I guess this is pretty common requirement.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Monitor SNMP table in Nagios

Post by sreinhardt »

So you want to see something similar to what you have posted above?

Code: Select all

Instance_ID | Service1 Status | Service2 Status | Service3 Status 
------------|-----------------|-----------------|---------------- 
      1     |       OK        |     Crashed     | Stopped 
      2     |       OK        |     OK          |  OK  
The default check_snmp would not be able to create this sort of output, you would almost definitely need to create a custom plugin. Up to this point, I have never seen an snmp table displayed in this way, not that it doesn't happen.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked