OPMANTEK_Symbol_OnlyOpMen-Small

 

 

 

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.

 

 

 

Features:

 

  • Performance Management
  • Faults and Events
  • Real-time monitoring
  • Operational Tools
  • Management Reporting
  • Extensive list of supported devices
  • Business Rules Engine
  • Notification and Escalation
  • Distributed Monitoring
  • Notification
  • Scalability

 

 

 

 

Installation:

 

As a root user install following packages in your machine.

 

#su – root

#yum install autoconf automake gcc cvs

#yum install cairo cairo-devel pango pango-devel glib glib-devel libxml2 libxml2-devel gd gd-devel libXpm-devel libXpm openssl openssl-devel net-snmp net-snmp-libs net-snmp-utils net-snmp-perl perl-Net-SSLeay httpd make groff cpan crontabs dejavu*

 

Screenshot from 2014-03-15 18:56:30

 

RRDTool Installation:

 

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.

 

 

#wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.2.tar.gz

#tar -xvf rrdtool-1.4.8.tar.gz

#cd rrdtool-1.4.8

#./configure –enable-shared –prefix=/usr/local/rrdtool

#make && make install

 

Screenshot from 2014-03-15 19:01:52

 

After successfull installation, it will show like below.

 

Screenshot from 2014-03-15 19:02:41

 

 

Now, rrdtool should be installed the way NMIS likes it.

In order to make RRD run faster it really helps to update the font cache

#fc-cache -f -v

 

Screenshot from 2014-03-15 19:03:44

 

Screenshot from 2014-03-15 19:03:56

 

 

NMIS8 Installation:

 

And speaking of NMIS, if you haven’t already downloaded it, the latest version (v8.4.8G at time of this writing) is available at http://opmantek.com

 

#cd ~

#wget http://dl-nmis.opmantek.com/nmis8.4.8g.tar.gz

#tar -xvzf nmis8.4.8g.tar.gz

 

 

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

 

Screenshot from 2014-03-15 19:05:27

 

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.

 

Screenshot from 2014-03-15 19:58:05

 

#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

 

Screenshot from 2014-03-15 19:58:26

 

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.

 

#cpan> install JSON JSON::XS Proc::ProcessTable Image::Resize Net::SNMP Time::HiRes Time::ParseDate Statistics::Lite Net::Syslog Net::SNPP Net::LDAP Net::SMTP Net::SMTP::SSL Net::DNS IPC::Shareable BSD::Resource GD::Graph Net::EasyTCP Data::Dumper Cache::Mmap Proc::Queue Date::Parse Date::Calc Math::Round DBI CGI::Pretty Crypt::DES

 

Screenshot from 2014-03-15 20:07:00

 

Now, you’re ready to exit CPAN.

 

#cpan> exit

 

 

 

File Permissions:

 

Make nmis user and group own all the files.

 

#chown -Rv nmis:nmis /usr/local/nmis8

#chmod -Rv g+w /usr/local/nmis8

 

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

 

Screenshot from 2014-03-15 20:47:18

 

 

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

 

Screenshot from 2014-03-15 20:48:06

 

 

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:

 

Screenshot from 2014-03-15 20:49:56

 

 

 

 

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!

 

All you have to do is this.

 

#./nmis.pl type=apache > 00nmis.conf

 

Screenshot from 2014-03-15 20:54:18

 

Copy 00nmis.conf to /etc/httpd/conf.d/

#cp ./00nmis.conf /etc/httpd/conf.d/

 

Screenshot from 2014-03-15 20:55:54

 

Auto Start HTTPD Server. Ensure that you tell Linux to start HTTPD automatically

 

#/sbin/chkconfig httpd on

 

You will need to start or restart Apache after configuration.

#/etc/init.d/httpd start

 

 

Quick Testing:

Now, fire up your favourite Web browser  and surf to your server. The URL will be “http://www.sathish.com/cgi-nmis8/nmiscgi.pl”. 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.

 

Screenshot from 2014-03-17 09:24:26

 

Screenshot from 2014-03-17 09:24:44

 

Screenshot from 2014-03-17 09:25:35

 

 

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.

 

MAILTO=sathish@sathish.com

######################################################

# NMIS8 Cronfig

######################################################

# Run Statistics Collection

*/5 * * * * /usr/local/nmis8/bin/nmis.pl type=collect mthread=true maxthreads=10

######################################################

# Run Summary Update more frequently

*/3 * * * * /usr/local/nmis8/bin/nmis.pl type=summary

#####################################################

# Run the interfaces 4 times an hour with Thresholding on!!!

*/15 * * * * nice /usr/local/nmis8/bin/nmis.pl type=threshold

######################################################

# Run the update once a day

30 20 * * * nice /usr/local/nmis8/bin/nmis.pl type=update mthread=true maxthreads=10

######################################################

# Check to rotate the logs 4am every day UTC

5 20 * * * /usr/sbin/logrotate /usr/local/nmis8/conf/logrotate.conf

##################################################

# save this crontab every day

0 8 * * * crontab -l > /usr/local/nmis8/conf/crontab.root

#0 8 * * * cp /etc/httpd/conf/httpd.conf /usr/local/nmis8/conf/httpd.conf.backup

#0 8 * * * cp /etc/httpd/conf.d/00nmis.conf /usr/local/nmis8/conf/00nmis.conf.backup

#0 8 * * * cat /etc/syslog.conf > /usr/local/nmis8/conf/syslog.conf.backup

 

Screenshot from 2014-03-15 21:11:55

 

After you’re done, issuing a crontab -l is a good idea to make sure it’s all there. Note that crontab -e on most GNU/Linux distros uses the traditional “vi” editor.

 

#touch  /usr/local/nmis8/logs/ciscopix.log

 

And now, go ahead and add your hosts to NMIS. There’s a nice GUI for doing that which is pretty easy to use.

 

Time to celebrate! You’re done! Enjoy your shiny new NMIS installation, and be sure to thank the teams that brought it to you.

 

 

 

Installing FPING:

 

Download fping from fping.org

#curl http://fping.org/dist/fping-3.X.tar.gz -o fping-3.X.tar.gz

#tar -zxvf fping-3.X-tar.gz

#cd fping-3.X

#./configure

#make && make install

 

Screenshot from 2014-03-15 21:14:54

 

SNMPD, Net-SNMP and Testing your Configuration:

 

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.

 

#cd /usr/local/nmis8

#mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig

#mv /etc/snmp/snmptrapd.conf /etc/snmp/snmptrapd.conf.orig

#cp install/snmpd.conf /etc/snmp/snmpd.conf

#cp install/snmptrapd.conf /etc/snmp

#cp install/snmptrapd.options /etc/sysconfig/snmptrapd.options

 

Screenshot from 2014-03-15 21:16:31

 

 

Auto Start SNMP Daemons:

 

Ensure that you tell Linux to start SNMPD automatically

 

#/sbin/chkconfig snmpd on

#/sbin/chkconfig snmptrapd on

#/etc/init.d/snmpd start

#/etc/init.d/snmptrapd start

 

 

 

Run a Test Update:

 

With everything else done, you can run a test update

 

#bin/nmis.pl type=update node=localhost debug=true

 

Screenshot from 2014-03-15 21:18:06

 

Screenshot from 2014-03-15 21:18:30

 

#bin/nmis.pl type=collect node=localhost debug=true

Screenshot from 2014-03-15 21:19:33

That’s it , upcoming post i’ill explain how to configure nmis to monitor your network environment….

Advertisements