Creating XML snmp query for Cisco ASR9000

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
rbressers
Posts: 5
Joined: Tue Feb 03, 2009 11:46 am

Creating XML snmp query for Cisco ASR9000

Post by rbressers »

I'm building a template for Cisco ASR9001 routers and i'd like to create a data query to get CPU usage out of the multiple processors available in the box. I usually work with creating XML files for dataqueries, which pull information via SNMP.

The problem is that i'd like to pull the following information :

- CPU name (eg: module 0/RSP0/CPU0)
- CPU usage last 1 minute

The index is at 1.3.6.1.4.1.9.9.109.1.1.1.1.2. The value(!) coming out of the oid's are then used as last numeral in the OID for the CPU name.
The problem is that i have to re-use the value of a certain OID as the last numeral in a different OID to get the name of the CPU.
Anyone who can help me with this problem?

See the explanation from the Cisco discussion forum :
-Obtaining PhysicalIndex mapping
NMS% snmpwalk -v2c -c <community_name> <router's IP address> 1.3.6.1.4.1.9.9.109.1.1.1.1.2
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.2 = INTEGER: 52690955
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.2082 = INTEGER:35271015
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.2098 = INTEGER: 8695772

RP/0/RSP0/CPU0:ASR9000#sh platform
Node Type State Config State
----------------------------------------------------------------------------------------------------------
0/RSP0/CPU0 A9K-RSP-4G(Active) IOS XR RUN PWR,NSHUT,MON
0/0/CPU0 A9K-4T-E IOS XR RUN PWR,NSHUT,MON
0/1/CPU0 A9K-40GE-E IOS XR RUN PWR,NSHUT,MON


-Verifying which card should be used for polling

NMS% snmpwalk -v2c -c <community_name> <router's IP address> 1.3.6.1.2.1.47.1.1.1.1.7.52690955
SNMPv2-SMI::mib-2.47.1.1.1.1.7.52690955 = STRING: "module 0/RSP0/CPU0"

NMS% snmpwalk -v2c -c <community_name> <router's IP address> 1.3.6.1.2.1.47.1.1.1.1.7.35271015
SNMPv2-SMI::mib-2.47.1.1.1.1.7.35271015 = STRING: "module 0/0/CPU0"

NMS% snmpwalk -v2c -c <community_name> <router's IP address> 1.3.6.1.2.1.47.1.1.1.1.7.8695772
SNMPv2-SMI::mib-2.47.1.1.1.1.7.8695772 = STRING: "module 0/1/CPU0"

-Verifying CPU utilization for one minute (as an example)

NMS% snmpwalk -v2c -c <community_name> <router's IP address> 1.3.6.1.4.1.9.9.109.1.1.1.1.7.2

SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.7.2 = Gauge32: 3
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Creating XML snmp query for Cisco ASR9000

Post by gandalf »

I don't see any correlation between the CPU usage and the CPU card in question?
R.
havok1977
Posts: 49
Joined: Fri Apr 08, 2005 1:41 pm

Re: Creating XML snmp query for Cisco ASR9000

Post by havok1977 »

Thanks for pointing these out.

Can anyone confirm if these queries work with the standard Cisco CPU usage graph template using the LcCpuUsage parameter as the data source? I can't seem to get them to work, my graphs remain blank after a few poll cycles...

Image
toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Re: Creating XML snmp query for Cisco ASR9000

Post by toe_cutter »

Late reply and this might already be solved.

Im using Eric Halls Cisco CPU php-script that can be found here.
I might have made a couple adjustments, not sure which though.
But his script is lean and works fast, so its very good.
I'm using it for most of our Cisco equipment (asr1k, asr9k (9006/9001,) c3560, c3560x, c6500 (s720-10g, sup720-3b, sup2t-10g, incl vss-chassis), c7600 (sup720), and i think we've used it for c7200 and c3550xl. For the Nexus series we're using regular SNMP although i've had trouble with the n1kv, but that might be about how large the n1kv is (we're running ~850 hosts on one n1kv (vmware)).

My 2 cents :)
User avatar
NitrousOxyde
Posts: 20
Joined: Mon Sep 21, 2015 9:17 am
Location: Baku, Azerbaijan
Contact:

Re: Creating XML snmp query for Cisco ASR9000

Post by NitrousOxyde »

Hi gents,

I've made some host templates for ASR9001 and ASR9010, showing per LC/RSP memory and CPU utilization. Confirmed to be working fine. Note, that my ASR9010 has LCs in slots 0,1,2,4 and 5. If you have LCs in other slots, just modify OIDs in data sources to needed one.

Templates are exported from Cacti 8.8.b. If not working, please tell me, I'll export data and graph templates separately. Maybe I've exported template incorrectly :)
Attachments
cacti_host_template_cisco_asr9010.xml
ASR9010 host template
(425.08 KiB) Downloaded 576 times
cacti_host_template_cisco_asr9001.xml
ASR9001 host template
(327.36 KiB) Downloaded 392 times
CCIE R&S
JNCIS SP
JNCIS ENT
qy139
Posts: 1
Joined: Sun Mar 27, 2016 4:17 am

Re: Creating XML snmp query for Cisco ASR9000

Post by qy139 »

NitrousOxyde wrote:Hi gents,

I've made some host templates for ASR9001 and ASR9010, showing per LC/RSP memory and CPU utilization. Confirmed to be working fine. Note, that my ASR9010 has LCs in slots 0,1,2,4 and 5. If you have LCs in other slots, just modify OIDs in data sources to needed one.

Templates are exported from Cacti 8.8.b. If not working, please tell me, I'll export data and graph templates separately. Maybe I've exported template incorrectly :)
thx for u sharing, it's very useful. but there is still a little problem . my asr9010 has 7 cpu and 2 rsp cpu, but the template only can get 5 cpu and 2 rsp cpu .
how can i solve this ? thx again .

RP/0/RSP0/CPU0:ACR01-A9010-NF#sh processes cpu location ?
0/0/CPU0 Fully qualified location specification
0/1/CPU0 Fully qualified location specification
0/2/0 Fully qualified location specification
0/2/1 Fully qualified location specification
0/2/CPU0 Fully qualified location specification
0/4/CPU0 Fully qualified location specification
0/5/0 Fully qualified location specification
0/5/CPU0 Fully qualified location specification
0/6/CPU0 Fully qualified location specification
0/7/CPU0 Fully qualified location specification
0/RSP0/CPU0 Fully qualified location specification
0/RSP1/CPU0 Fully qualified location specification
WORD Fully qualified location specification
User avatar
NitrousOxyde
Posts: 20
Joined: Mon Sep 21, 2015 9:17 am
Location: Baku, Azerbaijan
Contact:

Re: Creating XML snmp query for Cisco ASR9000

Post by NitrousOxyde »

qy139 wrote:
NitrousOxyde wrote:Hi gents,

I've made some host templates for ASR9001 and ASR9010, showing per LC/RSP memory and CPU utilization. Confirmed to be working fine. Note, that my ASR9010 has LCs in slots 0,1,2,4 and 5. If you have LCs in other slots, just modify OIDs in data sources to needed one.

Templates are exported from Cacti 8.8.b. If not working, please tell me, I'll export data and graph templates separately. Maybe I've exported template incorrectly :)
thx for u sharing, it's very useful. but there is still a little problem . my asr9010 has 7 cpu and 2 rsp cpu, but the template only can get 5 cpu and 2 rsp cpu .
how can i solve this ? thx again .

RP/0/RSP0/CPU0:ACR01-A9010-NF#sh processes cpu location ?
0/0/CPU0 Fully qualified location specification
0/1/CPU0 Fully qualified location specification
0/2/0 Fully qualified location specification
0/2/1 Fully qualified location specification
0/2/CPU0 Fully qualified location specification
0/4/CPU0 Fully qualified location specification
0/5/0 Fully qualified location specification
0/5/CPU0 Fully qualified location specification
0/6/CPU0 Fully qualified location specification
0/7/CPU0 Fully qualified location specification
0/RSP0/CPU0 Fully qualified location specification
0/RSP1/CPU0 Fully qualified location specification
WORD Fully qualified location specification
Hi qy13,

It's very simple, just do following steps -

1 - Do an snmpwalk on your router with following OID - 1.3.6.1.4.1.9.9.109.1.1.1.1.2
This will give you list of your linecards, RSPs as below -

SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.66 = INTEGER: 38557239
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.82 = INTEGER: 56744940
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.2050 = INTEGER: 16203662
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.2066 = INTEGER: 29682305
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.2082 = INTEGER: 35271015
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.2146 = INTEGER: 48428731
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.2162 = INTEGER: 7571408

2 - To check board's real name, snmpwalk following OID - 1.3.6.1.2.1.47.1.1.1.1.7.xxxxxxxxx
Here, xxxxxx is value, which is returned while you query router in previous step. In my case, it is 38557239

SNMPv2-SMI::mib-2.47.1.1.1.1.7.38557239 = STRING: "module 0/RSP0/CPU0"

3 - After knowing mapping of LCs, RSPs to their OID values, you can just add new data templates(copy-paste existing one and change board ID) and then add these data template to already existing graph template

Hope this will do the job. If anything not clear, U'R welcome :)
CCIE R&S
JNCIS SP
JNCIS ENT
vossler19
Posts: 45
Joined: Thu Aug 03, 2017 2:27 pm

Re: Creating XML snmp query for Cisco ASR9000

Post by vossler19 »

trying to get this to work on a 9010 with two RSPs (0,1) and 3 Cpus --- I have removed the line cards that don't have a CPU in them, but still cannot seem to get a graph to show -- any ideas?
vossler19
Posts: 45
Joined: Thu Aug 03, 2017 2:27 pm

Re: Creating XML snmp query for Cisco ASR9000

Post by vossler19 »

Nvm, Figured it out!
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests