Installing NMIS (Network Management Information System) in Centos 6

NMIS stands for Network Management Information System. It is a Network Management System which performs multiple functions from the OSI Network Management Functional Areas, those being, Performance, Configuration, Fault.Licensed free of charge under the GNU General Public License.

The intellectual property for NMIS was purchased by commercial open source software company Opmantek in early 2011 under a stated commitment to keep NMIS free and lead the community to rapidly advance the product. NMISv8 was released by Opmantek shortly after and remains free and open source.

It started as a SNMP polling and statistics viewer front-end to Tobi Oetiker’s RRDTool. RRDTool replaces MRTG but doesn’t include a front end and backend to handle SNMP polling and display resulting web pages etc. The original NMIS evolved quite rapidly to meet demands of production environments. The backend, polling engine, uses SNMP to collect interface and health statistics for Cisco Routers, certain Cisco Catalyst Switches and Generic SNMP devices every 5 minutes.

The backend stores the statistics in RRD’s (Round Robin Databases) and ensures that devices are up, issues alerts, etc. The front end accesses the information stored in the RRD’s and displays statistics the resulting graphs, reports, etc.

Both the front and back ends are highly extensible and features are easy to add as the structure is learnt. For example the backend was just collecting interface statistics every poll cycle, it was easy to add collection of health (cpu, memory, buffer, etc) and response time, availability.

We now need to get a copy of RRDtool, by Tobi Oetiker. The NMIS development team recommend that you download the latest stable RRDtool and compile it, instead of using whatever version of RRDtool may come with your distribution. The latest version of RRD is available at http://oss.oetiker.ch/rrdtool/pub/?M=D.

Unpack the RRDtool tarball. NMIS8 has been testing using v1.4.7 and for this example. To build and install a “GNU” make based system, you run ./configure, then make, then make install, for RRDTool for NMIS we need a configure option setup.

The unpacking of the tarball in the previous step created a directory called nmis8.4.8g, which can be installed manually or semi-automatically.

Automatic Installation:

The easiest method for installing NMIS 8.4.8g (or upgrading to this version) is to use the semi-automatic installation and upgrade script, install.pl.

Simply run the commands shown below and all the installation procedure will be taken care of on your behalf:

#cd nmis8.4.8g

#./install.pl -h

That’s all there is to it, NMIS should now be installed and working.

If you get an error’s don’t worry, try manual installation

Manual Installation:

If you don’t want to use the install script for any reason then please continue with the remaining instructions in this document to perform a manual installation.

At this point, I like to copy this entire directory to the /usr/local directory tree and make some symlinks, like so.

#mkdir /usr/local/nmis8/

#cp -r nmis8.4.8g/* /usr/local/nmis8/

#rm -rf ~/nmis8.4.8g

#cd /usr/local

#ln -s nmis8 nmis

The nmis directory tree needs to be owned by the user “nmis”, which doesn’t exist yet. Furthermore, the userID under which Apache runs needs to have access to the nmis directory tree. So, we need to add to make these things happen. We are still in the /usr/local directory at this point.

#useradd nmis

#groupadd nmis

this may return “groupadd: group ‘nmis’ already exists” this can safely be ignored but if you want to verify try this.Now we add the Apache userID to the nmis group.

#usermod -G nmis apache

we’ll just copy everything in /usr/local/nmis8/install to /usr/local/nmis8/conf.

#cd /usr/local/nmis/

#\cp -rPv install/* conf/

#cp models-install/* models/

#Perl CPAN Module Installation

Now, let’s get busy with the PERL modules. NMIS, being written in PERL, uses several PERL subroutines, known as “PERL modules”. These are available from the Comprehensive PERL Archive Network, known affectionately as “CPAN”.

Here’s how we get to CPAN.

#perl -MCPAN -e “shell”

Additionally, I like to ensure my CPAN client program, which is what we’re running (“CPAN.pm”), is the latest, up-to-date version. This will take a while and ask for several other “dependency” modules. Just tell it “yes” each time. If you would like to have cpan automatically choose yes use this code.

#cpan> o conf prerequisites_policy follow

#cpan> o conf commit

And run this code to do the update.

#cpan> reload cpan

OK, we’ve got CPAN prepped, locked, and loaded.Now, install all the PERL modules listed in the official NMIS docs, like so.

One of the joys of Unix is granular file permissions, one of the frustrations of Unix is granular file permissions. To assist we have added a handy script in the admin directory /usr/local/nmis8/admin/fixperms.pl which will read the NMIS Configuration and fix the permissions accordingly.

#admin/fixperms.pl

Initial NMIS Test:

You should now be set. As an initial check, I like to go into my /usr/local/nmis/cgi-bin directory and run

#cd /usr/local/nmis8/cgi-bin

#./nmiscgi.pl

If all is working, you should get a bunch of HTML code. If you don’t, it’ll probably be NMISCGI complaining that it cannot find a given PERL module. Review your steps above; you likely missed something. The important thing to do is not to panic.

NMIS Config Test:

Once this is working, you’re ready to head into the /usr/local/nmis8/bin directory and do the “acid” test.

#cd /usr/local/nmis8/bin

#./nmis.pl type=config debug=true

You should get what looks like a long checklist with “OK” at the end of every check. If you do this, then NMIS itself is configured correctly. The output will look something like this:

NMIS Web Server Setup:

Now, we need to set up the Web server so that folks can actually *get to* NMIS and look at the data.That means generating an Apache config file pointing to the NMIS directory tree. NMIS itself is smart enough to be able to generate this for us. Thanks, NMIS team!

Now, fire up your favourite Web browser and surf to your server. The URL will be “http://www.sathish.com/cgi-nmis8/nmiscgi.pl&#8221;. Of course, if you have no DNS or hosts lookup for this box yet, just replace “www.sathish.com” with your new NMIS server’s IP address.

You should get the NMIS Dashboard. If you don’t, then check to make sure you included the “/cgi-nmis8/nmiscgi.pl” in the URL. Yep, I’ve made that mistake too many times to count. It’s easy to forget, so make sure you include it.

Congratulations! It works, and you’re almost done. We’re in the home stretch.

NMIS Crontab Configuration:

We ensured crontab was installed above, now we’ll make sure it’s running:

#chkconfig crond on

#/etc/init.d/crond start

Now we have to tell NMIS to run the data collection every so often. For that, we use a cron job. Edit root’s crontab (“crontab -e” at the root shell), like so. Remember to change the first line, the “MAILTO” line, to contain your actual email address.

NMIS8 has been shipped with two nodes configured for collection, to prove it is all working, one is a pingonly node which is ping of the localhost, and the other is localhost using SNMP.

Because you have already installed NET-SNMP earlier, you just need to backup that config and move in the NMIS sample one, you should modify this accordingly to secure the SNMP read access according to your organisations security policy.