8

My goal is to write a service check that pulls the status of a Cisco track list that is performing a Boolean OR. I have a screen scraper in place currently, but that is really not ideal in terms of scaling this type of service check.

The track object below simply pulls out the tracked static route if object 10 and object 20 are both unreachable, allowing a BGP learned default route to be installed, that is otherwise in RIB-failure status.

Configuration Example:

!
track 10 ip sla 1 reachability
!
track 20 ip sla 2 reachability
!
track 30 list boolean or
 object 10
 object 20
!
ip sla 1
 icmp-echo 8.8.8.8 source-ip 10.10.10.10
ip sla schedule 1 life forever start-time now
ip sla 2
 icmp-echo 4.2.2.2 source-ip 10.10.10.10
ip sla schedule 2 life forever start-time now

ip route 0.0.0.0 0.0.0.0 10.10.10.1 track 30

It would be ideal to pull either the number of changes or the Boolean OR status (up or down) from an OID.

HOSTNAME#show track 30
Track 30
  List boolean or
  Boolean OR is Up
    14716 changes, last change 02:18:47
    object 10 Up
    object 20 Up
  Tracked by:
    STATIC-IP-ROUTINGTrack-list 0

I've been digging through the Google machine, forums and the Cisco SNMP Object Navigator to no avail.

2 Answers 2

8

I don't believe there is a way to directly poll the results of the OR via SNMP, but you can certainly poll for the IP SLA results and calculate it yourself.

Using the CISCO-RTTMON-MIB (1.3.6.1.4.1.9.9.42), you can check the timeout value of your reachability checks, take the true/false value it returns and do the OR in whatever scripting language you're using to poll via SNMP.


For example, I setup a similar test to yours above:

track 10 ip sla 1 reachability
!
track 20 ip sla 2 reachability
!
track 30 list boolean or
 object 10
 object 20
!
ip sla 1
 icmp-echo 8.8.8.8 source-ip 10.129.10.62
ip sla schedule 1 life forever start-time now
ip sla 2
 icmp-echo 4.2.2.2 source-ip 10.129.10.62
ip sla schedule 2 life forever start-time now
!
ip route 10.171.20.0 255.255.255.252 10.129.10.61 track 30

Then, I verified the output in IOS:

R-VOIPLAB#show track 30
Track 30
  List boolean or
  Boolean OR is Up
    2 changes, last change 00:01:21
    object 10 Up
    object 20 Up

Next, with the IP SLA tracking in place, I installed the CISCO-RTTMON-MIB on my monitoring server, and walked the value of rttMonCtrlOperTimeoutOccurred (1.3.6.1.4.1.9.9.42.1.2.9.1.6) for it's True/False output.

The key item to note is that since we are polling whether a timeout occurred or not, that False means that the destination is reachable, and True means that it is not reachable and a timeout has occurred.

snmpwalk -v3 -a SHA -A SNMP-AUTH-PASS -l authNoPriv -u SNMPUSER r-voiplab rttMonCtrlOperTimeoutOccurred
CISCO-RTTMON-MIB::rttMonCtrlOperTimeoutOccurred.1 = INTEGER: false(2)
CISCO-RTTMON-MIB::rttMonCtrlOperTimeoutOccurred.2 = INTEGER: false(2)

Finally, I blackholed traffic to 8.8.8.8 from that box, and checked the Track results in IOS again:

R-VOIPLAB(config)#ip route 8.8.8.8 255.255.255.255 null 0
R-VOIPLAB(config)#end
R-VOIPLAB#show track 30
Track 30
  List boolean or
  Boolean OR is Up
    2 changes, last change 00:21:18
    object 10 Down
    object 20 Up
  Tracked by:
    STATIC-IP-ROUTING 0

Now that we have one of the test objects in a Down state, let us see the results of polling rttMonCtrlOperTimeoutOccurred again:

snmpwalk -v3 -a SHA -A SNMP-AUTH-PASS -l authNoPriv -u SNMPUSER r-voiplab rttMonCtrlOperTimeoutOccurred
CISCO-RTTMON-MIB::rttMonCtrlOperTimeoutOccurred.1 = INTEGER: true(1)
CISCO-RTTMON-MIB::rttMonCtrlOperTimeoutOccurred.2 = INTEGER: false(2)

Now, as I stated above, you would just have to poll those values and use them however you need to in your script.

5

We had the same issue and I found solution for it:

It is called Expression MIB as per RFC 2982. You can do logical OR on this level by creating of new SNMP OID object which will be calculated at the same time as the SNMP Request comes to router/switch for this OID.

Afterwards you can use this object to poll SNMP statistics of 2 or more ORed (via Expression MIB) IP SLA probes.

I can provide you with more details if you want. I will also prepare blog post about it with step by step instructions how to create new SNMP OID for this particular use via Expression MIB.

Let's say you have 3 HTTP IP SLA probes configured on device and you want to monitor (via SNMP) ORed result:

  1. IP SLA Index / rttMonHTTPStatsEntry == 3000
  2. IP SLA Index / rttMonHTTPStatsEntry == 3001
  3. IP SLA Index / rttMonHTTPStatsEntry == 3002

You can use following OID rttMonLatestHTTPOperSense (one per entry / ip sla probe) and assign its value to variable in order to use this values in expression evaluation.

How to:

  1. destroys an eventual old expression that is created

    snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.2.3.1.3.101.49.101.120.112 integer 6

  2. create and wait

    snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.2.3.1.3.101.49.101.120.112 integer 5

  3. creates the index to use later to retrieve the result of the expression

    snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.2.3.1.2.101.49.101.120.112 u 1

  4. the description of the expression

    snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.1.1.4.1 s "Expression MIB - IP SLA Probes ORing"

  5. Expression to be evaluated

    snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.1.1.2.1 s '((($1 < 2) && ($1 > 0)) || (($2 < 2) && ($2 > 0)) || (($3 < 2) && ($3 > 0)))'

  6. sets variable $1 for rttMonLatestHTTPOperSense

    snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.2.1.1 objectidentifier 1.3.6.1.4.1.9.9.42.1.5.1.1.6.3000

  7. sets variable $2 for rttMonLatestHTTPOperSense

    snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.2.1.2 objectidentifier 1.3.6.1.4.1.9.9.42.1.5.1.1.6.3001

  8. sets variable $3 for rttMonLatestHTTPOperSense

    snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.2.1.3 objectidentifier 1.3.6.1.4.1.9.9.42.1.5.1.1.6.3002

  9. sets type of $1 variable to absolute (for delta is 2)

    snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.4.1.1 integer 1

  10. sets type of $2 variable to absolute (for delta is 2)

snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.4.1.2 integer 1
  1. sets type of $3 variable to absolute (for delta is 2)
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.4.1.3 integer 1
  1. Set the rows in the expObjectTable to active
snmpset -v2c -cstart123 172.0.0.1
 1.3.6.1.4.1.9.10.22.1.3.2.1.10.1.1 integer 1
  1. Set the rows in the expObjectTable to active
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.10.1.2 integer 1
  1. Set the rows in the expObjectTable to active
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.10.1.3 integer 1
  1. Activates the expression
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.2.3.1.3.101.49.101.120.112 integer 1

Only script:

snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.2.3.1.3.101.49.101.120.112 integer 6
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.2.3.1.3.101.49.101.120.112 integer 5
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.2.3.1.2.101.49.101.120.112 u 1
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.1.1.4.1 s "Expression MIB - IP SLA Probes ORing"
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.1.1.2.1 s '((($1 < 2) && ($1 > 0)) || (($2 < 2) && ($2 > 0)) || (($3 < 2) && ($3 > 0)))'
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.2.1.1 objectidentifier 1.3.6.1.4.1.9.9.42.1.5.1.1.6.3000
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.2.1.2 objectidentifier 1.3.6.1.4.1.9.9.42.1.5.1.1.6.3001
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.2.1.3 objectidentifier 1.3.6.1.4.1.9.9.42.1.5.1.1.6.3002
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.4.1.1 integer 1
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.4.1.2 integer 1
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.4.1.3 integer 1
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.10.1.1 integer 1
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.10.1.2 integer 1
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.3.2.1.10.1.3 integer 1
snmpset -v2c -cstart123 172.0.0.1 1.3.6.1.4.1.9.10.22.1.2.3.1.3.101.49.101.120.112 integer 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.