Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Monitor RTT values with Nagios?

    Scheduled Pinned Locked Moved SNMP
    5 Posts 2 Posters 8.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      shockwavecs
      last edited by

      Today we experienced an abnormally high RTT value on the Gateway. How is this RTT time calculated? What is it calculated against? We would like to setup Nagios alerts for this. Any idea how to get this going to monitor the RTT? Thanks.

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        That is tracked by apinger and there wouldn't be a way for Nagios to see that normally.

        I suppose you could setup a command in nrpe2 to grab the gateway status from /tmp/apinger.status and report it back to Nagios. Not sure anyone has done that before though.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • S
          shockwavecs
          last edited by

          @jimp:

          That is tracked by apinger and there wouldn't be a way for Nagios to see that normally.

          I suppose you could setup a command in nrpe2 to grab the gateway status from /tmp/apinger.status and report it back to Nagios. Not sure anyone has done that before though.

          Ok I built an easy plugin for Nagios to monitor this service. Mostly just bash command with cut to provide status code of 0/1/2

          Where do I put the plugin on pfSense. It usually comes from the /usr/lib/nagios/plugins directory. I created the directory and dropped the plugin into it. Doesnt appear to work like it usually would under a centos box, etc.

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            Not sure about that - I think if you install nrpe2 it should show the command paths in the package settings.

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            • S
              shockwavecs
              last edited by

              @jimp:

              Not sure about that - I think if you install nrpe2 it should show the command paths in the package settings.

              oops. Didn't know that pfSense was already installed to the system and had NRPEv2 option in the web GUI. …Services --> NRPEv2

              For googlers:

              1 - Created plugin -

              
              #!/bin/sh
              
              real_rtt=`cut -f7 -d '|' /tmp/apinger.status | sed s/..$//`
              rtt=`cut -f7 -d '|' /tmp/apinger.status | sed s/......$//`
              isp=`cut -f3 -d '|' /tmp/apinger.status`
              ispIP=`cut -f1 -d '|' /tmp/apinger.status`
              
              if  [ $rtt -lt 50 ]
              then
                 echo "Normal - $isp RTT OK for $ispIP : $real_rtt ms"
                 stateid=0
              elif [ $rtt -gt 50 ] && [ $rtt -lt 100 ]
              then
                 echo "Warning - $isp RTT Increasing for $ispIP : $real_rtt ms"
                 stateid=1
              elif [ $rtt -gt 100 ]
              then
                 echo "Alert - $isp  RTT Critical for $ispIP : $real_rtt ms"
                 stateid=2
              fi
              exit $stateid
              

              2 - SCPed plugin to /usr/local/libexec/nagios directory
              3 - pfSense web GUI –> Services --> NRPEv2
              4 - Create new entry with check_pfsense_gateway_rtt as name and select the same name from plugin drop down menu:
              [attachment image 1]
              5 - add entry to /etc/nagios/services.cfg

              define service{
                 use                        basic-service
                 service_description        pfSense
                 servicegroups              local
                 host_name                  pfsensegw1
                 check_command              check_nrpe!check_pfsense_gateway_rtt
              }
              

              6 - add hostgroup entry to /etc/nagios/hosts.cfg for the pfsense

              define host{
                      use                      basic-host
                      host_name                pfsensegw1
                      alias                    pfsensegw1
                      address                  192.168.1.1
                      hostgroups               firewalls,pfsense
                      }
              

              7 - add entry to /etc/nagios/commands.cfg

              # pfSense
              define command{
                 command_name   check_pfsense_gateway_rtt
                 command_line   $USER1$/check_pfsense_gateway_rtt -H $HOSTADDRESS$
              }
              

              8 - service nagios reload
              9 - open nagios and check to see if service appears under your host. In my case "pfsensegw1"
              [attachment image 2]

              pfsense-1.png
              pfsense-1.png_thumb
              pfsense-2.png
              pfsense-2.png_thumb

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.