<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> <TITLE>NMIS - Installation</TITLE> <META HTTP-EQUIV="Content-Language" CONTENT="en-us"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252"> <STYLE TYPE="text/css"> TD { font-size : small; border-width : 1px; border-style : solid; border-color : #aaaaaa; font-family : Arial; } TABLE { color : Black; background : White; border-width : 1px; border-style : solid; border-color : #aaaaaa; width : 100%; font-family : Arial; } P { font-family : Arial; } BODY { font-style : normal; font-variant : normal; font-size : small; color : white; background-color : #190032; text-decoration : none; font-family : Arial; } A:active { color : red; background-color : White; text-decoration : none } A:link { color : blue; background-color : White; text-decoration : underline } A:visited { color : blue; background-color : White; text-decoration : underline } A:hover { color : red; background-color : White; text-decoration : underline } .heading { font-style : normal; font-weight : bold; font-size : x-large; font-family : "Arial Rounded MT Bold"; background-color : #190032; color : White; } #rrdtool { position : absolute; left : 210px; top : 150px; } </STYLE> </HEAD> <BODY> <div class="heading">NMIS - Installation</div> <table> <tr> <td width="33%">Last updated 21 June 2001</td> <td width="33%"> <p align="center"><a href="http://www.sins.com.au/nmis/nmis-install.html">Online Version</a></p> </td> <td width="33%"> <p align="center"><a href="http://www.sins.com.au/nmis/">NMIS Home Page</a></p> </td> </tr> <tr> <td width="100%" colspan="3"><p align="left"><b><a name="Installation">Installation</a></b></p> <p>The packages listed in the <a href="index.html#Required Packages">required packages</a> first following the instructions for each of these packages, some of these packages will have there own dependencies. </p> <p>After the required packages are installed you will need to unpack (if you already haven't) the NMIS distribution. The base directory <BASE> is up to you a Solaris way is to use /opt/<PROGRAM> like /opt/nmis. I use /data/nmis myself. The file system which has the database is going to need a lot of space. You can have the program and library files stored in one file system or directory and the data files stored in another directory. </p> <p>File locations are controlled with the config.dat file, this is the link for the program files to read your configuration you can modify the source to have a different config file but all other directories and control files are stored in this files the default is /data/nmis/files/config.dat</p> <p><b>Extract the distribution from the compressed tar file</b></p> <p>Uncompress the distribution</p> <pre>gunzip <nmis distribution gz file></pre> <p>Pick a base directory for the NMIS distribution like /data or /opt and untar the files</p> <pre>tar xvf <nmis distribution tar file></pre> <p><b>Directory Structure</b></p> <p>The basic directory structure is:</p> <div align="left"><table border="1" width="100%"> <tr> <td><b>Directory</b></td> <td><b>Required Size</b></td> <td><b>Type</b></td> <td><b>Description</b></td> </tr> <tr> <td><BASE>/bin</td> <td>small</td> <td>Program</td> <td>directory for all program files - these will change with later releases</td> </tr> <tr> <td><BASE>/cgi-bin</td> <td>small</td> <td>Program</td> <td>directory for CGI program files - these will change with later releases</td> </tr> <tr> <td><BASE>/conf</td> <td>small</td> <td>Program</td> <td>configuration files and some data files - these won't change</td> </tr> <tr> <td><BASE>/lib</td> <td>small</td> <td>Proram</td> <td>library files - these will change</td> </tr> <tr> <td><BASE>/mibs</td> <td>small</td> <td>Program</td> <td>mib files used by the program - these may or may not change</td> </tr> <tr> <td><BASE>/htdocs</td> <td>medium</td> <td>Data</td> <td>files which are generated for the web pages</td> </tr> <tr> <td><BASE>/var</td> <td>medium</td> <td>Data</td> <td>system files - generated</td> </tr> <tr> <td><BASE>/database</td> <td>LARGE</td> <td>Data</td> <td>database files are stored here - generated</td> </tr> <tr> <td><BASE>/logs</td> <td>medium</td> <td>Data</td> <td>log files</td> </tr> </table> </div><p>At the moment you should make all directories listed in this file, might automate this later on. Might be a good idea to decide on a location for the data files and keep it separate from the program files as you are likely to upgrade to new program versions.</p> <p><b>Create nmis users and groups</b></p> <p>Not a bad idea to have someone own nmis from the unix permissions point of view, I create a NMIS user and group and put my own userid the HTTPD user and whoever else in the group of nmis and then administration becomes a little easier. I have already set the distribution to be owned by userid 4200 and groupid 4200.</p> <p>For Solaris:</p> <pre>groupadd -g 4200 nmis useradd -u 4200 -g nmis -c "NMIS User" nmis </pre> <p><b>Setting the location of Perl in the scripts</b></p> <p>So that NMIS runs properly you will need to edit all the perl scripts and change the top line which tells the script which shell to use currently this line would read:</p> <pre>#!/usr/local/bin/perl</pre> <p>This should work for 99% of people as this is the usuall location of Perl. If your executable lives somewhere else then you would need to change this ie:</p> <pre>#!/usr/bin/perl5</pre> <p>This should be done in nmis.pl, nmiscgi.pl, reports.pl, logs.pl and admin.pl.</p> <p><b>Setting the location of library files in the scripts</b></p> <p>If you have used the standard directories nmis should find all its own config files, about the only thing to do is to make sure NMIS can find rrdtool. </p> <p>NMIS uses this for the rrdtool libraries:</p> <pre>use lib "/usr/local/rrdtool/lib/perl";</pre> <p>You might have installed rrdtool to the following directory like /usr/local/rrdtool/rrdtool-1.0.33. The easiest thing to do is create a symbolic link like this:</p> <pre>ln -s /usr/local/rrdtool-1.0.33 /usr/local/rrdtool</pre> <p>If you do this, as you upgrade rrdtool you can easily change the symbolic link without having to edit all the NMIS scripts.</p> <p><b>Setting up Ping</b></p> <p>Ping is now Perl Net::Ping it requires NMIS to run as root to use the Net::Ping module. You could also try setting the sticky bit to allow nmis to run with root privilages.</p> <p><b>Adding devices to the device list</b></p> <p>The nodes.dat file lists all the devices you want to manage, this is a CSV file where each line defines node,community,net,type,role,group,collect.</p> <p>Where: <ul> <li>node = The Node</li> <li>community = SNMP Community String</li> <li>net = Network Type lan or wan</li> <li>node type = switch or router</li> <li>role = core, distribution or access</li> <li>group = Nominal Location Group or the like</li> <li>collect = true,false do or don't do stats collection</li> </ul> <p><b>Populating the Locations and Contacts Tables</b></p> <p>In the directory <nmis base dir>/conf/ copy the locations-sample.csv and contacts-sample.csv to locations.csv and contacts.csv respectively. The edit these files and create entries for each Contact and Location in your network, the files are TAB delimited so you can use comma's in the data fields. This will be linked to the device SNMP sysLocation and sysContact, so NMIS will allow you to lookup this information dynamically.</p> <p>Change the default location and contact parameters especially the default contact emails address to whatever you want the notifications to go.</p> <p><b>Configuring NMIS with the nmis.conf file.</b></p> <p>If you are opting for a default install directories then you shouldn't have to change much. The default directory is /usr/local/nmis and the only thing you might choose to do is to put the database files somewhere else ie /bigfilesystem/nmis/database for example.</p> <p>Some entries you will have to change are :</p> <ul> <li>domain=sins.com.au.</li> <li>nmis_host=www.sins.com.au</li> </ul> <p>Some entries you might like to change are :</p> <ul> <li>dash_title=NMIS Dashboard</li> <li>show_non_collected_interfaces=true</li> <li>show_large_menu=true</li> </ul> <p><b>Adding links to the links list</b></p> <p>More on this later, working on generating a list of Point to Point Links automatically. This is REAL close now.</p> <p><b>Running NMIS</b></p> <p>You can turn on debugging with debug=<true|false|0-9> for more information while running NMIS.</p> <p>When run without debug, NMIS is silent, it will only report BAD things and log non fatals to the NMIS log -> nmis.log in the logs directory is the default.<br> <br> <b>First check that the config is all right!<br> </b> <nmis base dir>/bin/nmis.pl type=config <br> <br> <b>Then run an update!<br> </b> <nmis base dir>/bin/nmis.pl type=update<br> <b><br> Then run collect! </b> Minimum! Runs collection for all nodes in the node list.<br> <nmis base dir>/bin/nmis.pl type=collect <br> <br> Will run NMIS for router only doing a health collection and a interface collection with debuging on. Very handy for figuring out problems.<br> <nmis base dir>/bin/nmis.pl type=collect node=router debug=true <br> <br> You can look at error messages in the file <nmis base dir>/log/nmis.log</p> <p><b>Setting up web access</b></p> <p>To have NMIS produce a sample Apache config run:<br> <nmis base dir>/bin/nmis.pl type=apache<br> <br> Apache should already be working, easiest thing to do is add aliases for the relevant directories ie:</p> <pre>Alias /nmis/ "<BASE>/web/" ScriptAlias /cgi-nmis/ "<BASE>/cgi-bin/"</pre> <p>Add these entries to the apache configuration generally /usr/local/apache/conf/httpd.conf and restart apache either with the command or a kill -HUP on the daemon PID. Keep in mind file permissions for the HTTPD daemon and NMIS, I usually create a group called nmis and put myself and the HTTPD user into it.</p> <p>Now all the CGI scripts and base docs and style sheets will be linked in. You should be able to see something at <a href="http://%3cHOST%3e/">http://<HOST>/cgi-nmis/nmiscgi.pl</a> and wallah you should have something there.</p> <p><b>Event Management and SNMP Tools</b></p> <p>The NET-SNMP nee UCD-SNMP has a bunch of great SNMP tools, obtaining and setting up this package compliments NMIS quite well. Some work is being done to investigate the use of the NET-SNMP Perl SNMP module in place of the current SNMP API. <a href="net-snmp.html">More info on NET-SNMP and setting it up is here.</a></p> <p><b>NET-SNMP IS NOT REQUIRED TO RUN NMIS</b></p> <p><b>Setting up SYSLOG for Cisco SYSLOG </b></p> <p>Add the following entry to syslog</p> <pre>local7.debug /var/log/cisco.log </pre> <p>If the log matches the one in logs.pl you will be able to browse the cisco syslog messages and see what is happening.</p> <p><b>Setting up LOG</b></p> <p>Log is a tool which allows viewing of the logs which NMIS and syslog generate. It color codes and allows searching, filtering of the log files.</p> <p>The config file is /data/files/logs.dat, A sample is included in the NMIS distribution. </p> <p><b>Automate the whole lot with CRON</b></p> <p>Add the following entries to run NMIS bits and pieces.</p> <pre>###################################################### # Run the Reports Weekly Monthly Daily ###################################################### 54 23 * * * /data/nmis/bin/run-reports.sh day health 55 23 * * 0 /data/nmis/bin/run-reports.sh week health 5 0 1 * * /data/nmis/bin/run-reports.sh month health 0 18 * * * /data/nmis/bin/run-reports.sh day response 57 23 * * 0 /data/nmis/bin/run-reports.sh week outage ###################################################### # Run Statistics Collection 5,10,15,20,25,30,35,40,45,50,55 * * * * /data/nmis/bin/nmis.pl type=collect ###################################################### # Run the update twice a day 30 7,20 * * * /data/nmis/bin/nmis.pl type=update # Run the interfaces once and hour with Thresholding on!!! 0,15,30,45 * * * * /data/nmis/bin/nmis.pl type=threshold</pre> <p> </td> </tr> </table> </BODY> </HTML>