Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Introduction to SNMP monitoring [closed]

I've been tasked with writing a monitoring program for my company's server software that integrates with zenoss via snmp.

To be brief, I can't get anything up off the ground. I think my first goal is to figure out the correct way to write an snmp agent (in any language to start, although it will eventually be in java). Are there any good test harnesses out there? I've used snmptest, which ships with zenoss, but it's not much good to me if I can't get a test agent off the ground. Anything that I know the zenoss manual has a lot of info, but it seems to presume a prior knowledge of standard systems monitoring practices and tools, and I can barely penetrate it.

Also, is it generally a good practice to use snmp to monitor software?

like image 711
David Berger Avatar asked Apr 24 '09 20:04

David Berger


3 Answers

Short description of a typical SNMP agent:

  1. Set the agent up. This usually entails telling it what server to send alerts to.

  2. Run it.

  3. Send appropriate SNMP messages to the configured server when things happen.

  4. Reply to requests from the configured server.

All of the request/reply stuff is done using SNMP messages. If your company does not have a specially designed/assigned OID for the server software, you'll need to look into the standard MIB definitions to determine which OID(s) are appropriate.

MIB: Management Information Block. These come in standard and custom flavors. Standard ones are defined by a standards body (IETF?). Custom ones are created by vendors to support information unique to their product(s). MIBs are basically collections of OIDs.

OID: Object IDentifier - this is a dotted-notation number string that identifies the piece of hardware/software, and the bit of information you're looking for from it - for example, the number of TX collisions on an ethernet port might look something like: 1.5.82.316.8.4.3 (though that's not a valid OID, it's just a made-up example).

More detail available at Wikipedia. Download a free MIB browser to get an idea of what OIDs look like, and how detailed they can get. Check the RFCs for more detailed information. Look at something like perl's Net-SNMP - you may even be able to use the snmpd software that's included with it to do most of your work.

like image 122
Harper Shelby Avatar answered Sep 27 '22 23:09

Harper Shelby


SNMP is certainly an acceptable way to monitor your network, devices and servers. Because it uses UDP it won't unduly stress the network via TCP retries and the like (SNMP clients are, or should be, architected to handle dropped packets etc.). Plus you'll have a huge array of client solutions to monitor your system and integrate against.

If you envisage a final solution in Java, see the Java/SNMP documentation and SNMP4J

SNMP.com (founded by Jeffrey Case, one of the SNMP architects) sells extensible SNMP agents. One of these may save you a world of grief.

like image 25
Brian Agnew Avatar answered Sep 27 '22 23:09

Brian Agnew


nSoftware has an SNMP agent (not free). This might be easier than rolling your own.

Also check out William Stalling's book: SNMP.

like image 44
Jon B Avatar answered Sep 28 '22 01:09

Jon B