Some OpenNMS startup debbuging tips
Subscribe

From OpenNMS

Jump to: navigation, search

If you are having problems starting opennms, this may be helpful.

Identify root cause by checking the log files, reverting your last config change , making sure your database is operational, confirming you have free disk space, confirming proper file and security( selinux) permissions etc.

Example of what will get you in trouble Running a net-snmp trapd daemon on your opennms machine, can be done but somebody has to use a different port :-)

Ruuning a process/daemon that is listening on a service port that OpenNMS uses. Again, somebody has to use a different port or socket.

Ports OpenNMS needs by default are udp ports 67,68, 162, tcp port's 67,68,8180,8181, tomcat's default port is 8080 and postgres defaults to 5432. If something besides these is using on of these ports someone has to be changed, udp port 67,68 and 162 as well as tcp port 67 and 68 you can't change for OpenNMS, unless you don't want to monitor dhcp servers and or process snmp trap.

Ports 8180 and 8181 can be changed for OpenNMS in the service-configuration.xml you may need to edit the opennms.sh script depending on what version you are running as well. Make sure the "INVOKE_URL="http://localhost:8181/invoke?objectname=OpenNMS:Name=FastExit" matches the port number you specified in the service-configuration.xml.

Please feel free to add anything else one might deem as a potential conflict.

SELinux

If there are startup issues with getting Postgresql to start and create the database for OpenNMS (as in this post) the option is to either disable SELinux or create a policy for OpenNMS.

First, the way to see if SELinux is causing this problem or perhaps another problem is to "tail -f /var/log/messages".

Second, get the SELinux source loaded on your system under /etc/selinux/targeted/src. All major distros that support SELinux should have a source package available. This example is for a RHEL 4 system.

Third, create two files on the system for OpenNMS:

/etc/selinux/targeted/src/policy/domains/program/opennms.te /etc/selinux/targeted/src/policy/file_contexts/program/opennms.fc

Contents of file are as follows.

# cat ./domains/program/opennms.te
#DESC OpenNMS - Network Management server
#
# Author:  Diana Eichert <deicher@sandia.gov>
#

#################################
#
# Rules for the opennms_t domain.
#

type opennms_t, domain, privowner;
type opennms_lib_t, file_type, sysadmfile;

allow postgresql_t opennms_lib_t:file { getattr read execute };

# cat /etc/selinux/targeted/src/policy/file_contexts/program/opennms.fc
# opennms -- enterprise management system
/opt/opennms/lib/iplike.so      --      system_u:object_r:opennms_lib_t

then "make load" the new policy file. After that the security context for "iplike.so" must be changed to match what is defined in the ".fc" file:

# chcon -c system_u:object_r:opennms_lib_t /opt/opennms/lib/iplike.so