Page 1 of 1

Monitor SNMP table in Nagios

Posted: Mon Aug 12, 2013 1:36 am
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

Re: Monitor SNMP table in Nagios

Posted: Mon Aug 12, 2013 9:59 am
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?

Re: Monitor SNMP table in Nagios

Posted: Mon Aug 12, 2013 11:09 pm
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.

Re: Monitor SNMP table in Nagios

Posted: Tue Aug 13, 2013 10:33 am
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.