Step by step Method to install OpenNMS

Note: Make sure snmp is already installed on the Server. If not run

apt-get install snmpd -y 

Add the OpenNMS Repository to Your sources.list

deb stable main
deb-src stable main 

Add the OpenNMS PGP Key to APT

wget -O - | sudo apt-key add - 
apt-get update 


apt-key adv --recv-keys --keyserver 4C4CBBD9
apt-get update
Installing PostgreSQL

apt-get install postgresql-8.3  
Modify pg_hba.conf file in /etc/postgresql/8.3/main/ 
comment all other lines in this file.

local   all         all                               trust
# IPv4 local connections:
host    all         all          trust
# IPv6 local connections:
host    all         all         ::1/128               trust
host    all         all  trust     <=== Double check it can be

Edit postgresql.conf to Allow TCP/IP Connections

vi /etc/postgresql/8.3/main/postgresql.conf 
Uncomment following line 
listen_addresses = 'localhost' 

Restart the Postgresql Database

/etc/init.d/postgresql-8.3 restart 

Installing OpenNMS

apt-get install opennms 
we need to set opennms home in /etc/environment

add the following line
execute the following command for setting OPENNMS_HOME for existing session 
export OPENNMS_HOME=/usr/share/opennms 
Before you can run the post-install, OpenNMS needs to be configured  to use an appropriate Java Runtime Environment (JRE). The OpenNMS tool  runjava is used to set this up, and it can either search for a suitable  JRE or you can tell it exactly which JRE to use.

# /usr/share/opennms/bin/runjava -s 

This tool will setup the opennms database within PostgreSQL among other things.

# /usr/share/opennms/bin/install -l /usr/local/lib -dis 

you should see similar output after executing above command

- checking table "qrtz_fired_triggers"...
- checking table "qrtz_fired_triggers"... CREATED
- granting access to 'qrtz_fired_triggers' for user 'opennms'... DONE
- checking table "qrtz_scheduler_state"...
- checking table "qrtz_scheduler_state"... CREATED
- granting access to 'qrtz_scheduler_state' for user 'opennms'... DONE
- checking table "qrtz_locks"...
- checking table "qrtz_locks"... CREATED
- granting access to 'qrtz_locks' for user 'opennms'... DONE
- creating tables... DONE
- inserting initial table data for "categories"... OK
- inserting initial table data for "qrtz_locks"... OK
- inserting initial table data for "distPoller"... OK
- checking if iplike is usable... YES
- checking for stale references... OK 
Installer completed successfully! 
Start opennms using the following command

/etc/init.d/opennms start 
OpenNMS will take some time to start, you can check the status of opennms using the following command
root@server1:/usr/local/lib# /etc/init.d/opennms status
OpenNMS.Eventd         : running
OpenNMS.Trapd          : running 
OpenNMS.Queued         : running
OpenNMS.Actiond        : running
OpenNMS.Capsd          : running
OpenNMS.Notifd         : running
OpenNMS.Scriptd        : running
OpenNMS.Rtcd           : running
OpenNMS.Pollerd        : running
OpenNMS.PollerBackEnd  : running
OpenNMS.Ticketer       : running
OpenNMS.Collectd       : running
OpenNMS.Threshd        : running
OpenNMS.Discovery      : running
OpenNMS.Vacuumd        : running
OpenNMS.EventTranslator: running
OpenNMS.PassiveStatusd : running
OpenNMS.Statsd         : running
OpenNMS.Importer       : running
OpenNMS.JettyServer    : running
opennms is running 
if you are able to see like above your opennms is running without any problems.
If you don't see the above output and get at error asking you to look at a log file.. /var/log/opennms/daemon/output.log and the log file mentions the following error..
An error occurred while attempting to start the "OpenNMS:Name=Dhcpd"
service (class org.opennms.netmgt.dhcpd.jmx.Dhcpd).  Shutting down and exiting.
Edit the file $OPENNMS_HOME/etc/service-configuration.xml and comment out the following portion as follows; and restart the opennms service.

               <invoke at="start" pass="1" method="start"/>
               <invoke at="status" pass="0" method="status"/>
               <invoke at="stop" pass="0" method="stop"/>

Finally you can access web UI using the following URL ( replace yourhost to the IP of the opennms server)
Configuration of OpenNMS
Login in to the web interface  with  login / pass  admin/admin
Configure Discovery - Select  Home  /  Admin  /  Discovery  / Add New    -- Include Range.
Configure SNMP  - Select Home  / Admin  / Configure SNMP by IP

Database Login Details
opennms/postgres ( test user and password i have given )
Add Alert sound to the OpenNMS webUI 
In /usr/share/opennms/jetty-webapps/opennms/includes/servicesdown-box.jsp 
Find below tags should be at the end of the file
  <embed src="tngchime.wav" type="audio/x-pn-realaudio-plugin" hidden="true" autostart="true" loop="false" height="0"  width="0">
  <ul class="plain">
  <c:forEach var="summary" items="${summaries}">
  <c:url var="nodeLink" value="element/node.jsp">
  <c:param name="node" value="${summary.nodeId}"/>
  <li><a href="${nodeLink}">${summary.nodeLabel}</a> (${summary.fuzzyTimeDown})</li>
  <c:if test="${moreCount > 0}">
  <p class="noBottomMargin" align="right">
  <c:url var="moreLink" value="outage/current.jsp"/>
  <a href="${moreLink}">${moreCount} more...</a>
The line with the  tag is new, the rest is stock 
Download the following .wav file and pleace it in /usr/share/opennms/jetty-webapps/

You don't need to restart OpenNMS to effect
Once you are done with above settings please install QuickTimeInstaller.exe in your windows system and restart the browser if opennms find any outages as soon as you login to OpenNMS webGUI you will hear alert sound ( check your sound volume)

No comments: