This is my version for installing NMIS on CentOS 5.3
Some of this documentation came from http://www.sins.com.au/nmis
NOTES:
Root User information:
root/password
NMIS User information:
nmis/password
SSH enable
Security Disable (Firewall and SELinux)
- OS Install :
- Default CentOS install
- PERL 5.6.0 or higher – http://www.cpan.org/ports/index.html
- Apache – http://www.apache.org/dist/
- Starting httpd @ startup
- service httpd status (most install it’s stopped)
- chkconfig –level 345 httpd on
- chkconfig –list httpd
- service httpd start
- Default CentOS install
- Required Packages :
- Devel Library
- yum install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel
- PERL Mods (cpan)
- Time::HiRes
- Time::ParseDate
- Statistics::Lite
- Net::SNPP
- Net::SMTP
- Net::DNS
- Tie::RegexpHash;
- Cache::Mmap
- Proc::Queue
- RRDtool 1.0.33 or higher – http://oss.oetiker.ch/rrdtool/
- SNMP Session – http://www.switch.ch/misc/leinen/snmp/perl/dist/
- Devel Library
- Software Installation
- RRDtool – I recommend that you install rrdtool from source, even if it is available as an optional binary package for operating system distribution. This is because NMIS expects that you’ve built and installed RRDTOOL something like this, and NMIS expects to find the rrdtool libraries under /usr/local/rrdtool/. This also installs RRDs, the shared-library perl module supplied with rrdtool.
- wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.0.x/rrdtool-1.0.45.tar.gz
- $ gzip -dc rrdtool-1.0.45 | tar -xof –
- $ cd rrdtool-1.0.45
- $ ./configure –enable-shared –prefix=/usr/local/rrdtool
- $ make install site-perl-install
- The ‘site-perl-install’ tag is not so important for NMIS, but I use as it makes the rrdtool perl modules available to all perl scripts. (See above.)
- SNMP Session – This package contains Perl 5 modules SNMP_Session.pm, BER.pm and SNMP_util.pm, which, when used together, provide access to remote SNMP (v1/v2) agents. SNMP Session can be downloaded from the FTP directory ftp://ftp.switch.ch/software/sources/network/snmp/perl/.
- gzip -dc SNMP_Session-0.95 | tar -xof –
- cd SNMP_Session-0.95
- perl Makefile.PL
- make
- make test
- make install
- PERL modules – These are all installed the same way. I prefer the CPAN build process, as then any dependencies are picked up and installed for you.
- You can install them using the CPAN shell like this:
- LANG=en_US
- export LANG
- perl -MCPAN -e “shell”
- At the $cpan> enter in the following commands
- install Time::HiRes
- install Time::ParseDate
- install Statistics::Lite
- install Net::SNPP
- install Net::SMTP
- install Net::DNS
- install GD::Graph
- You can install them using the CPAN shell like this:
- RRDtool – I recommend that you install rrdtool from source, even if it is available as an optional binary package for operating system distribution. This is because NMIS expects that you’ve built and installed RRDTOOL something like this, and NMIS expects to find the rrdtool libraries under /usr/local/rrdtool/. This also installs RRDs, the shared-library perl module supplied with rrdtool.
- NMIS Install
- Create nmis users and groups
- groupadd nmis
- useradd -g nmis -p ‘password’ nmis
- usermod -G nmis apache # add apache user to group nmis, so the web interface can read/write conf files
- Create folder and set permissions
- mkdir /usr/local/nmis
- chown nmis:nmis /usr/local/nmis
- chmod g+ws /usr/local/nmis
- Uncompress and unpack the distribution
- gzip -dc nmis-3-2-0.tar.gz | tar -xof –
- Copy the files to the directory base
- cp -R nmis-3-2-0/* /usr/local/nmis/
- Change all file ownership and permissions to nmis
- chown -R nmis:nmis /usr/local/nmis/
- chmod -R 0775 /usr/local/nmis/
- Change nmis.pl to the version of RRDtool you have install (for my example I’m using 1.0.45)
- vi +51 /usr/local/nmis/bin/nmis.pl
- use RRDs 1.000.450;
- Setting up web access – Apache should already be working, easiest thing to do is add aliases for the relevant directories, as should have produced by the above command, ie:
- Alias /nmis/ “<BASE>/htdocs/”
- ScriptAlias /cgi-nmis/ “<BASE>/cgi-bin/”
- vi /etc/httpd/conf/httpd.conf
- service httpd restart
- Automate the whole lot with CRON
- crontab -e (as root)
- Paste the following into the vi window:
# mail any errors to root
MAILTO=root@mydomain.com
######################################################
# Run the Reports Weekly Monthly Daily
######################################################
54 23 * * * /usr/local/nmis/bin/run-reports.sh day health
55 23 * * 0 /usr/local/nmis/bin/run-reports.sh week health
5 0 1 * * /usr/local/nmis/bin/run-reports.sh month health
5 0 1 * * /usr/local/nmis/bin/run-reports.sh month avail
0 18 * * * /usr/local/nmis/bin/run-reports.sh day response
57 23 * * 0 /usr/local/nmis/bin/run-reports.sh week outage
######################################################
# Run Statistics Collection
*/5 * * * * /usr/local/nmis/bin/nmis.pl type=collect
######################################################
# Run the update once a day and then update the links file
30 20 * * * /usr/local/nmis/bin/nmis.pl type=update
30 21 * * * /usr/local/nmis/bin/nmis.pl type=links
#####################################################
# Run the interfaces 4 times an hour with Thresholding on!!!
*/15 * * * * /usr/local/nmis/bin/nmis.pl type=threshold
######################################################
# Check to rotate the logs 7am every day
0 7 * * * /usr/sbin/logrotate /usr/local/nmis/conf/logrotate.conf
##################################################
# save some stuff for backup every day
0 8 * * * crontab -l > /usr/local/nmis/conf/crontab.root
0 8 * * * diff /etc/httpd/httpd.conf /etc/httpd/httpd.conf.default > /usr/local/nmis/conf/httpd.conf.backup
0 8 * * * cat /etc/syslog.conf > /usr/local/nmis/conf/syslog.conf.backup




