The OpenNMS server requires Postgres, Sun's J2SDK 1.4, and Apache Tomcat to run. The front-end and back-end operate independently, allowing a back-end (monitoring and database updating) restart without interruption to the front-end (HTML user interface and database querying). Conversely, the front-end can be disabled without stopping the back-end from monitoring. This is particularly useful when performing opennms package upgrades or making configuration changes. The Postgres database must be operational in order for either the front-end user interface or the back-end monitoring to function. For more resources on the inner workings of OpenNMS check out the section near the end of this document, Further Information.
OpenNMS must be configured at this point. If the OpenNMS server
is started without a proper configuration, ERROR and WARN will show
up in your log files and things will be a general mess.
Read the
HOWTOs. Basic (very) configuration must have ip addresses in the appropriate
include lines in capsd-configuration.xml, discovery-configuration.xml,
collectd-configuration.xml and poller-configuration.xml. Ensure appropriate
modifications to the packages in the poller-configuration.xml and
collectd-configuration.xml to control polling and data collection
from specific groups of devices. Ensure that community strings are
entered properly in snmp-config.xml. For quick node name resolution
(i.e. no DNS delays to affect processing of events or DNS queries
to generate network traffic) modify the /etc/hosts file with appropriate
device names. SNMP names will be used if devices are configured for
SNMP properly.
The Postgres server must be running prior to starting the back-end (OpenNMS pollers) or the front-end (web interface). The startup order (automatic with system startup) is:
bash#/etc/init.d/postgresql start (Postgres)bash#/etc/init.d/tomcat4 start (Web UI)bash#/etc/init.d/opennms start (OpenNMS engine)
Shutdown is the reverse except with the stop directive, rather
than start . It is important that Postgres starts first and is shutdown
last. Of course this happens automatically with the init scripts
on a complete system startup or shutdown. Except for database maintenance,
the Postgres service should never require manual starting or stopping,
even after configuration changes.
bash~#/etc/init.d/tomcat4 stop bash~#/etc/init.d/opennms stop
bash~#cp /etc/opennms/map.disable /etc/opennms/map.enable
/etc/default/tomcat4 uncomment the following CATILINA_OPTS
line:
# Arguments to pass to the Java virtual machine (JVM) # "-Djava.awt.headless=true" is automatically set if CATALINA_OPTS is empty CATALINA_OPTS=""
bash~#/etc/init.d/tomcat4 start bash~#/etc/init.d/opennms start
At the time of v1.5 of this document, Windows and Mac users could
use the SVG maps if the the Adobe SVG plugin was installed. Windows
users can get this plugin from
Adobe SVG Downloads. Linux users may have to wait for
lirsvg2 to be fully integrated with Moziila/Galeon/Safari, etc. The
PNG format works exactly the same (in appearance). SVG is a standard
maintained by the
w3c.
This section covers very basic operations on the ONMS Postgres database.
If it is suspected that the database has gained entropy, this is a good idea.
bash~#/etc/init.d/tomcat4 stop bash~#/etc/init.d/opennms stop
bash~#su - postgres
bash~$/usr/lib/postgresql/bin/vacuumdb -v -f -d opennms
bash~#/etc/init.d/opennms start bash~#/etc/init.d/tomcat4 start
This process can be used to 'reset' the server's database while
preserving the OpenNMS configuration data. A system admin that suspects
that a problem or corruption in the database can use this process
to clean out the entire Postgres database, and restart it using the
current configuration. i.e. Current device nodes will be preserved,
however events for those nodes will be purged. The RRD data will
be preserved unless manually removed from /usr/share/opennms/share/.
bash~#su - postgres
bash~$dropdb opennms
bash~$exit
bash~#/usr/share/opennms/bin/install.pl -q /usr/share/opennms/etc/create.sql -l /usr/lib/postgresql/lib/opennms
Three backup files are created with this process. In our example
they will be 062303_onms_sql.tar.gz, 062303_onms_etc.tar.gz and 062303_onms_rrd.tar.gz.
These files should be created at the same time to ensure that the
rrd data, the SQL database and the configuration files match. It
is necessary to capture the configuration and the databases at the
same time in order to start an ONMS server with restored data.
(Not tested, though this may work while ONMS is running with only the web UI shutdown).
bash~#/etc/init.d/tomcat4 stop bash~#/etc/init.d/opennms stop
bash~#/etc/init.d/tomcat4 stop
bash~#/etc/init.d/opennms stop
bash~#su - postgres
bash~$/usr/lib/postgresql/bin/vacuumdb -v -f -d opennms
bash~$pg_dumpall > 062303_onms_sql
bash~$tar cvfz 062303_onms_sql.tar.gz 062303_onms_sql
bash~$scp 062303_onms_sql.tar.gz backupuser@backupserver:
bash~$rm 062303_onms_sql*
bash~$exit
bash~#tar cvfzP 062303_onms_etc.tar.gz /etc/opennms/* -R
bash~#scp 062303_onms_etc.tar.gz backupuser@backupserver:
bash~#rm 062303_onms_etc.tar.gz
bash~#tar cvfzP 062303_onms_rrd.tar.gz /usr/share/opennms/share/* -R
bash~#scp 062303_onms_rrd.tar.gz backupuser@backupserver:
bash~#rm 062303_onms_rrd.tar.gz
bash~#scp backupuser@backupserver:062303* .
bash~#su - postgres
bash$dropdb opennms
bash~$exit
bash~#/usr/share/opennms/bin/install.pl -q /usr/share/opennms/etc/create.sql -l /usr/lib/postgresql/lib/opennms
bash~#su - postgres
bash~$tar xvfz /root/062303_onms_sql.tar.gz bash~$psql -f 062303_onms_sql opennms
There will be some ERROR messages regarding structures that already exist, these can be safely ignored.
bash~$exit
bash~#tar xvfzP 062303_onms_etc.tar.gz
bash~#rm /usr/share/opennms/share/* -rf
bash~#tar xvfzP 062303_onms_rrd.tar.gz
bash~#rm 062303*
Restart Tomcat4 and OpenNMS
bash#/etc/init.d/tomcat4 start
bash#/etc/init.d/opennms start
The ONMS system logs all activity to /var/log/opennms. Messages
within the log files contain either FATAL, ERROR, WARN, INFO or DEBUG
tags. The size and verbosity of the log files can be controlled by
modifying /etc/opennms/log4j.properties. By default each file is
set to INFO level (not as verbose as DEBUG) and will grow to 100MB.
Each log file will "spawn" four times (i.e. 400MB total).
All of these settings can be changed.
To view error messages that contain the ERROR tag, use the following
command:
bash#grep "ERROR" /var/log/opennms/* | more
Replacing ERROR with another tag such as FATAL or WARN will display
all log messages with that particular tag. Logs should contain no
FATAL messages, minimal ERROR messages (ideally none), and possibly
many WARN and INFO messages that should be at least be fully understood.
Related log messages will often share a common 'Pool-Fibre' as shown
below. Time and Date can be used to correlate messages between different
log files. Always try to determine the root cause, or initial error
message as often the final error message is preceded by more meaningful
log messages. Often related log messages are separated by other unimportant
messages so creative use of grep and | is often required. Remember
that there can be many situations that result in the same message.
For help on troubleshooting messages please see the
Log Troubleshooting section.
A device has other private interfaces that are not reachable by ONMS (but automatically detected and added to the interface table)
INFO [Capsd Rescan Pool-fiber1] FtpPlugin: FtpPlugin: Unable to test host 10.8.9.2, no route available... WARN [Capsd Rescan Pool-fiber1] IfCollector: IfCollector: No route to host 10.8.9.2, continuing protocol scans. INFO [Capsd Rescan Pool-fiber1] TcpPlugin: TcpPlugin: Could not connect to host 10.8.9.2, no route to host
Log files can grow very quickly making it difficult to find valuable
information within. In order to minimize the effort required to troubleshoot
problems, it is a good idea to backup the current logs and purge
them before performing an OpenNMS restart. DO NOT DELETE /var/log/*
as this will disable the Linux server. The procedure below outlines
a typical restart scenario where the log files are backed up to the
directory /root .
bash#/etc/init.d/opennms stop
bash#tar cvfz /root/opennms_logs_061703.tar.gz /var/log/opennms/*
bash#rm -rf /var/log/opennms/*
bash#/etc/init.d/opennms start