Installing Ubuntu 10.04 LTS
The first step in this process I'm going to leave mostly to the reader and other HOWTOs as it in itself can be an entire post. Installing Ubuntu 10.04 LTS server requires going to Ubuntu's website to download an ISO copy of the installer for either i386 (32-bit) or x64(64-bit). Once downloaded burn the ISO to a CD or mount it to your VM and boot to CD. Take the defaults and don't install any of the server roles, except OpenSSH Server, at the end of the install to get a bare bones server system.
Installing the Prerequisite Ubuntu Packages for NMIS
Once you have a working system, login to the server either locally or via SSH. The first set of applications will be used later to compile other prerequisites.
sudo apt-get updateThe next group of packages are required to compile RRDTools which will be done later in the process.
sudo apt-get install autoconf automake gcc
sudo apt-get install libcairo2 libcairo2-dev \Packages for SNMP (Simple Network Management Protocol) are the next to be installed.
libglib2.0-dev libpango1.0-dev libxml2 libxml2-dev
sudo apt-get install snmp net-snmp-lib net-snmp-utils net-snmp-perlFinally we need to install the packages for the Apache webserver.
sudo apt-get install apache2
Installing RRDTool From Source for NMIS
The developers of NMIS recommend that you use RRDTool compiled from source instead of the Ubuntu maintained packages. This is a relatively straightforward process.
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz
tar xzvf rrdtool.tar.gz
cd rrdtool-1.4.5/
./configure --enable-shared --prefix=/usr/local/rrdtool
make
sudo make install
Installing Perl Packages from CPAN
NMIS uses several Perl packages that are maintained in the Comprehensive Perl Archive Network (CPAN). These packages can be installed using the CPAN module of Perl. In my instructions I include upgrading the CPAN module first because it sometimes helps to have the newest version. When you first open CPAN you can accept the defaults unless you need to setup an HTTP proxy
sudo perl -MCPAN -e "shell"Install NMIS
o conf prerequisites_policy follow
o conf commit
install CPAN::Bundle YAML
reload CPAN
install JSON
install Proc::ProcessTable
install Image::Resize
install Crypt::DES
install Crypt::Rijndael
install Digest::HMAC
install Digest::SHA1
install Socket6
install Net::SNMP
install Time::HiRes
install Time::ParseDate
install Statistics::Lite
install Net::SNPP
install Net::SMTP
install Net::DNS
install IPC::Shareable
install BSD::Resource
install GD::Graph
install Net::EasyTCP
install Data::Dumper
install Cache::Mmap
install Proc::Queue
install Date::Parse
install Date::Calc
install Math::Round
install DBI
Now that we have the prerequisites out of the way it's time to install the NMIS application itself. You will have to go to Opmantek's website to download NMIS. While it is free, they do currently require you to register to get a link to download the newest version of NMIS. Once you have the link download the nmis-8.1.1.tar.gz file to your Ubuntu server and proceed as follows. The first step is to decompress the archive and copy the files into /usr/local.
tar xzvf nmis-8.1.1.tar.gzOnce the files are copied you will need to setup the nmis user and nmis group as well as add the www-data user to the nmis group. We also need to give proper permissions to the NMIS files.
sudo cp -Rpv nmis8/ /usr/local/
sudo cp -Rpv /usr/local/nmis8/install/* /usr/local/nmis8/conf/
sudo useradd nmis
sudo usermod -G nmis www-data
sudo chown -Rv nmis:nmis /usr/local/nmis8
sudo chmod -Rv g+w /usr/local/nmis8
Verifying NMIS is Installed
Once everything above is done, it is a good time to verify that the basic install process is done. You can do this by doing
sudo /usr/local/nmis8/cgi-bin/nmiscgi.plAs long as you get HTML output, all of the Perl prerequisites have been installed. If you get errors about missing modules, verify that they are installed via CPAN. The next verification is to run a check on the basic configuration.
sudo /usr/local/nmis8/bin/nmis.pl type=config debug=trueThis should result in something similar to the below output:
Next we will check to make sure that the NMIS update and collection scripts work by running them against the NMIS server.
NMIS Copyright (C) 1999-2011 Opmantek Limited (www.opmantek.com)
This program comes with ABSOLUTELY NO WARRANTY;
This is free software licensed under GNU GPL, and you are welcome to
redistribute it under certain conditions; see www.opmantek.com or email
contact@opmantek.com
NMIS version 8.1.1
Root directory of NMIS is /usr/local/nmis8
14:07:35 checkConfig, Config Checking - Checking database directories
Continue with bin/nmis.pl type=apache for configuration rules of the Apache web server
sudo /usr/local/nmis8/bin/nmis.pl type=update node=localhost debug=trueConfigure Apache for NMIS
sudo /usr/local/nmis8/bin/nmis.pl type=collect node=localhost \
debug=true
Now that we know that NMIS is ready to answer the call, we need to setup Apache so that we can serve up the Web GUI for NMIS. NMIS provides a script to produce the proper Apache configuration.
cd ~
sudo /usr/local/nmis8/bin/nmis.pl type=apache > 000-nmis
sudo mv /etc/apache2/sites-enabled/000-default \
/etc/apache2/sites-enabled/default
sudo cp 000-nmis /etc/apache2/sites-enabled/000-nmis
sudo htpasswd /usr/local/nmis8/conf/users.dat admin
sudo /etc/init.d/apache2 restart
Verify NMIS Web Interface
Point your web browser (Firefox or IE work best, Chrome UI is buggy unfortunately) to http://yournmishost/cgi-nmis8/nmiscgi.pl and you should see something like this:
Thank you for posting such a useful, impressive and a wicked article./Wow.. looking good!
ReplyDeleteSoftware Testing Tutorial
Hi i have a problem with those line, please advice. im a beginner with linux :
ReplyDeletecommand
--------
root@nmis:~# sudo mv /etc/apache2/sites-enabled/000-default \
/etc/apache2/sites-enabled/default
error message
--------------
mv: cannot stat `/etc/apache2/sites-enabled/000-default': No such file or directory
command
---------
root@nmis:~# sudo /etc/init.d/apache restart
Error
------
sudo: /etc/init.d/apache: command not found
Mehdi, It would seem that you haven't installed Apache yet or you are using these instructions on a different flavor of Linux that puts things in a different place. If you're using Ubuntu 10.04 LTS Server, type
ReplyDeletesudo apt-get install apache2
This will install Apache.
Hi Said,
ReplyDeleteFirst, thanks a lot for ur reply and i like to thank you also for this steps. it's really helpful.
For the Apache2 I did that, and it showed that the apache2 is already installed
below is the version that i'm using
--------------------------------
noc@nmis:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.2 LTS
Release: 10.04
Codename: lucid
Thanks again
Ok, looks like I dropped a 2 from the restart command. It has been changed in the article. As for the mv command I am not sure. Can you show me a ls -lh from /etc/apache2/sites-enabled/
ReplyDeleteThanks
Hi,
ReplyDeleteplease see below:
root@nmis:/etc/apache2/sites-enabled# ls
000-nmis default
Looks like you should be good, not sure why the 000-default wasn't in there to start with.
ReplyDeletehi thanks for all,
ReplyDeleteI can acces NMIS now but i have another question :
I don't know why nmis is not polling the metric is 0% reach 0% int avail 0% health 0% resptime 0MS
it's like it' not polling and tried to ping the host, it's pingable.
Please advise
Doh! That's what I get for not running through the instructions a second time after doing the install. I've added the steps for polling above. You have to install the jobs into CRON.
ReplyDeleteHi,
ReplyDeleteGreat Job sir, it's polling right now. :)
Another question, do you have an idea why the nmis goes back to current staus page(home page) automatically. eg, i want to create a node and it doesn't give me the time to do it!! did i missed something??
Thanks again for everything :)
The refresh bug is a known issue. The development team addressed it in the following post.
ReplyDeletehttp://tech.groups.yahoo.com/group/nmis_users/message/8842
Thanks sir, u r the best :)
ReplyDeletesoory i forgot to mention something, during the installation, i got this message when i was installing the snmp :
ReplyDeletesudo apt-get install net-snmp net-snmp-lib net-snmp-utils net-snmp-perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package net-snmp <-------------
I put sudo apt-get install snmp and it worked!
Hi,
ReplyDeleteCan you post an article about how to configure and use NMIS, i.e. how to populate the tables of nodes,contacts, how to configure nmis.conf and what it means all like stuff.I didn't find out documentation abot using&configuring NMIS, only about installink it.
Thanks for this post.
Florin,
ReplyDeleteI have plans to do that, I just haven't gotten around to it yet.