Ad Widget

Collapse

Combine the results of multiple OID's into one for graphing?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gshearer
    Junior Member
    • Jan 2010
    • 13

    #1

    Combine the results of multiple OID's into one for graphing?

    Anyone know how to create an item that will combine the results of multiple dynamically-matched OID's into one for graphing?

    To be more clear, this is what I'm trying to do:

    I'm trying to collect _total_ in bytes/out bytes for a particular IPsec tunnel. In my case, I'm using a cisco IOS-based router using crypto maps (as opposed to VTI's)

    Since there can be several IPsec phase-2 SA Flows per tunnel, I have to combine them all. Oh, and to make matters worse, the OID's are different every time a flow is built

    So, in SNMP terms, here are the polls:

    .1.3.6.1.4.1.9.9.171.1.3.2.1.26.[INDEX Number] gives me "input bytes"
    .1.3.6.1.4.1.9.9.171.1.3.2.1.39.[INDEX Number] gives me "output bytes"

    To find out the index number:

    .1.3.6.1.4.1.9.9.172.1.2.1.1.4.[string match for desired remote peer]

    Now, the problem? Since this IPSec Phase 2 we're talking about, multiple index numbers can be returned for the same peer, representing separate IPsec Flows.

    I can't seem to find an OID that is an aggregate for all of the flows. And I've dug through the damn mib so much my head hurts now.

    Anyway, so the Zabbix format would be:

    .1.3.6.1.4.1.9.9.172.1.2.1.1.26["index",".1.3.6.1.4.1.9.9.172.1.2.1.1.4","REMO TE-PEER-NAME"]
    .1.3.6.1.4.1.9.9.172.1.2.1.1.39["index",".1.3.6.1.4.1.9.9.172.1.2.1.1.4","REMO TE-PEER-NAME"]

    That part is working, but of course, I'm only getting data for whatever SA flow happens to be the first.

    As of now I'm thinking about writing a little script to do this, and poll it using the zabbix agent on my local zabbix server, but I figured I'd ask here first if anyone knew of a better way..
  • gshearer
    Junior Member
    • Jan 2010
    • 13

    #2
    This script does what I need... but... I'd prefer to do it built-in with zabbix:
    Code:
    #!/bin/sh
    snmpwalk -Oqn myrouter .1.3.6.1.4.1.9.9.172.1.2.1.1.4 |grep "PEER-SEARCH-VALUE" | cut -d' ' -f1 | awk -F. '{ print $NF }' | while read BLAH
    do
            VALUE=`snmpget -Oqvn myrouter .1.3.6.1.4.1.9.9.171.1.3.2.1.26.$BLAH | cut -d' ' -f1`
            TOTAL_IN=$(($TOTAL_IN + $VALUE))
            VALUE=`snmpget -Oqvn myrouter .1.3.6.1.4.1.9.9.171.1.3.2.1.39.$BLAH | cut -d' ' -f1`
            TOTAL_OUT=$(($TOTAL_OUT + $VALUE))
            echo $TOTAL_IN $TOTAL_OUT
    done | tail -1

    Comment

    • thijz
      Junior Member
      • Aug 2013
      • 12

      #3
      update ?

      Hi,

      Just wondering if there is any update on this ?
      i'm in a similar situation so i'm also interested in finding out how to combine multiple 'data sources'

      grtz
      Thijs

      Comment

      Working...