Page 1 of 3 123 LastLast
Results 1 to 10 of 30
  1. #1
    Master Untangler wharfratjoe's Avatar
    Join Date
    Dec 2008
    Location
    Southern California
    Posts
    430

    Default HOWTO: Monitoring Untangle using NRPE (Nagios) - Untangle 7.x

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

    *** Use At Your Own Risk ***

    (This howto is based on a new install using Build: 7.0.1~svn20091019r24846release7.0-1lenny)

    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)
    Destination Port: 5666
    Protocol: TCP
    Destined Local
    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

    Code:
    vim /etc/apt/sources.list
    
    deb http://ftp.debian.org/debian lenny main contrib non-free
    # Commented by Untangle: deb http://security.debian.org lenny/updates main contrib non-free
    # Commented by Untangle: deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free
    #deb http://www.backports.org/debian lenny-backports main contrib non-free
    Now run apt-get update


    Now do the following:

    Code:
    apt-get -f install nagios-plugins-standard 
    
    Now run:
    apt-get -f install
    (this will install of the dependencies)
    
    Now run:
    apt-get install nagios-nrpe-server nagios-plugin
    
    Then run this again:
    
    apt-get -f install 
    
    Now run this one more time
    
    apt-get install nagios-nrpe-server
    *** I know this is a little bit of a "dirty" way of doing this but unfortunately at the moment I do not have another machine to clean this up and install again but this did get everything up and running ***

    Verify that nagios has started by doing the following. You should see something similar to below:

    Code:
     ps -ef |grep nagios 
    nagios   11031     1  0 14:22 ?        00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
    If nagios did not start then run the following:
    Code:
    /etc/init.d/nagios-nrpe-server reload



    Configuring NRPE

    Edit the /etc/nagios/nrpe.cfg file with the following:
    Code:
              allowed_hosts= [ip of nagios server here]
              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.cfg 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.cfg file otherwise you will receive errors.

    After your changes have been updated in the nrpe.cfg 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 n200 /var/log/debug |grep nrpe
    Sample Logs:
    Nov 17 17:57:12 fw-gateway nrpe[13892]: Added command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
    Nov 17 17:57:12 fw-gateway nrpe[13892]: Added command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
    Nov 17 17:57:12 fw-gateway nrpe[13892]: Added command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
    Nov 17 17:57:12 fw-gateway nrpe[13892]: Added command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
    Nov 17 17:57:12 fw-gateway nrpe[13892]: Added command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200
    Nov 17 17:57:12 fw-gateway nrpe[13892]: Added command[check_swap]=/usr/lib/nagios/plugins/check_swap -w 20% -c 10%
    Nov 17 18:42:39 fw-gateway nrpe[17892]: Connection from 172.16.0.6 port 46821
    Nov 17 18:42:39 fw-gateway nrpe[17892]: Host address is in allowed_hosts
    Nov 17 18:42:39 fw-gateway nrpe[17892]: Handling the connection...
    Nov 17 18:42:40 fw-gateway nrpe[17894]: Connection from 172.16.0.6 port 47333
    Nov 17 18:42:40 fw-gateway nrpe[17894]: Host address is in allowed_hosts
    Nov 17 18:42:40 fw-gateway nrpe[17894]: Handling the connection...
    Nov 17 18:42:40 fw-gateway nrpe[17892]: Host is asking for command 'check_load' to be run...
    Nov 17 18:42:40 fw-gateway nrpe[17892]: Running command: /usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
    Nov 17 18:42:40 fw-gateway nrpe[17898]: Connection from 172.16.0.6 port 47589
    Nov 17 18:42:40 fw-gateway nrpe[17898]: Host address is in allowed_hosts
    Nov 17 18:42:40 fw-gateway nrpe[17898]: Handling the connection...
    Nov 17 18:42:40 fw-gateway nrpe[17892]: Command completed with return code 0 and output: OK - load average: 0.08, 0.12, 0.17|load1=0.080;15.000;30.000;0; load5=0.120;10.000;25.000;0; load15=0.170;5.000;20.000;0;
    Nov 17 18:42:40 fw-gateway nrpe[17892]: Return Code: 0, Output: OK - load average: 0.08, 0.12, 0.17|load1=0.080;15.000;30.000;0; load5=0.120;10.000;25.000;0; load15=0.170;5.000;20.000;0;
    Nov 17 18:42:40 fw-gateway nrpe[17892]: Connection from 172.16.0.6 closed.
    Nov 17 18:42:40 fw-gateway nrpe[17894]: Host is asking for command 'check_swap' to be run...
    Nov 17 18:42:40 fw-gateway nrpe[17894]: Running command: /usr/lib/nagios/plugins/check_swap -w 20% -c 10%
    Nov 17 18:42:40 fw-gateway nrpe[17898]: Host is asking for command 'check_hda1' to be run...
    Nov 17 18:42:40 fw-gateway nrpe[17898]: Running command: /usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
    Nov 17 18:42:40 fw-gateway nrpe[17894]: Command completed with return code 0 and output: SWAP OK - 100% free (2588 MB out of 2588 MB) |swap=2588MB;517;258;0;2588
    Nov 17 18:42:40 fw-gateway nrpe[17894]: Return Code: 0, Output: SWAP OK - 100% free (2588 MB out of 2588 MB) |swap=2588MB;517;258;0;2588
    Nov 17 18:42:40 fw-gateway nrpe[17894]: Connection from 172.16.0.6 closed.
    Nov 17 18:42:40 fw-gateway nrpe[17898]: Command completed with return code 0 and output: DISK OK - free space: / 137488 MB (98% inode=99%);| /=2690MB;118144;132912;0;147680
    Nov 17 18:42:40 fw-gateway nrpe[17898]: Return Code: 0, Output: DISK OK - free space: / 137488 MB (98% inode=99%);| /=2690MB;118144;132912;0;147680
    Nov 17 18:42:40 fw-gateway nrpe[17898]: Connection from 172.16.0.6 closed.
    Last edited by wharfratjoe; 11-18-2009 at 09:58 AM.

  2. #2
    Master Untangler wharfratjoe's Avatar
    Join Date
    Dec 2008
    Location
    Southern California
    Posts
    430

    Default

    ### Important Note ###

    After Nagios is up and running besure to edit the sources list back so you can get any untangle updates as needed:


    Code:
    vim /etc/apt/sources.list
    
    #deb http://ftp.debian.org/debian lenny main contrib non-free
    # Commented by Untangle: deb http://security.debian.org lenny/updates main contrib non-free
    # Commented by Untangle: deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free
    #deb http://www.backports.org/debian lenny-backports main contrib non-free

    Code:
    run apt-get update
    You should see something similar to this:

    get update [root @ fw-gateway]
    Hit http://updates.untangle.com stable Release.gpg
    Ign http://updates.untangle.com stable/main Translation-en_US
    Ign http://updates.untangle.com stable/premium Translation-en_US
    Ign http://updates.untangle.com stable/upstream Translation-en_US
    Hit http://updates.untangle.com dart Release.gpg
    Ign http://updates.untangle.com dart/main Translation-en_US
    Ign http://updates.untangle.com dart/premium Translation-en_US
    Ign http://updates.untangle.com dart/upstream Translation-en_US
    Hit http://updates.untangle.com stable Release
    Hit http://updates.untangle.com dart Release
    Ign http://updates.untangle.com stable/main Packages/DiffIndex
    Ign http://updates.untangle.com stable/premium Packages/DiffIndex
    Ign http://updates.untangle.com stable/upstream Packages/DiffIndex
    Ign http://updates.untangle.com dart/main Packages/DiffIndex
    Ign http://updates.untangle.com dart/premium Packages/DiffIndex
    Ign http://updates.untangle.com dart/upstream Packages/DiffIndex
    Ign http://updates.untangle.com stable/main Packages
    Ign http://updates.untangle.com stable/premium Packages
    Ign http://updates.untangle.com stable/upstream Packages
    Ign http://updates.untangle.com dart/main Packages
    Ign http://updates.untangle.com dart/premium Packages
    Ign http://updates.untangle.com dart/upstream Packages
    Hit http://updates.untangle.com stable/main Packages
    Hit http://updates.untangle.com stable/premium Packages
    Hit http://updates.untangle.com stable/upstream Packages
    Hit http://updates.untangle.com dart/main Packages
    Hit http://updates.untangle.com dart/premium Packages
    Hit http://updates.untangle.com dart/upstream Packages
    Reading package lists... Done
    W: Conflicting distribution: http://updates.untangle.com stable Release (expected stable but got dart-1)
    W: You may want to run apt-get update to correct these problems

  3. #3
    Master Untangler li_leejohn's Avatar
    Join Date
    Sep 2008
    Posts
    248

    Default

    Hi Sir,
    I have already existing nrpe configuration based on version UT 6.2 then i want to upgrade to 7.x version what shall i do? Do i need to run this setup for my newly upgraded version of UT? Thanx

  4. #4
    Master Untangler wharfratjoe's Avatar
    Join Date
    Dec 2008
    Location
    Southern California
    Posts
    430

    Default

    Quote Originally Posted by li_leejohn View Post
    Hi Sir,
    I have already existing nrpe configuration based on version UT 6.2 then i want to upgrade to 7.x version what shall i do? Do i need to run this setup for my newly upgraded version of UT? Thanx
    This was on a new install of Untangle 7(that was auto upgraded to 7.0.1). I have not tried your scenario yet. If this is a production box and it were me, i would try to test your scenerio first.

  5. #5
    Master Untangler li_leejohn's Avatar
    Join Date
    Sep 2008
    Posts
    248

    Default

    Great news. Upgrade was successful with existing NRPE configuration from the old version of untangle. After checking the upgraded untangle(7.0.1) my nrpe configuration still retained. I tried also rebooting the server to test the upgraded untangle and to test the remote nagios server and still no problem at all calling nrpe untangle of nagios server.

  6. #6
    Master Untangler wharfratjoe's Avatar
    Join Date
    Dec 2008
    Location
    Southern California
    Posts
    430

    Default

    Excellent

  7. #7
    Newbie
    Join Date
    Dec 2009
    Posts
    6

    Default

    This is perfect!

  8. #8
    Untangle Ninja sky-knight's Avatar
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Posts
    26,542

    Default

    I wouldn't expect anything in this realm to break unless we get a new kernel on upgrade. At that point you'll need to manually upgrade the packages in question to get the most recent version.

    That's the only real issue... you can't just apt-get upgrade, you'll break your box. So you get to manually upgrade just the specific packages you need upgraded.
    Rob Sandling, BS:SWE, MCP
    NexgenAppliances.com
    Phone: 866-794-8879 x201
    Email: support@nexgenappliances.com

  9. #9
    Untanglit
    Join Date
    Dec 2009
    Posts
    18

    Default

    Thank you for posting this! I've been wondering if nagios would work

  10. #10
    Newbie
    Join Date
    Nov 2009
    Posts
    11

    Default

    it helps me a lot.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO 3.6.0 PL2