views:

727

answers:

6

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?

+1  A: 

Zenoss is quite complicated and comes with many pre-defined SNMP stuff. Do you really need to code your own SNMP agents?

Peter D
I don't exactly know whether I need to code my own snmp agents. I think I need to design my own snmp agents in that I should need to be able to define some traps to send regularly and some properties that can be requested. How manually I'll have to do that is a mystery to me.
David Berger
+2  A: 

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

Also check out William Stalling's book: SNMP.

Jon B
+6  A: 

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.

Harper Shelby
I presume in 3) you're referring to traps ?
Brian Agnew
Yes, those would be SNMP traps.
Harper Shelby
+3  A: 

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.

Brian Agnew
A: 

SNMP is a big topic, with lots of complexity if you go into all the details and all the historical versions of the protocol and related tools. I'd suggest picking up a copy of Essential SNMP by Mauro and Schmidt, which gives a very clear introduction to both the fundamental ideas behind SNMP as well as practical examples of how to get started with it and use it in parctice with a number of different tools.

Jason Abate
A: 

you can aim lower and try the Cacti (http://www.cacti.net/).

I too tried the Zenoss but gave up. The Cacti was up and running pretty fast. I just monitor use of bandwith of quite a few routers and many many ports in switches all over the country. But there are templates for monitoring all kind of things more related to a single server (temp, fan speed etc.)

BR. Anders

Tillebeck