Sunday, November 8, 2009

opennms install on ubuntu

We currently user nagios for network monitoring, but it has a buttload of crazy config files to even remotely work correctly. As an alternative I decided to give opennms a try to see if there wan easier way to keep track of thing. Note, my home network is probably more complicated that many small businesses as I've got around 10-12 computers/printers/wireless bridges/media servers/etc running at any given time and I have android, linux, windows, Mac all connected at various times.

The reasons for trying opennms where:
#1 free (as in both speech and beer)
#2 it purportedly supports autodiscovery (please work!)
#3 it's java based (no shell scripts??)

So I installed via synaptic, and promptly dicovered that it requires postgres out of the box. I additionally had a couple of "gotchas", which I'll document here.

Off the bat, I tried to start via sudo /etc/init.d/opnenms start and it immediately complained and said I needed to do some extra setup steps. Let me say that there ARE instructions here for those weak kneed sissys who actually NEED them. They are, however, not tailored for ubuntu and "the Debian way".

In the context of the above directions (yes Nancy, you'll need to read them) on ubuntu, OPENNMS_HOME is /usr/share/opennms.

You'll need to get postgres and sun-java6-jdk. For some reason I had the openjdk installed and it complained that this MIGHT not work, so I installed the sun jdk and reconfigured to be the default:

sudo update-java-alternatives -s java-6-sun


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

I then tried this

sudo /usr/share/opennms/bin/install -dis

But got exceptions connecting to the database. Evidently, by default, the postgres user cannot connect via a password. To get around this, I created a new account "opennmsadmin" that is a superuser that can connect via a password.

sudo su - postgres
createuser -s postgresadmin
createlang plpgsql opennms
> create user opennms password 'opennms';
> create database opennms;
> create database opennmsadmin;
> alter user opennmsadmin with password 'opennmsadmin';
> grant all privileges on database opennms to user opennms;
> grant all privileges on database opennmsadmin to user opennms;


I realize that there are a couple of extra steps in there... I probably could have just done a
createuser -s postgresadmin -P (to set the password) and skipped the alter user step.


I then could edited the connection info contained in /etc/opennms/opennms-datasources.xml

sudo vi /etc/opennms/opennms-datasources.xml

and then run the setup.

sudo /usr/share/opennms/bin/install -dis

It SAID it completed correctly, so now I can run

/etc/init.d/opennms start

and wait while the JVM consumes all available resources on your machine (just kidding, but it IS slow to startup IMHO).

after that, you can navigate to:

You can then configure which ranges of IPs should be scanned (there are also instructions on how to do this a different way here):

Seems to work, autodiscovery is NICE... need to talk to the network guys tomorrow.

No comments: