Installing And Configuring MNTOS
Server - Nagios

 

MNTOS Installation

Nagios provides an install script that will help get started. Move to the /tmp directory as root and download the script with:

wget http://assets.nagios.com/downloads/nagiosxi/scripts/NagiosXI-MNTOS-install.sh

 

Make the script executable with:

chmod +x NagiosXI-MNTOS-install.sh

 

Before you execute the script you will need to modify the script to fix a problem with permissions. Line 43 has a reference to setting permissions for www-httpd which is the apache2 user on an Ubuntu system. If you are installing on a CentOS/RHEL system change that line to the following(note do not remove the “.” following apache):

chown -R nagios:apache .

 

Once that is save then execute the script for the basic install which it will place in the /opt directory.

./NagiosXI-Nagvis.sh

 

This will install most prerequisites and download and set up MNTOS. However, you will need to install one additional package:

yum install -y php-xsl

 

or if you are using php53

yum install -y php53-xml

 

One additional error that was problematic was in the /opt/mntos-1.0 you will need to modify the script that sets up your configuration in NagiosXI-MNTOS-configure.py. The error is on line 78 and by commenting it out the script will work.

/* next;

*/

 

That script is important because it is used to build out your configuration.

 

MNTOS Configuration

The configuration of MNTOS consists of modifying several important files in the /opt/mntos-1.0 directory. The fist file that need to be edited is the contact.ini. This file will list the contacts for each of the distributed examples of Nagios. Configuration is straightforward, the only thing to note is the id number must be incremented and noted as the id number is how you will tie the admin user to the host in the network.ini.

 

contact.ini


[Mike]

id=1

name="Mike"

address="407 Oak Street"

zipcode="59604"

city="Helena"

country="US"

email="admin@localhost.localdomain"

workphone="406-442-2324"

privatephone="406-442-2345"

profession="Senior Nagios Admin"


[Tom]

id=2

name="Tom Smith"

address="14 N. Placer Ave."

zipcode="59802"

city="Missoula"

country="US"

email="tom@localhost.localdomain"

workphone="406-234-9978"

privatephone=""

profession="Nagios Admin"

 

[Sue]

id=3

name="Sue Jones"

address="53 E. Juniper"

zipcode="59701"

city="Butte"

country="US"

email="sue@localhost.localdomain"

workphone="406-494-3445"

privatephone="406-494-3498"

profession="Nagios Admin"

 

 

 

 

 

 

 

 

 

 

 

 

 

The network.ini is how you will list the Nagios servers that will appear on the web interface. Each host has a name inside “[ ]” with a description in the location line. In the example, each host represents a Naigos server in a specific town in Montana on the “Montana” network. Note the “nagios” line includes the user and password to gain access to the actual Nagios server. You could use a read only user for this purpose. If you use a real admin you can click the link and gain access to the remote Nagios server. Of course, there is the issue of security with your Nagios admin password sitting in plain text.

 

The contacts line allows you to link the number of the contact created in the contacts.ini file. Also note, the image icon is broken by default so you will need to edit this line as is illustrated. Each location must have an incremented id number.

network.ini


[Helena]

id=1

location="Nagios: Montana"

network="Montana"

nagios="http://nagiosadmin: This e-mail address is being protected from spambots. You need JavaScript enabled to view it /nagios/cgi-bin/tac.cgi"

public="http://192.168.5.163/nagios/"

contacts=1,2

icon="img/globe.png"


[Missoula]

id=2

location="Nagios: Missoula"

network="Montana"

nagios="http://nagiosadmin: This e-mail address is being protected from spambots. You need JavaScript enabled to view it /nagios/cgi-bin/tac.cgi"

public="http://192.168.5.164/nagios/"

contacts=2

icon="img/globe.png"

 

[Butte]

id=3

location="Nagios: Butte"

network="Montana"

nagios="http://nagiosadmin: This e-mail address is being protected from spambots. You need JavaScript enabled to view it /nagios/cgi-bin/tac.cgi"

public="http://192.168.5.165/nagios/"

contacts=1,2

icon="img/globe.png"

 

[Kalispel]

id=4

location="Nagios(VShell): Kalispel"

network="Montana"

nagios="http://nagiosadmin: This e-mail address is being protected from spambots. You need JavaScript enabled to view it /nagios/cgi-bin/tac.cgi"

public="http://192.168.5.170/nagios/"

contacts=3

icon="img/globe.png"

 

[Libby]

id=5

location="Nagios: Libby"

network="Montana"

nagios="http://nagiosadmin: This e-mail address is being protected from spambots. You need JavaScript enabled to view it /nagios/cgi-bin/tac.cgi"

public="http://192.168.5.157/nagios/"

contacts=1,2

icon="img/globe.png"

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Updating the Configuration

Each time you make changes to the configuration files you will need to update. This can be done manually by running this command:

/usr/bin/php /opt/mntos-1.0/mntos.php

 

This will update the interface and all of the current checks on those servers. At this point if everything is looking OK you will want to create a cron job to maintain the configuration.

crontab -e

 

* * * * * /usr/bin/php /var/www/mntos/mntos.php /dev/null 2>&1

 

Now edit index file at line 114 to change the time refresh:

 

 

vi /opt/mntos-1.0/www/index.php

 

 

 

$refreshfreq = 120;

 

 

Save and it should all be working correctly.