Next Previous Contents

13. Appendix E - Quick Xen Monitored Host Setup

Lets assume the goal of executing this document is to provide a monitoring server alongside other Xen linux hosts with the following assumptions:

13.1 Configure Server

Add the Xen DomU and Dom0 IP addresses to /etc/opennms/include.

Add the community string for snmp management on the DomU/Dom0 to /etc/opennms/snmp-config.xml.

Adding specific SNMP OIDS to /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>

Tweak DEBUG to WARN in /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.

Configure Tomcat

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

13.2 Configure SNMP on the hosts

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.

Edit the community string

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

Edit the snmp host information

In /etc/snmpd/snmpd.conf modify the syslocation and syscontact configuration lines.

Add support for hddtemp (Only in Dom0 where there are real disks)

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

Add support for monitoring disk space

In /etc/snmpd/snmpd.conf add the following configuration lines to monitor the root filesystem.

disk / 100000 


Next Previous Contents