View Single Post
Old 05-04-2009, 11:27 AM   #1 (permalink)
wharfratjoe
Master Untangler
 
wharfratjoe's Avatar
 
Join Date: Dec 2008
Location: Southern California
Posts: 203
wharfratjoe is on a distinguished road
Default HOWTO: Monitoring Untangle using NRPE (Nagios) - Untangle 6.x

*** Important Note *** - Installing and Configuring a Nagios Server is not part of this HowTo

You will need a nagios machine already in place on your internal network to monitor the UT box. If you have a Nagios server externally (somewhere else on the Internet to monitor machines) you will need to update the Packet filter rule accordingly.

First you will need to add Packet Filter rule(s).

Internal Monitoring Packet Filter:

Code:
Name: Allow NRPE  to local Interface
Action: Pass
Source Address: Nagios_server_ip (example below is 172.16.0.4)
Destined Local
Protocol: TCP
Destination Port: 5666
External Monitoring Packet Filter:

(My Utangle box is in Router-Mode)

Code:
Name: Allow NRPE  to External Interface
Action: Pass
Source Address: Nagios_server_ip (This will be your WAN ip for your Nagios Server)
Destination Address: External_UT_IP
Destinal Port: 5666
Source Interface: External
Destined Local
Protocol: TCP
Installing NRPE Client

Referenced for Client install: http://debianclusters.cs.uni.edu/ind..._Configuration

Download for lenny: http://packages.debian.org/lenny/i38...erver/download

Download for lenny: http://packages.debian.org/lenny/nagios-plugins
Do not forget to install the dependencies list on link above (otherwise you will received errors installing the nagios-plugins package)

Configuring NRPE

Edit the /etc/nagios/nrpe.conf file with the following:
Code:
          allowed_hosts=
          debug=1
          command[check_swap]=/usr/lib/nagios/plugins/check_swap -w 20% -c 10%
***Note *** You should see the following commands already in place in the nrpe.conf file:
Code:
         command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
         command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
         command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
         command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
         command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200
Besure to verify if the commands that you require are setup and and configured correctly in the nrpe.conf file otherwise you will receive errors.

After your changes have been updated in the nrpe.conf file run the following:
Code:
          /etc/init.d/nagios-nrpe-server reload
Nagios Server Services.cfg file (sample) info to monitor the UT machine:
Code:
define service{
        use                     linux-service
        host_name               fw-gateway
        service_description     CPU Load
        check_command           check_nrpe!check_load
        }

define service{
        use                     linux-service         ; Name of service template to use
        host_name               fw-gateway
        service_description     swap
        check_command           check_nrpe!check_swap
        }

define service{
        use                     linux-service         ; Name of service template to use
        host_name               fw-gateway
        service_description     Free Space
        check_command           check_nrpe!check_hda1
        }


You can view the nrpe info on the Untangle machine by running:
Code:
 tail -f -n500 /var/log/debug
Sample Logs:
May 4 10:45:45 fw-gateway nrpe[7451]: Connection from 172.16.0.4 port 9151
May 4 10:45:45 fw-gateway nrpe[7451]: Host address is in allowed_hosts
May 4 10:45:45 fw-gateway nrpe[7451]: Handling the connection...
May 4 10:45:45 fw-gateway nrpe[7451]: Host is asking for command 'check_hda1' to be run...
May 4 10:45:45 fw-gateway nrpe[7451]: Running command: /usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
May 4 10:45:45 fw-gateway nrpe[7451]: Command completed with return code 0 and output: DISK OK - free space: / 136297 MB (96% inode=99%);| /=4520MB;118682;133517;0;148353
May 4 10:45:45 fw-gateway nrpe[7451]: Return Code: 0, Output: DISK OK - free space: / 136297 MB (96% inode=99%);| /=4520MB;118682;133517;0;148353
May 4 10:45:45 fw-gateway nrpe[7451]: Connection from 172.16.0.4 closed.
May 4 10:45:53 fw-gateway nrpe[7462]: Connection from 172.16.0.4 port 13247
May 4 10:45:53 fw-gateway nrpe[7462]: Host address is in allowed_hosts
May 4 10:45:53 fw-gateway nrpe[7462]: Handling the connection...
May 4 10:45:53 fw-gateway nrpe[7462]: Host is asking for command 'check_swap' to be run...
May 4 10:45:53 fw-gateway nrpe[7462]: Running command: /usr/lib/nagios/plugins/check_swap -w 20% -c 10%
May 4 10:45:53 fw-gateway nrpe[7462]: Command completed with return code 0 and output: SWAP OK - 100% free (1893 MB out of 1906 MB) |swap=1893MB;381;190;0;1906
May 4 10:45:53 fw-gateway nrpe[7462]: Return Code: 0, Output: SWAP OK - 100% free (1893 MB out of 1906 MB) |swap=1893MB;381;190;0;1906
May 4 10:45:53 fw-gateway nrpe[7462]: Connection from 172.16.0.4 closed.
May 4 10:45:55 fw-gateway nrpe[7467]: Connection from 172.16.0.4 port 15039
May 4 10:45:55 fw-gateway nrpe[7467]: Host address is in allowed_hosts
May 4 10:45:55 fw-gateway nrpe[7467]: Handling the connection...
May 4 10:45:55 fw-gateway nrpe[7467]: Host is asking for command 'check_load' to be run...
May 4 10:45:55 fw-gateway nrpe[7467]: Running command: /usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
May 4 10:45:55 fw-gateway nrpe[7467]: Command completed with return code 0 and output: OK - load average: 0.26, 0.27, 0.22|load1=0.260;15.000;30.000;0; load5=0.270;10.000;25.000;0; load15=0.220;5.000;20.000;0;
May 4 10:45:55 fw-gateway nrpe[7467]: Return Code: 0, Output: OK - load average: 0.26, 0.27, 0.22|load1=0.260;15.000;30.000;0; load5=0.270;10.000;25.000;0; load15=0.220;5.000;20.000;0;
May 4 10:45:55 fw-gateway nrpe[7467]: Connection from 172.16.0.4 closed.
May 4 10:45:59 fw-gateway nrpe[13970]: Added command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
May 4 10:45:59 fw-gateway nrpe[13970]: Added command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
May 4 10:45:59 fw-gateway nrpe[13970]: Added command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
May 4 10:45:59 fw-gateway nrpe[13970]: Added command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
May 4 10:45:59 fw-gateway nrpe[13970]: Added command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200
May 4 10:45:59 fw-gateway nrpe[13970]: Added command[check_swap]=/usr/lib/nagios/plugins/check_swap -w 20% -c 10%

Last edited by wharfratjoe; 11-17-2009 at 07:57 PM..
wharfratjoe is offline