SNMP Warnings in Debian Squeeze
The default installation of snmpd in Debian Squeeze will put several warnings into the daemon.log.
The reason is the licensing of the MIB files, that is not compatible with Debian.
If you are not satisfied with errors on each restart of the snmpd, here are the steps, that solved this problem in my case:
- Edit /etc/apt/sources.list and append contrib and non-free to the standard repositories.
- apt-get update
- apt-get install snmpd snmp-mibs-downloader
- Edit /etc/default/snmpd:
export MIBS=/usr/share/mibs/netsnmp/UCD-SNMP-MIB
Commenting the original line export MIBS= did not help, also the definition export MIBS=/usr/share/mibs/netsnmp did not work, so I will leave the MIBS reference in the configuration on UCD-SNMP_MIB.
SNMP Monitoring for Java VM
SNMP is not really simple, but quite a useful protocol, if you want to run standard monitoring tools like Nagios, Zero RRD or Cacti.
Even though Java offers JMX for runtime information like thread and memory consumption, you can also use SNMP to read at least a subset.
In my opinion usage of a standard monitoring tool has several advantages over JMX-based visualization in jconsole or Lambda Probe:
- Statistics fit into centralized reporting, e.g. for SLAs.
- The tools are independent of the Java VM. If the VM freezes, the history is still available
First you need to enable the SNMP Agent in your Java VM. Please find the details here. This is only an outline:
- Prepare an ACL configuration at $JAVA_HOME/lib/management/snmp.acl. On Sun's Java 6 for Ubuntu 10.04 64 Bit you will find these files in the package ia32-sun-java6-bin.
- Use the following options on the command line to enable SNMP:
-Dcom.sun.management.snmp.port=7667 -Dcom.sun.management.snmp.acl.file=$JAVA_HOME/lib/management/snmp.acl
If you really put the snmp.acl at $JAVA_HOME/lib/management, it's very likely, you will not need to specify the com.sun.management.snmp.acl.file option.
Now you are ready to read the internal state by using SNMP:
- Zero Agent's module for Java SNMP just needs the port specified in conf/enabled/JavaSNMP.conf.
- Please find some available OIDs in the source code of JavaSNMP.pm
- The full list of available values is included in the following MIB.
Cacti at Home (DD-WRT)
I recently used my MRTG to analyse some network problems at home. Since zooming felt not easy enough, I installed Cacti to monitor my DD-WRT interfaces (LAN, WLAN, DSL).
Now the only problem are the enforced downtimes of my main system in the context of Green IT. But for the usual request like Why is the internet currently so damn slow and unstable? I can use the nice reporting features of Cacti instead of BOFH-style excuses to explain that.
I just had to map the router's devices eth0, eth1, ppp0 (Linksys WRT54G/GL/GS) to some graphs (eth0/LAN, eth1/Wireless, ppp0/DSL).
Since DD-WRT is Linux-based, CPU Usage and Load Average will also work on that device.
Nagios SNMP
SNMP (at least running in Linux using the NET-SNMP) is providing enough data to setup checks for CPU load, idle resources, memory, disk and processes in Nagios.
I recently migrated a quite few nodes from purely SNMP-based monitoring into Nagios and this was possible without modifications on the nodes, since check_snmp (load, idle), check_snmp_process_monitor.pl, check_snmp_disk_monitor.pl and check_snmp_mem.pl (besides HTTP, SMTP, ...) provide all the checks I need.
This will run even over TCP, if UDP is a problem. And it's extendable by external commands, if you really need this, not talking about the AgentX interface.
Beware that you use a proper memory check, that can handle buffers and cache in Linux, otherwise you will run into a lot of false positives.
check_snmp_process_monitor.pl, check_snmp_disk_monitor.pl are included in the contrib section of the Nagios Plugins.
I found check_snmp_mem.pl at http://nagios.manubulon.com/.
But if anyone has an idea about getting the same scope of data for a Windows node by means of SNMP, any comment in this direction is appreciated.