Installation
The installation is assuming that you are installing on CentOS, have compiled your Nagios install and are using PHP 5.1 or greater. This install will include instructions on how to use apc to cache your status data for faster page loads.
- Code: Select all
cd /tmp
wget http://assets.nagios.com/downloads/exchange/nagiosmobile/nagiosmobile.tar.gz
tar zxvf nagiosmobile.tar.gz
cd /nagiosmobile
./INSTALL.php
If you see errors on the location of files you will need to modify the path in /usr/local/nagiosmobile/include.inc.php.
Install several requirements.
- Code: Select all
yum install php-pear php-devel httpd-devel pcre-devel
Edit /etc/php.ini
- Code: Select all
extension=apc.so
apc.enabled= 1
Install APC
- Code: Select all
pear install pecl/apc
downloading APC-3.1.9.tgz ...
Starting to download APC-3.1.9.tgz (155,540 bytes)
.................................done: 155,540 bytes
54 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20050922
Zend Extension Api No: 220051025
Enable internal debugging in APC [no] :
You will be asked a number of questions, just take the defaults.
Modify /etc/httpd/conf.d/nagiosmobile.conf to either use Nagios Core or Nagios XI, comment out the lines you will not use. The example is set up for Nagios XI.
- Code: Select all
#modify this file to fit your apache configuration
Alias /nagiosmobile "/usr/local/nagiosmobile"
<Directory "/usr/local/nagiosmobile">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Allow from 127.0.0.1
######use the below lines for Nagios XI
AuthName "Nagios Monitor XI"
AuthType Basic
AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
######Use the below lines for a SOURCE install of Nagios Core
# AuthName "Nagios Access"
# AuthType Basic
# AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
Edit /usr/local/nagiosmobile/include.inc.php if the installation of nagiosmobile showed any errors. For example, this system is using a RAM disk so the status.dat location had to be modified.
- Code: Select all
#status_file=/usr/local/nagios/var/status.dat
status_file=/ramdisk/status.dat
Restart your web server.
- Code: Select all
service httpd restart
Usage
NagiosMobile can now be accessed at http://nagios_ip/nagiosmobile.
That should make it easier for those of you using CentOS.
