Categories

CUC (6) CUCM (27) Jabber (6) Python (2) Routing (3) Solarwinds Orion NPM (4) switching (1) Video (6) voice (2)

Monday, 21 August 2017

using SNMP to monitor class maps / interface policies as well as some solarwinds



Sometimes it is just plain useful to  get some insight into the traffic classes that you use on some police map of, yes, some interface. Many organisation will have some sort of net flow tool deployed in their network, but that does not really give you any details on bit rates and drop rates that take place on an interface, in times of congestion. Sure Cisco prime can quantify QoS, but using snmp pollers is much cheaper.  The trick is to find the right OID to poll. So let me get stuck right into it.


STEP 1:

From your Cisco device's, CLI issue the following:

EXECUTE:           show snmp mib ifmib ifindex

GigabitEthernet0/1.100: Ifindex = 14
GigabitEthernet0/1: Ifindex = 3
GigabitEthernet0/1.10: Ifindex = 20
GigabitEthernet0/1.9: Ifindex = 19
Backplane-GigabitEthernet0/3: Ifindex = 4
GigabitEthernet0/1.7: Ifindex = 17
Async0/0/3: Ifindex = 9
Async0/0/1: Ifindex = 7
GigabitEthernet0/1.5: Ifindex = 15
GigabitEthernet0/1.3: Ifindex = 13
Loopback0: Ifindex = 10
Embedded-Service-Engine0/0: Ifindex = 1
Null0: Ifindex = 5
GigabitEthernet0/0: Ifindex = 2    <-------this is the interface we are interested in
GigabitEthernet0/1.11: Ifindex = 11
GigabitEthernet0/1.8: Ifindex = 18
GigabitEthernet0/1.6: Ifindex = 16
Async0/0/2: Ifindex = 8
Async0/0/0: Ifindex = 6
GigabitEthernet0/1.2: Ifindex = 12



STEP 2:

Get the cbQosIfIndex (OID 1.3.6.1.4.1.9.9.166.1.1.1.1.4) for the ifindex you retrieved in Step 1 (ifindex=2 in this case).

EXECUTE: snmp walk: <1.3.6.1.4.1.9.9.166.1.1.1.1.4>

result:

.1.3.6.1.4.1.9.9.166.1.1.1.1.4.34 = INTEGER: 2
.1.3.6.1.4.1.9.9.166.1.1.1.1.4.176 = INTEGER: 11
.1.3.6.1.4.1.9.9.166.1.1.1.1.4.192 = INTEGER: 12
.1.3.6.1.4.1.9.9.166.1.1.1.1.4.208 = INTEGER: 13
.1.3.6.1.4.1.9.9.166.1.1.1.1.4.224 = INTEGER: 14
.1.3.6.1.4.1.9.9.166.1.1.1.1.4.240 = INTEGER: 15
.1.3.6.1.4.1.9.9.166.1.1.1.1.4.256 = INTEGER: 16
.1.3.6.1.4.1.9.9.166.1.1.1.1.4.272 = INTEGER: 17
.1.3.6.1.4.1.9.9.166.1.1.1.1.4.288 = INTEGER: 18
.1.3.6.1.4.1.9.9.166.1.1.1.1.4.304 = INTEGER: 19
.1.3.6.1.4.1.9.9.166.1.1.1.1.4.320 = INTEGER: 20

The cbQosPolicyIndex (OID 1.3.6.1.4.1.9.9.166.1.1.1.1.1) value returned, in this example, is 34

This means that, on interface Gi0/0 (Integer=2)  the cbQosPolicyIndex  = 34

STEP 3:

Use the MIB Object cbQosCMName (1.3.6.1.4.1.9.9.166.1.7.1.1.1) to get the names of class-maps configured on the router.

Now, query the Class map configuration as follows:

snmp walk:  <.1.3.6.1.4.1.9.9.166.1.7.1.1.1>

.1.3.6.1.4.1.9.9.166.1.7.1.1.1.1593 = STRING: "class-default"
.1.3.6.1.4.1.9.9.166.1.7.1.1.1.1434177 = STRING: "cm-prec-2-out"
.1.3.6.1.4.1.9.9.166.1.7.1.1.1.2482753 = STRING: "cm-prec-3-out"
.1.3.6.1.4.1.9.9.166.1.7.1.1.1.8774209 = STRING: "cm-prec-1-out"
.1.3.6.1.4.1.9.9.166.1.7.1.1.1.12472097 = STRING: "cm-prec-4-5-out"
.1.3.6.1.4.1.9.9.166.1.7.1.1.1.14191553 = STRING: "cm-prec-2-in"
.1.3.6.1.4.1.9.9.166.1.7.1.1.1.14257089 = STRING: "cm-prec-3-in"
.1.3.6.1.4.1.9.9.166.1.7.1.1.1.14322625 = STRING: "cm-prec-4-in"
.1.3.6.1.4.1.9.9.166.1.7.1.1.1.14650305 = STRING: "cm-prec-1-in"

Suppose, we are interested in the QosConfig of "cm-prec-4-5-out". Make a note of the highlighted value 12472097, which is cbQosConfigIndex.

STEP 4:

Use cbQosConfigIndex to get the cbQosPolicyIndex (1.3.6.1.4.1.9.9.166.1.1.1.1.1) and cbQosObjectsIndex (1.3.6.1.4.1.9.9.166.1.5.1.1.1) for individual class-maps.



STEP 5:

In order to get the Object Identifier (OID), search for the cbQosConfigIndex value obtained in Step 3 (12472097) in the output below:



EXECUTE: snmp walk: <1.3.6.1.4.1.9.9.166.1.5.1.1.2>

output:

.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.34 = GAUGE32: 14151856
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.887811 = GAUGE32: 10273235
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.2089970 = GAUGE32: 5239858
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.2196705 = GAUGE32: 12472097    <_----cm-prec-4-5-out
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.3369731 = GAUGE32: 11175747
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.4481794 = GAUGE32: 855826
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.5649682 = GAUGE32: 1594
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.6726419 = GAUGE32: 13688019
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.  = GAUGE32: 1593
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.8493601 = GAUGE32: 8774209
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.9382035 = GAUGE32: 12112579
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.9422642 = GAUGE32: 1594
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.9953299 = GAUGE32: 9357059
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.13689184 = GAUGE32: 10583344
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.14664689 = GAUGE32: 1593
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.14754018 = GAUGE32: 5252402
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.14779570 = GAUGE32: 14230322
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.14785057 = GAUGE32: 2482753
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.15141170 = GAUGE32: 5276466
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.15833633 = GAUGE32: 1434177 <--cm-prec-2-out
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.34.15863043 = GAUGE32: 14812867
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.176.176 = GAUGE32: 1298848
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.176.2463202 = GAUGE32: 15444834
.1.3.6.1.4.1.9.9.166.1.5.1.1.2.176.2741826 = GAUGE32: 6784962

in the output above  The highlighted values are: cbQosConfigIndex (12472097), cbQosPolicyIndex (34), and cbQosObjectsIndex (2196705).


STEP 7:

Now let us pull some relevant information of the router; let find out how much traffic is in in the pm-prec-4-5--out


Router # show policy-map interface GigabitEthernet0/0

EXECUTE: snmp walk <1.3.6.1.4.1.9.9.166.1.15.1.1.11.34>  
.1.3.6.1.4.1.9.9.166.1.15.1.1.11.34.2196705 = GAUGE32: 0
all policy map classes:
.1.3.6.1.4.1.9.9.166.1.15.1.1.11.34.2196705 = GAUGE32: 0                    <-----4-5 out
.1.3.6.1.4.1.9.9.166.1.15.1.1.11.34.7871617 = GAUGE32: 119000                <-------------default  bps
.1.3.6.1.4.1.9.9.166.1.15.1.1.11.34.8493601 = GAUGE32: 0                     <-----1 out
.1.3.6.1.4.1.9.9.166.1.15.1.1.11.34.14664689 = GAUGE32: 163000
.1.3.6.1.4.1.9.9.166.1.15.1.1.11.34.14785057 = GAUGE32: 3000                <----3 out
.1.3.6.1.4.1.9.9.166.1.15.1.1.11.34.15833633 = GAUGE32: 29000               <-----2 out

x
Time to get into some practicalities. Once you have obtained the 3 values:
cbQosConfigIndex (12472097) 
cbQosPolicyIndex (34)
cbQosObjectsIndex (2196705)
To poll data from the Policy-map 
(in correlation with QosObjectsType=classmap)

Use the base: 1.3.6.1.4.1.9.9.166.1.15 , many options are available:
+-- -R-- Counter   cbQosCMPrePolicyPktOverflow(1)
+-- -R-- Counter   cbQosCMPrePolicyPkt(2)
+-- -R-- Counter64 cbQosCMPrePolicyPkt64(3)
+-- -R-- Counter   cbQosCMPrePolicyByteOverflow(4)
+-- -R-- Counter   cbQosCMPrePolicyByte(5)
+-- -R-- Counter64 cbQosCMPrePolicyByte64(6)
+-- -R-- Gauge     cbQosCMPrePolicyBitRate(7)
+-- -R-- Counter   cbQosCMPostPolicyByteOverflow(8)
+-- -R-- Counter   cbQosCMPostPolicyByte(9)
+-- -R-- Counter64 cbQosCMPostPolicyByte64(10)
+-- -R-- Gauge     cbQosCMPostPolicyBitRate(11)
+-- -R-- Counter   cbQosCMDropPktOverflow(12)
+-- -R-- Counter   cbQosCMDropPkt(13)
+-- -R-- Counter64 cbQosCMDropPkt64(14)
+-- -R-- Counter   cbQosCMDropByteOverflow(15)
+-- -R-- Counter   cbQosCMDropByte(16)
+-- -R-- Counter64 cbQosCMDropByte64(17)
+-- -R-- Gauge     cbQosCMDropBitRate(18)
+-- -R-- Counter   cbQosCMNoBufDropPktOverflow(19)
-- -R-- Counter   cbQosCMNoBufDropPkt(20)
-- -R-- Counter64 cbQosCMNoBufDropPkt64(21)

For example, cbQosCMPostPolicyBitRate  (1.3.6.1.4.1.9.9.166.1.15.1.1.11), 
polls the bit rate of the traffic after QoS policy execution, 
derived from 11 in the table above, so drop rate would be:
1.3.6.1.4.1.9.9.166.1.15.1.1.18

Solarwinds configuration.
Solarwinds NPM has the ability to poll certain OIDs through customized pollers.
Go to universal device pollers:

As you can see we are polling 1.3.6.1.4.1.9.9.166.1.15.1.1.11, to find the post policy bit rate. The oid will actually return a table will the traffic rates for all class maps on all applied interfaces.
The post policy bit rate poller can be summarised as per above. Now lets have a closer look in solarwinds npm at a device that we have assigned the poller to:

Picture above shows the dfjbit rate for a class map prec-4-5-out (yes exactly the same name as when querying 1.3.6.1.4.1.9.9.166.1.7.1.1.1 earlier on in this post). essentially the graph above depicts 1.3.6.1.4.1.9.9.166.1.15.1.1.11.18.11136785
in the graph above, go to EDIT:
<As can be seen above only 18.1136785 is graphed, which is cm-prec-4-5-out.
if you wanted to graph more class maps:
1.3.6.1.4.1.9.9.166.1.7.1.1.1.2482753 = STRING: "cm-prec-3-out"
1.3.6.1.4.1.9.9.166.1.5.1.1.2.18.11057649 = GAUGE32: 2482753
you could tick for instance: 18.11057649, in the devicepoller graph above, for cm-prec-3-out to be graphed source:https://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/119031-technote-router-00.html

No comments:

Post a Comment