SNMP Informant How-To - OpenNMS _ the OpenNMS Project

8
Home About OpenNMS Get OpenNMS Get Support Get Involved Get Stuff Wiki | Live Demo | Events | News | Contact Us Log in / create account .COM | .ORG SNMP Informant How-To Get OpenNMS Main Page Latest Release Other Downloads SourceForge Project Get Help Official Documentation FAQs White Papers Discussion Lists Commercial Support Get Involved Development Home Report a Bug #opennms IRC Current Events SNMP Informant How-To - OpenNMS | The OpenNMS Project http://www.opennms.org/wiki/SNMP_Informant_How-To 1 de 8 24/02/2014 11:58 a.m.

Transcript of SNMP Informant How-To - OpenNMS _ the OpenNMS Project

  • HomeAbout OpenNMSGet OpenNMSGet SupportGet InvolvedGet Stuff

    Wiki |Live Demo |Events |News |Contact Us

    Log in / create account

    .COM |

    .ORG

    SNMP Informant How-To

    Get OpenNMS

    Main PageLatest ReleaseOther DownloadsSourceForge Project

    Get Help

    Official DocumentationFAQsWhite PapersDiscussion ListsCommercial Support

    Get Involved

    Development HomeReport a Bug#opennms IRCCurrent Events

    SNMP Informant How-To - OpenNMS | The OpenNMS Project http://www.opennms.org/wiki/SNMP_Informant_How-To

    1 de 8 24/02/2014 11:58 a.m.

  • Browse Source CodeAPI docsXSD docs

    Get to Know Us

    Order of the Green PoloOpenNMS Store

    Tools

    What links hereRelated changesSpecial pagesPrintable versionPermanent link

    PageDiscussionView sourceHistory

    SNMP Informant How-To - OpenNMS | The OpenNMS Project http://www.opennms.org/wiki/SNMP_Informant_How-To

    2 de 8 24/02/2014 11:58 a.m.

  • From OpenNMS

    People using OpenNMS often wonder how to get SNMP information, such as traps and OIDs for data collection,into OpenNMS.

    Recently, I did a rather complete examination of the SNMP-Informant standard MIB for a client, so I thought Iwould share the process in the Wiki page.

    The first step in adding MIB information to OpenNMS is to find the MIB (grin). For SNMP-Informant, there is aMIBs directory in the folder that comes with the distribution. In it are both version 1 and version 2 mibs - itreally doesn't matter which one we use.

    There are two MIBs for the standard SNMP Informant agent: INFORMANT-STD.MIB and WTCS.MIB

    The second step is to determine exactly what you want to get out of the MIB. There are two, distinctly differentthings: traps to convert to events and OIDs to use in the collection of performance data.

    A quick search for TRAP-TYPE and NOTIFICATION-TYPE in these two MIBs shows that neither containtraps, so we can ignore that here. Should you want to get trap information into OpenNMS, you need to use themib2opennms tool, discussed elsewhere.

    For data collection, there is another tool called the mibparser that will convert the OIDs in a MIB to a formatthat can be placed in the datacollection-config.xml file. There is even a convenient wrapper script to run it:

    (Note: This wrapper works with Java 1.4.x ONLY)

    $OPENNMS_HOME/contrib/mibparser/dist/parseMib.sh INFORMANT-STD.MIB

    This gives me the error:

    ERROR: can't find parent 'informant' for textOid 'standard' Find which MIB the parent is defined in and add that to the command line

    Since "informant" is defined in the WTCS.MIB file, I need to add that to my command:

    $OPENNMS_HOME/contrib/mibparser/dist/parseMib.sh WTCS.MIB INFORMANT-STD.MIB

    This returns a lot of output in a format that can be used in the datacollection-config.xml file.

    Rather than post it here (I'm going to pretty much post it all anyway), I'll break it out later in the document.

    Once I have successfully produced output from a MIB, I check it out to see how easy it will be to add it toOpenNMS. The things to look for are whether or not the data is in a table, and whether or not the data type isnumeric.

    This MIB provides for main areas of information: disk, memory, network, processes/threads and cpu.

    Since the memory and processes information is not stored in a table, it's real easy to configure that and it isalready included in the basic datacollection-config.xml file.

    SNMP Informant How-To - OpenNMS | The OpenNMS Project http://www.opennms.org/wiki/SNMP_Informant_How-To

    3 de 8 24/02/2014 11:58 a.m.

  • For example, the output for the mibParser looks like this:

    Note that the instance is numeric ("0") which means the data is not in a table. Since RRDTool/jRobin can onlystore numeric data, it also helps that the data type on all of these values is "Gauge32".

    You'll note that the alias for most of these OIDs has the letters "TOOLONG" in it. RRDTool has a 19 characterlimitation, and this is the parser's way of indicating that something needs to be changed. I also like to indicate inthe alias name what device/MIB the data is from, so this ends up in datacollection-config.xml as:

    Note that each alias is 19 characters or less, and that "sinf" for SNMP-Informant has been prefixed to each one.

    The other three groups in this MIB, which reside in tables, are not so easy. The problem lies with howSNMP-Informant uses instances. For example, this is the available information for disks (output from themibparser):

  • SNMP Informant section, I added the following report:

    report.sinf.diskfreeC.name=Available Disk Space (Drive C) (SNMP-Inf)report.sinf.diskfreeC.columns=sinfDskPtFreeSpcCreport.sinf.diskfreeC.type=nodereport.sinf.diskfreeC.command=--title="Windows Available Space Disk Drive C (SNMP-Informant)" \ DEF:availspace={rrd1}:sinfDskPtFreeSpcC:AVERAGE \ LINE2:availspace#ff0000:"% Avail." \ GPRINT:availspace:AVERAGE:"Avg \\: %10.2lf %s" \ GPRINT:availspace:MIN:"Min \\: %10.2lf %s" \ GPRINT:availspace:MAX:"Max \\: %10.2lf %s\\n"

    This will need to be repeated for all the other disks as well as adding it to the reports= line at the top of the file.

    Finally, we want to know when the available disk gets to, say, 5%, so edit the thresholds.xml file and add:

    The next thing to look at are CPU stats:

    I only have one CPU on my machine, but I get:

    $ snmpwalk -v 1 -c public butters.opennms.com .1.3.6.1.4.1.9600.1.1.5.1.1 SNMPv2-SMI::enterprises.9600.1.1.5.1.1.1.48 = STRING: "0" SNMPv2-SMI::enterprises.9600.1.1.5.1.1.6.95.84.111.116.97.108 = STRING: "_Total"

    and as you can see, we get both a single CPU and _Total.

    The statistic that most people are interested in is how busy is the CPU? From the SNMP Informant MIB:

    cpuPercentProcessorTime OBJECT-TYPE SYNTAX Gauge32 MAX-ACCESS read-only STATUS current DESCRIPTION "% Processor Time is the percentage of time that the processor is executing a non-Idle thread. This counter was designed as a primary indicator of processor activity. It is calculated by measuring the time that the processor spends executing the thread of the Idle process in each sample interval, and subtracting that value from 100%. (Each processor has an Idle thread which consumes cycles when no other threads are ready to run). It can be viewed as the percentage of the

    SNMP Informant How-To - OpenNMS | The OpenNMS Project http://www.opennms.org/wiki/SNMP_Informant_How-To

    6 de 8 24/02/2014 11:58 a.m.

  • sample interval spent doing useful work. This counter displays the average percentage of busy time observed during the sample interval. It is calculated by monitoring the time the service was inactive, and then subtracting that value from 100%." ::= { processorEntry 5 }

    I especially liked "This counter was designed as a primary indicator of processor activity" since that is what weare looking for. So a value of 100% would be bad if sustained.

    So off to modify datacollection-config.xml again:

    This will collect the values we want.

    And now for a sample graph to place in snmp-graph.properties:

    report.sinf.cpu0percent.name=Windows CPU 0 Percent Processor Time (SNMP-Inf) report.sinf.cpu0percent.columns=sinfCpuPtProcTime0 report.sinf.cpu0percent.type=node report.sinf.cpu0percent.command=--title="Windows CPU 0 Utilization (SNMP-Informant)" \ DEF:utilization={rrd1}:sinfCpuPtProcTime0:AVERAGE \ LINE2:utilization#ff0000:"% util." \ GPRINT:utilization:AVERAGE:"Avg \\: %10.2lf %s" \ GPRINT:utilization:MIN:"Min \\: %10.2lf %s" \ GPRINT:utilization:MAX:"Max \\: %10.2lf %s\\n"

    Remember to add it to the "reports=" line at the top of the file.

    For thresholds, it's similar to above:

    This will require three consecutive polls where the CPU is at 100% before the alarm will be raised.

    Retrieved from "http://www.opennms.org/w/index.php?title=SNMP_Informant_How-To&oldid=14533"Categories: SNMP Data Collection Configuration How-Tos Windows

    About OpenNMS |Get OpenNMS |Get Support |Get Involved |Get Stuff

    This page was last modified on 13 May 2013, at 13:36.

    SNMP Informant How-To - OpenNMS | The OpenNMS Project http://www.opennms.org/wiki/SNMP_Informant_How-To

    7 de 8 24/02/2014 11:58 a.m.

  • This page has been accessed 61,603 times.Content is available under a Creative Commons Attribution-NonCommercial-ShareAlike2.5 Licenseunless otherwise noted.

    SNMP Informant How-To - OpenNMS | The OpenNMS Project http://www.opennms.org/wiki/SNMP_Informant_How-To

    8 de 8 24/02/2014 11:58 a.m.