Lets assume the goal of executing this document is to provide a monitoring server alongside other Xen linux hosts with the following assumptions:
/etc/opennms/include./etc/opennms/snmp-config.xml. /etc/opennms/datacollection-config.xml. There are few OIDS we like to have available for monitoring
lm-sensors
and
hddtemp. For hddtemp, add the appropriate configuration to /etc/snmpd/snmpd.conf
as described in the next subsection. Add the support for these with
the following lines:
<group name="hddtemp" ifType="ignore"> <mibObj oid=".1.3.6.1.4.1.2021.8.1.101" instance="1" alias="hda" type="string" /> <mibObj oid=".1.3.6.1.4.1.2021.8.1.101" instance="2" alias="hdc" type="string" /> </group> <group name="lmSensors" ifType="ignore"> <mibObj oid=".1.3.6.1.4.1.2021.13.16.2.1.3" instance="2" alias="temp1" type="gauge" /> <mibObj oid=".1.3.6.1.4.1.2021.13.16.2.1.3" instance="1" alias="temp2" type="gauge" /> <mibObj oid=".1.3.6.1.4.1.2021.13.16.3.1.3" instance="1" alias="fan1" type="gauge" /> <mibObj oid=".1.3.6.1.4.1.2021.13.16.3.1.3" instance="2" alias="fan2" type="gauge" /> </group>
/etc/opennms/log4j.properties
monms:~# vi /etc/opennms/log4j.properties
In vi, the command :%s/DEBUG/INFO/g will change the log
to output high level informational messages, instead of fine grained
detail on the running OpenNMS system.
nz-nms:# /etc/init.d/tomcat4 stop nz-nms:# vi /etc/default/tomcat4
Add the following lines:
TOMCAT4_USER=root CATALINA_OPTS="-Djava.awt.headless=true -Xmx96M -server"
The first directive tells the tomcat server to run as the root user. The second directive reduces the memory footprint to 96MB for the lightweight configuration. Start tomcat back up.
nz-nms:# /etc/init.d/tomcat4 start
On Dom0, we also want sensors for physical disks, temperature, fans, etc. With only one set of physical hardware running the Xen environments, monitoring becomes critical; This is the key synergy to the OpenNMS domU.
domU~# apt-get install snmpd dom0~# ap-get install snmpd lm-sensors hddtemp
Depending on your config, you may need to modprobe i2c-dev and
# cd /dev && ./MAKEDEV i2c and sensors-detect.
In /etc/snmpd/snmpd.conf change to snmp community string, which
for read-only access with the community string oUrstrIng would require
adding the following line:
com2sec readonly default oUrstrIng
In /etc/snmpd/snmpd.conf modify the syslocation and syscontact
configuration lines.
Many cheap commodity IDE drives, have build in thermisistors
for monitoring temperature. These can be easily monitored by adding
a simple script to output the current value, and then configuring
snmpd to process the returned value, making it availabe to OpenNMS.
In /usr/local/bin/hddtemp_snmp put the following:
#!/bin/sh
/usr/sbin/hddtemp /dev/hda | /usr/bin/awk '{print$4}'
On some etch systems, depending on the hddtemp configuration
the following alternative line will work if the hard disk model is
contained within /etc/hddtemp.db:
/usr/sbin/hddtemp -qn /dev/hda
In /etc/snmpd/snmpd.conf add the following line:
exec hddtemp /usr/local/bin/hddtemp_snmp
In /etc/snmpd/snmpd.conf add the following configuration lines
to monitor the root filesystem.
disk / 100000