WARNING: this is not a configure / make / make install distribution! You will need Perl, sysadmin and possibly mySQL skills and to do a bit of work to get myNMS set up and working for you on your system. |
It is not advisable to rely on NFS- or SMB-mounting filesystems from other machines: if one of these is down it can cause the NMS machine to hang awaiting response, and one of the important requirements of an NMS is usually high availability, thus it should not be dependant on other systems. (For this reason our NMS does not run NIS, unlike most other systems on our campus network.)
For the prototype myNMS everything - collection and query scripts, SQL engine, Apache server - runs under one user account. Some sysadmins may prefer to run the SQL engine and web server as separate user IDs.
The myNMS user has all privileges for the myNMS database, and it may help in table maintenance for the user also to have File privilege (for importing and exporting data from the database). The myNMS user is set up to not require a password for access to mySQL since in our case the NMS is running with effectively only one user accessing the machine, and with mySQL set up not to accept connections from other systems. If myNMS is run on a shared machine the DB_utils.pl script should be modified to supply the myNMS user's mySQL username and password when establishing a connection.
(On a typical system it will require root privilege to create a directory in /usr/local: either run the install as root or, more safely, have root create the myNMS directory and chown it to the appropriate user and install as the user.)
The Perl scripts assume that perl is in /usr/bin/perl.
Perl, the base directory and any of the other directories can be located elsewhere, and either symlinked to the defaults assumed above, or myNMS files modified to point to the new locations. Each perl script starts typically:
Changing these path specifiers, and the specifications of the directories (DIR section) in the etc/My_Config.cf file allows myNMS to be run with a different directory structure, provided either that the My_Config .pm (module) and .cf (config) files are in directories something/bin and something/etc, or that they are in the same directory, otherwise My_Config.pm will not find its config file.#!/usr/bin/perl -w .. use lib '/usr/local/myNMS/bin' ; use My_module ;
Running the command:
perl -pi.orig -e's|/usr/bin/perl|/my/path/to/perl|;s|/usr/local/myNMS|/base/dir/of/myNMS|;'on all the perl scripts and the config file would set the location of Perl to /my/path/to/perl and the myNMS base directory to /base/dir/of/myNMS, renaming the original files with the suffix .orig. This could be knocked up into a proper configure or install script. |
Values may refer to values specified earlier, in the form $CONFIG{GROUP}{KEY}
Unix-style comments starting with # are permitted.
In the HOSTS section host names or addresses are specified exactly as they may appear in Apache-type .htacess files.
In the USERS section usernames alone may be specified, in which case passwords are taken from the local Unix passwd map, or username:passwd pairs can be specified.
In either section any group may include another already-defined group using the @OTHERGROUP contriuct.
Make symlinks in other directories to the appropriate one of these group master files, to give the same control over access to other directories/pages unrelated to myNMS. In the index page configuration file (index.cf) make links to the directories/pages for the user groups as appropriate. Example: if you have a directory 'routerconf' of router config files and info which should only be accessible to group 'noc' make a link from inside the 'routerconf' directory to the '.noc' htaccess file, and in index.cf have a line likeln -s /usr/local/myNMS/var/www/.htaccess.noc .htaccess
{noc}<a href="routerconf">Router Configs etc</a>
Run the command:
and check that the htaccess and passwd files are generated and that the access control mechanism works./usr/local/myNMS/bin/DB_maint --mkhtaccess
Run the command:
and check that index pages are created in the configured user-group directories, and that the links work properly./usr/local/myNMS/bin/Query index=1
In the etc directory run make all and check that the above commands get run if the htaccess.cf and/or index.cf files have been changed (or touched).
Run by hand the commands:
The latter two will not do anything until the first has found (from its configured gateway address) any routers and switches./usr/local/myNMS/bin/SNMP_info -v --gateway gateway-IP-address --snmp /usr/local/myNMS/bin/SNMP_info -v --arp /usr/local/myNMS/bin/SNMP_info -v --dot1d
Run by hand the command:
/usr/local/myNMS/bin/MAP_info
When MAP_info has finished running, stop the SNMP_info commands if they are still running and run:
and check that the SNMP_info commands above, and MAP_info, get started up./usr/local/myNMS/bin/KeepAlive
NB The 'create table' command in the restore file will harmlessly report errors as the table already existsmysql NMS < Vendor_MAC.sql
# myNMS KeepAlive: this cron entry keeps alive the script which keeps processes running * * * * * /usr/local/myNMS/bin/KeepAlive # # every 5 minutes: update web index and access control pages 0,5,10,15,20,25,30,35,40,45,50,55 * * * * cd /usr/local/myNMS/etc/; make all # # once an hour at all times 0 * * * * /usr/local/myNMS/bin/Query_Users >> /usr/local/myNMS/log/Query_Users.log 2>&1 0 * * * * /usr/local/myNMS/bin/Query_Hosts >> /usr/local/myNMS/log/Query_Hosts.log 2>&1 # more often during mon-fri, 9am - 6pm 15,30,45 9-18 * * 1-5 /usr/local/myNMS/bin/Query_Users >> /usr/local/myNMS/log/Query_Users.log 2>&1 30 9-18 * * 1-5 /usr/local/myNMS/bin/Query_Hosts >> /usr/local/myNMS/log/Query_Hosts.log 2>&1 # # Get web logs and process: 0 4 * * * /usr/local/myNMS/bin/LOG_info --squid > /usr/local/myNMS/log/LOG_info_squid.log 2>&1 #