Navigation

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

    dpinger Gateway latency via SNMP?

    SNMP
    2
    4
    403
    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.
    • K
      keyser last edited by keyser

      Is there any way to return the current dpinger Gateway Latency via SNMP?

      I'd like to graph my gateway latency outside pfSense (Zabbix), but I'd rather not have to install a Zabbix Agent or Telegraf on my pfSense.
      It would be VERY nice if the builtin SNMPD provided an OID to return the current Gateway latency. I can't locate it with a SNMPWALK, but given there are thousands of unexplained OID returned, it could still be there :-)

      K 1 Reply Last reply Reply Quote 0
      • K
        keyser @keyser last edited by

        @keyser Bump... Is that just impossible?

        dennypage 2 Replies Last reply Reply Quote 0
        • dennypage
          dennypage @keyser last edited by

          @keyser To my knowledge it is not exposed by default via SNMP.

          Should be easy to add via extend if you are using net-snmp.

          1 Reply Last reply Reply Quote 1
          • dennypage
            dennypage @keyser last edited by

            @keyser Here are a couple of net-snmp extend scripts as examples. The first is multi line, and the second is single line. Which to use depends upon how you want to parse on the other end. To me, multi line is simpler, but some people strongly prefer single line. To each their own.

            Assuming that you name the extend "dpinger", you will find the OID at

            NET-SNMP-EXTEND-MIB::nsExtendOutputFull."dpinger"
            (.1.3.6.1.4.1.8072.1.3.2.3.1.2.7.100.112.105.110.103.101.114)

            Enjoy.

            #!/bin/sh
            
            for file in /var/run/dpinger*.sock
            do
                cat $file | awk '{print "name:"$1",latency:"$2",stddev:"$3",loss:"$4}'
            done
            
            #!/bin/sh
            
            for file in /var/run/dpinger*.sock
            do
                if [ "${result}" ]
                then
                    result="${result},"
                fi
            
                new=`cat $file | awk '{print "{name:"$1",latency:"$2",stddev:"$3",loss:"$4"}" }'`
                result="${result}${new}"
            done
            
            echo "${result}"
            
            1 Reply Last reply Reply Quote 1
            • First post
              Last post