mypan-beta README File

The files and their descriptions are as follows:

./graphs:
	displaygraphs.php	php file for displaying individual server graphs
	ntthumbstemplate.htm	template for thumbnail display

./graphtools:
	ntaddrrd.sh		shell script to create the rrd file
	ntcreategraphs.sh	shell script that creates the .gif files (graphs) for each server this is run through crontab
	ntthumbs.sh		shell script that creates a thumbnail page

./libexec:
	mypan-cpu		a script that uses the check_nt nagios plugin to return the cpu utilization and put the data into the rrd file plus put it in a MySQL table.  ( WAY overkill I know but we need it )  Just rem out the sql parts if you don't want to use them.
	mypan-mem		same as mypan-cpu but with memory utilization


This is a first attempt at putting this all together so bear with me it's worth it!

Move the graphs folder under your htdocs directory. (i.e. /usr/local/apache)
Move the graphtools folder under your nagios folder (i.e. /usr/local/nagios)
Copy the mypan scripts to your libexec folder for nagios (i.e. /usr/local/nagios/libexec)
Make sure you are the NAGIOS user, if not su to it.
Run the ntaddrrd.sh script and supply a servername to use (i.e. "/usr/local/nagios/graphtools/ntaddrrd.sh someserver")


The service definition in Nagios should look something like this:

define service{
        use                             generic-service         ; Name of service template to use

	  host_name			someserver
        service_description             CPU_Load-mypan
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              2
        normal_check_interval           3
        retry_check_interval            3
        contact_groups                  admins-e
        notification_period             24x7
        check_command                   mypan-cpu!10!99!99
        }


For the check command you can see I'm collecting the cpu utilization for the last 10 minutes.  The warning and critical thresholds are set at 99, you can change this if you like.


define service{
        use                             generic-service         ; Name of service template to use

	  host_name			someserver
        service_description             MEM-mypan
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              2
        normal_check_interval           3
        retry_check_interval            3
        contact_groups                  admins-e
        notification_period             24x7
        check_command                   mypan-mem
        }


There aren't any options for the check_command.


Last step is to setup a crontab that re-creates the graphs on a regular basis.

Here is what I have in my crontabe for the NAGIOS user

*/3 * * * *     nice -n 19 /usr/local/nagios/graphtools/ntcreategraphs.sh > /dev/null 2>&1
*/5 * * * *     nice -n 19 /usr/local/nagios/graphtools/ntthumbs.sh > /dev/null 2>&1


It creates teh graphs ever 3 minutes and creates a thumbnail page every 5 minutes.

That should be it.  It's not very universal yet, i.e. I don't do any checks for where perl is or where rrdtool is.  That will come later.  If you run into any problems open up the scripts and take a look or shoot me an e-mail and I'll help out.

Josh




