Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Nagex

Current Version
1.0
Last Release Date
2012-06-06
Compatible With
  • Nagios 2.x
  • Nagios 3.x
License
GPL
Hits
76053
Files:
FileDescription
nagex.tar.gznagex.tar.gz
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Nagex is a Nagios intranet dashboard project driven by event handlers which feeds data to a MySQL database. The PHP script pulls the data for your internal/external company users to view infrastructure status information without giving them access to the CGI interface. This project can be easily integrated inside of your existing intranet using a PHP include or iframe for a custom look and feel since it does not have navigation or links. It utilizes the $HOSTALIAS$ so users do not see internal server names. If you want to display information about every host/service checked by Nagios, simply define the event_handler in your host and service templates instead of individual host and service definitions.
Nagex was my November 2011 project and is a modified version of another project called Nagdash, which was originally developed by John Kenyon. His website is no longer functional and hasn't responded to my emails. Hope he's ok. I found the original project on the Nagios Exchange. Feel free to modify Nagex however you want, or leave a comment below ^_^

GNU General Public License - Version 3, 29 June 2007
http://www.gnu.org


The prerequisites are a Linux box running MySQL, PHP, Nagios and a web server like Apache (LAMP). The only downside to Nagex is the fact that it relies on Nagios host and service state changes before it writes values to the mysql database since it does not pull information directly from the cgi's. In order for data to populate, the event_handler needs to be executed which means hosts/services need to change states into soft or hard.

A quick and easy way is to disconnect the network connection on your nagios box and wait 15 minutes or whatever interval you have your host/service checks configured. If you can't do this because you're working in a production environment, then you can pre-populate the database by manually inserting data into the tables. My event handler shell script will update the data if it already exists instead of inserting new entries. Here is a great MySQL reference site: http://www.pantz.org/software/mysql/mysqlcommands.html


Untar this project

tar -xzvf nagex.tar.gz

Create a web-accessible directory

mkdir /var/www/nagex

Directory placement

Put nagex.php and images folder in /var/www/nagex

Create the database

mysql -u root -ppassword
mysql> create database nagex;
Create the database user

mysql> use mysql;
mysql> grant all privileges on nagex.* to nagex@'localhost' identified by 'secret';
mysql> flush privileges;
mysql> exit

Import the SQL schema dump

mysql -u root -ppassword nagex < nagex_structure.sql

Copy the event handlers

mkdir /usr/local/nagios/libexec/eventhandlers
cp ~/nagex/update-nagex /usr/local/nagios/libexec/eventhandlers/
cp ~/nagex/update-nagex-host /usr/local/nagios/libexec/eventhandlers/

Set permissions

chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
chmod 755 /usr/local/nagios/libexec/eventhandlers/*

Add commands into commands.cfg

define command{
command_name update-nagex
command_line /usr/local/nagios/libexec/eventhandlers/update-nagex $HOSTNAME$ "$HOSTALIAS$" "$SERVICEDISPLAYNAME$" $SERVICESTATE$ "$LONGDATETIME$"
}

# 'update-nagex-host' host update command deinition
define command{
command_name update-nagex-host
command_line /usr/local/nagios/libexec/eventhandlers/update-nagex-host $HOSTNAME$ "$HOSTALIAS$" $HOSTSTATE$ "$LONGDATETIME$"
}

Update service/host definitions with event_handler

define service{
host_name somehost
check_command check_nrpe!CheckServiceState -a service
service_description Some Service
max_check_attempts 4
event_handler update-nagex
}

define host{
use windows-server
host_name EXCH1
alias Exchange Server
address 100.10.111.222
event_handler update-nagex-host
}

Modify nagex.php

Line 18, enter the password you've use to create the mysql user.

$DBpassword = "secret";

Test out the web front end

http://yourhost/nagex/nagex.php

Still doesn't work?

Contact me or leave a comment and I'll do my best to help you

Thanks,
Travis Runyard ^_^
Reviews (1)
byJohnMatrix, June 10, 2012
1 of 1 people found this review helpful
I didn't think this would come out until Nagios Platinum edition :p thnx this worked great on my company intranet.