Enabling SNMP monitoring for CloudByte ElastiStor

You can monitor ElastiStor storage Node using external monitoring systems such as Nagios, OpenNMS, Ganglia, or Zabbix. This document provides the procedures to enable SNMP monitoring.
  1. SSH to the ElastiStor Node.
  2. Copy the defualt snmpd.conf file to /usr/local/share/snmp/ using the following command:
    cp /etc/snmpd.config /usr/local/share/snmp/snmpd.conf
  3. Download the sample snmpd.conf file from the following URL: www.cloudbyte.com/downloads/snmpd.tar.gz
  4. Copy the sample snmpd.conf file to the location
    /etc/snmpd.conf
  5. Do the following with the sample snmpd.conf:
      1. Allow SNMP access to your monitoring server by adding an entry, for example com2sec mynetwork 20.10.0.0/16 public. Here, 20.10.0.0/16 is the subnet range.
      2. In the following lines, update trapsink, trap2sink, and informsink (based on the SNMP protocol version) to your monitoring server IP address:
    trapsink 20.10.43.3 public
    trap2sink 20.10.43.3 public
    informsink 20.10.43.3 public

Note: The modifications in the step 5.1 and 5.2 are highlighted in the snmpd.conf file provided in the following section Sample snmpd.conf.

  • Restart the snmpd service using the following command:
    service snmpd onerestart
  • Stop the snmptrapd service using the following command:
    service snmptrapd onestop

Sample snmpd.conf

###############################################################################
     #
     # EXAMPLE.conf:
     #   An example configuration file for configuring the snmpd agent.
     #
     ###############################################################################
     #
     # This file is intended to only be an example.  If, however, you want
     # to use it, it should be placed in /usr/local/etc/snmp/snmpd.conf.
     # When the snmpd agent starts up, this is where it will look for it.
     #
     # You might be interested in generating your own snmpd.conf file using
     # the "snmpconf" program (perl script) instead.  It's a nice menu
        # based interface to writing well commented configuration files.  Try it!
        #
        # Note: This file is automatically generated from EXAMPLE.conf.def.
        # Do NOT read the EXAMPLE.conf.def file! Instead, after you have run
        # configure & make, and then make sure you read the EXAMPLE.conf file
        # instead, as it will tailor itself to your configuration.
        # All lines beginning with a '#' are comments and are intended for you
        # to read.  All other lines are configuration commands for the agent.
        #
        # PLEASE: read the snmpd.conf(5) manual page as well!
        #
        ###############################################################################
        # Access Control
        ###############################################################################
        # YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY
        # KNOWN AT YOUR SITE.  YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO
        # SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE.
        # By far, the most common question I get about the agent is "why won't
        # it work?", when really it should be "how do I configure the agent to
        # allow me to access it?"
        #
        # By default, the agent responds to the "public" community for read
        # only access, if run out of the box without any configuration file in
        # place.  The following examples show you other ways of configuring
        # the agent so that you can change the community names, and give
        # yourself write access as well.
        #
        # The following lines change the access permissions of the agent so
        # that the COMMUNITY string provides read-only access to your entire
        # NETWORK (EG: 10.10.10.0/24), and read/write access to only the
        # localhost (127.0.0.1, not its real ipaddress).
        #
        # For more information, read the FAQ as well as the snmpd.conf(5)
        # manual page.
        ####
        # First, map the community name (COMMUNITY) into a security name
        # (local and mynetwork, depending on where the request is coming
        # from):
        #       sec.name  source          community
        com2sec local     localhost       public
        com2sec mynetwork 192.168.1.1     public
        com2sec mynetwork 192.168.2.0/24  public
        com2sec mynetwork 20.10.0.0/16    public
        ####
        # Second, map the security names into group names:
        #               sec.model  sec.name
        group MyRWGroup v1         local
        group MyRWGroup v2c        local
        group MyRWGroup usm        local
        group MyROGroup v1         mynetwork
        group MyROGroup v2c        mynetwork
        group MyROGroup usm        mynetwork
        ####
        # Third, create a view for us to let the groups have rights to:
        #           incl/excl subtree                          mask
        view all    included  .1                               80
        ####
        # Finally, grant the 2 groups access to the 1 view with different
        # write permissions:
        #                context sec.model sec.level match  read   write  notif
        access MyROGroup ""      any       noauth    exact  all    none   none
        access MyRWGroup ""      any       noauth    exact  all    all    none
        # -----------------------------------------------------------------------------
        ###############################################################################
        # System contact information
        #
        # It is also possible to set the sysContact and sysLocation system
        # variables through the snmpd.conf file.  **PLEASE NOTE** that setting
        # the value of these objects here makes these objects READ-ONLY
        # (regardless of any access control settings).  Any attempt to set the
        # value of an object whose value is given here will fail with an error
        # status of notWritable.
        syslocation MyLocation
        syscontact SysAdmin <sysadmin@example.com>
        # Example output of snmpwalk:
        #   % snmpwalk -v 1 -c public localhost system
        #   system.sysDescr.0 = "SunOS name sun4c"
        #   system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.sunos4
        #   system.sysUpTime.0 = Timeticks: (595637548) 68 days, 22:32:55
        #   system.sysContact.0 = "Me <me@somewhere.org>"
        #   system.sysName.0 = "name"
        #   system.sysLocation.0 = "Right here, right now."
        #   system.sysServices.0 = 72
        # -----------------------------------------------------------------------------
        ###############################################################################
        # Process checks.
        #
        #  The following are examples of how to use the agent to check for
        #  processes running on the host.  The syntax looks something like:
        #
        #  proc NAME [MAX=0] [MIN=0]
        #
        #  NAME:  the name of the process to check for.  It must match
        #         exactly (ie, http will not find httpd processes).
        #  MAX:   the maximum number allowed to be running.  Defaults to 0.
        #  MIN:   the minimum number to be running.  Defaults to 0.
        #
        #  Examples:
        #
        #  Make sure at least one sendmail, but less than or equal to 10 are running.
        proc sendmail 10 1
        proc sshd
        proc cron
        ###############################################################################
        # disk checks
        #
        # disk PATH [MIN=DEFDISKMINIMUMSPACE]
        #
        # PATH:  mount path to the disk in question.
        # MIN:   Disks with space below this value will have the Mib's errorFlag set.
        #        Default value = DEFDISKMINIMUMSPACE.
        # Check the / partition and make sure it contains at least 10 megs.
        disk / 10000000
        ###############################################################################
        # load average checks
        #
        # load [1MAX=DEFMAXLOADAVE] [5MAX=DEFMAXLOADAVE] [15MAX=DEFMAXLOADAVE]
        #
        # 1MAX:   If the 1 minute load average is above this limit at query
        #         time, the errorFlag will be set.
        # 5MAX:   Similar, but for 5 min average.
        # 15MAX:  Similar, but for 15 min average.
        # Check for loads:
        load 12 14 14
        # -----------------------------------------------------------------------------
        # Inteface up and down
        linkUpDownNotifications yes
        # Trap server information
        trapsink    20.10.43.3 public
        trap2sink   20.10.43.3 public
        informsink  20.10.43.3 public
			

Verifying the SNMP access and traps

Verify SNMP access

From your monitoring host, run the snmpwalk command to check the access to ElastiStor SNMP data as shown in the following example:
root@node2:~ # snmpwalk -v1 -c public <ElastiStor_IP Address> SNMPv2-MIB::sysDescr.0
SNMPv2-MIB::sysDescr.0 = STRING: CloudByte ES 1.4.0-Elastistor CloudByte 1.4.0-Elastistor #24 r1436: Thu Jan 29 19:59:04 IST 2015 root@buildmachine2.cb.in:/usr/obj/usr/local/jenkins/jobs/1.4.0.p1/workspace/esos/sys/GENERIC amd64

Verify SNMP traps

Run the snmptrapd command on the monitoring server to make sure that you get traps from ElastiStor, as shown in the following example:
root@node2:~ # echo "authCommunity log,execute,net public" > /usr/local/etc/snmptrapd.conf
SNMPv2-MIB::sysDescr.0 = STRING: CloudByte ES 1.4.0-Elastistor CloudByte 1.4.0-Elastistor #24 r1436: Thu Jan 29 19:59:04 IST 2015 root@buildmachine2.cb.in:/usr/obj/usr/local/jenkins/jobs/1.4.0.p1/workspace/esos/sys/GENERIC amd64
root@node2:~ # snmptrapd -f -Lo -c /usr/local/etc/snmptrapd.conf
NET-SNMP version 5.7.2
2015-02-02 16:38:33 <UNKNOWN> [UDP: [20.10.58.171]:45638->[20.10.43.3]:162]:
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (833046) 2:18:50.46 SNMPv2-MIB::snmpTrapOID.0 = OID: NET-SNMP-AGENT-MIB::nsNotifyShutdown SNMPv2-MIB::snmpTrapEnterprise.0 = OID: NET-SNMP-MIB::netSnmpNotificationPrefix
2015-02-02 16:38:34 20.10.58.171(via UDP: [20.10.58.171]:53086->[20.10.43.3]:162) TRAP, SNMP v1, community public
NET-SNMP-MIB::netSnmpAgentOIDs.8 Cold Start Trap (0) Uptime: 0:00:00.69
2015-02-02 16:38:34 <UNKNOWN> [UDP: [20.10.58.171]:14927->[20.10.43.3]:162]:
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (69) 0:00:00.69 SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-MIB::coldStart SNMPv2-MIB::snmpTrapEnterprise.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.8
2015-02-02 16:38:34 <UNKNOWN> [UDP: [20.10.58.171]:36823->[20.10.43.3]:162]:
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (69) 0:00:00.69 SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-MIB::coldStart SNMPv2-MIB::snmpTrapEnterprise.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.8

HOST-RESOURCES-MIB Details

Resource oid
hrSystem.1.3.6.1.2.1.25.1
hrStorage.1.3.6.1.2.1.25.2
hrDevice.1.3.6.1.2.1.25.3
hrSWRun.1.3.6.1.2.1.25.4
hrSWRunPerf.1.3.6.1.2.1.25.5
hrSWInstalled.1.3.6.1.2.1.25.6
hrMIBAdminInfo.1.3.6.1.2.1.25.7
hrSystemUptime.1.3.6.1.2.1.25.1.1
hrSystemDate.1.3.6.1.2.1.25.1.2
hrSystemInitialLoadDevice.1.3.6.1.2.1.25.1.3
hrSystemInitialLoadParameters.1.3.6.1.2.1.25.1.4
hrSystemNumUsers.1.3.6.1.2.1.25.1.5
hrSystemProcesses.1.3.6.1.2.1.25.1.6
hrSystemMaxProcesses.1.3.6.1.2.1.25.1.7
hrStorageTypes.1.3.6.1.2.1.25.2.1
hrMemorySize.1.3.6.1.2.1.25.2.2
hrStorageTable.1.3.6.1.2.1.25.2.3
hrStorageEntry.1.3.6.1.2.1.25.2.3.1
hrStorageIndex.1.3.6.1.2.1.25.2.3.1.1
hrStorageType.1.3.6.1.2.1.25.2.3.1.2
hrStorageDescr.1.3.6.1.2.1.25.2.3.1.3
hrStorageAllocationUnits.1.3.6.1.2.1.25.2.3.1.4
hrStorageSize.1.3.6.1.2.1.25.2.3.1.5
hrStorageUsed.1.3.6.1.2.1.25.2.3.1.6
hrStorageAllocationFailures.1.3.6.1.2.1.25.2.3.1.7
hrDeviceTypes.1.3.6.1.2.1.25.3.1
hrDeviceTable.1.3.6.1.2.1.25.3.2
hrDeviceEntry.1.3.6.1.2.1.25.3.2.1
hrDeviceIndex.1.3.6.1.2.1.25.3.2.1.1
hrDeviceType.1.3.6.1.2.1.25.3.2.1.2
hrDeviceDescr.1.3.6.1.2.1.25.3.2.1.3
hrDeviceID.1.3.6.1.2.1.25.3.2.1.4
hrDeviceStatus.1.3.6.1.2.1.25.3.2.1.5
hrDeviceErrors.1.3.6.1.2.1.25.3.2.1.6
hrProcessorTable.1.3.6.1.2.1.25.3.3
hrProcessorEntry.1.3.6.1.2.1.25.3.3.1
hrProcessorFrwID.1.3.6.1.2.1.25.3.3.1.1
hrProcessorLoad.1.3.6.1.2.1.25.3.3.1.2
hrNetworkTable.1.3.6.1.2.1.25.3.4
hrNetworkEntry.1.3.6.1.2.1.25.3.4.1
hrNetworkIfIndex.1.3.6.1.2.1.25.3.4.1.1
hrPrinterTable.1.3.6.1.2.1.25.3.5
hrPrinterEntry.1.3.6.1.2.1.25.3.5.1
hrPrinterStatus.1.3.6.1.2.1.25.3.5.1.1
hrPrinterDetectedErrorState.1.3.6.1.2.1.25.3.5.1.2
hrDiskStorageTable.1.3.6.1.2.1.25.3.6
hrDiskStorageEntry.1.3.6.1.2.1.25.3.6.1
hrDiskStorageAccess.1.3.6.1.2.1.25.3.6.1.1
hrDiskStorageMedia.1.3.6.1.2.1.25.3.6.1.2
hrDiskStorageRemoveble.1.3.6.1.2.1.25.3.6.1.3
hrDiskStorageCapacity.1.3.6.1.2.1.25.3.6.1.4
hrPartitionTable.1.3.6.1.2.1.25.3.7
hrPartitionEntry.1.3.6.1.2.1.25.3.7.1
hrPartitionIndex.1.3.6.1.2.1.25.3.7.1.1
hrPartitionLabel.1.3.6.1.2.1.25.3.7.1.2
hrPartitionID.1.3.6.1.2.1.25.3.7.1.3
hrPartitionSize.1.3.6.1.2.1.25.3.7.1.4
hrPartitionFSIndex.1.3.6.1.2.1.25.3.7.1.5
hrFSTypes.1.3.6.1.2.1.25.3.9
hrFSTable.1.3.6.1.2.1.25.3.8
hrFSEntry.1.3.6.1.2.1.25.3.8.1
hrFSIndex.1.3.6.1.2.1.25.3.8.1.1
hrFSMountPoint.1.3.6.1.2.1.25.3.8.1.2
hrFSRemoteMountPoint.1.3.6.1.2.1.25.3.8.1.3
hrFSType.1.3.6.1.2.1.25.3.8.1.4
hrFSAccess.1.3.6.1.2.1.25.3.8.1.5
hrFSBootable.1.3.6.1.2.1.25.3.8.1.6
hrFSStorageIndex.1.3.6.1.2.1.25.3.8.1.7
hrFSLastFullBackupDate.1.3.6.1.2.1.25.3.8.1.8
hrFSLastPartialBackupDate.1.3.6.1.2.1.25.3.8.1.9
hrSWOSIndex.1.3.6.1.2.1.25.4.1
hrSWRunTable.1.3.6.1.2.1.25.4.2
hrSWRunEntry.1.3.6.1.2.1.25.4.2.1
hrSWRunIndex.1.3.6.1.2.1.25.4.2.1.1
hrSWRunName.1.3.6.1.2.1.25.4.2.1.2
hrSWRunID.1.3.6.1.2.1.25.4.2.1.3
hrSWRunPath.1.3.6.1.2.1.25.4.2.1.4
hrSWRunParameters.1.3.6.1.2.1.25.4.2.1.5
hrSWRunType.1.3.6.1.2.1.25.4.2.1.6
hrSWRunStatus.1.3.6.1.2.1.25.4.2.1.7
hrSWRunPerfTable.1.3.6.1.2.1.25.5.1
hrSWRunPerfEntry.1.3.6.1.2.1.25.5.1.1
hrSWRunPerfCPU.1.3.6.1.2.1.25.5.1.1.1
hrSWRunPerfMem.1.3.6.1.2.1.25.5.1.1.2
hrSWInstalledLastChange.1.3.6.1.2.1.25.6.1
hrSWInstalledLastUpdateTime.1.3.6.1.2.1.25.6.2
hrSWInstalledTable.1.3.6.1.2.1.25.6.3
hrSWInstalledEntry.1.3.6.1.2.1.25.6.3.1
hrSWInstalledIndex.1.3.6.1.2.1.25.6.3.1.1
hrSWInstalledName.1.3.6.1.2.1.25.6.3.1.2
hrSWInstalledID.1.3.6.1.2.1.25.6.3.1.3
hrSWInstalledType.1.3.6.1.2.1.25.6.3.1.4
hrSWInstalledDate.1.3.6.1.2.1.25.6.3.1.5
hrMIBCompliances.1.3.6.1.2.1.25.7.2
hrMIBGroups.1.3.6.1.2.1.25.7.3
hrMIBCompliance.1.3.6.1.2.1.25.7.2.1