Script for Cisco Switch/Router CPU Utilization

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
Joseph

Script for Cisco Switch/Router CPU Utilization

Post by Joseph »

Running RH7.3 Cacti,

Anyone have a script that can pull CPU Usage, Memory, etc type stats from a cisco router/switch - other then just port usage stats ?

Thank you

Joseph
cne5@excite.com
dbenders
Posts: 28
Joined: Mon Oct 14, 2002 2:02 pm
Location: Santiago, CHILE

CPU for a Cisco

Post by dbenders »

Depending on the Cisco you have, the OID will be different.

For a CISCO 2600 and 3600 to get the CPU:

You can use OID: .1.3.6.1.4.1.9.2.1.58.0

In cacti you can use the script that came with it "Get SNMP Data" so you will not need to creat e a new script.

If you have more OID, will be great if you share them with us in this forums.
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

You can find some interesting OIDs (not only cisco) here:
http://www.ansdell.demon.co.uk/networks/monitor.html

- bulek
rapter
Posts: 1
Joined: Wed Nov 13, 2002 11:07 pm
Location: Texas

Post by rapter »

I am sorry to bother - but I am new to scripts/cdef/snmp/oid etc, how do I start ?

> For a CISCO 2600 and 3600 to get the CPU: <--yes I have

> You can use OID: .1.3.6.1.4.1.9.2.1.58.0 <-- ok wut I do ?

>In cacti you can use the script that came with it "Get SNMP Data" so you >will not need to creat e a new script. <-- dont understand

**is there a step by step on how to do this to get this into a graph ? Please anyone
dbenders
Posts: 28
Joined: Mon Oct 14, 2002 2:02 pm
Location: Santiago, CHILE

Here is how to do it:

Post by dbenders »

1.- Go to "Data Gathering" and select "Data Sources"
2.- Press the "Add" option.
3.- In the "Name:" field put "router1_cpu"
4.- In the "Data Source Type:" field select "GAUGE"
5.- In the "Data Input Type:" field select "Get SNMP Data"
6.- In the "Associated RRA's:" field select all.
7.- In the "Heartbeat:" field put "600"
8.- In the "Step:" field put "300"
9.- In the "Minumum Value:" field put "0"
10.- In the "Maximum Value:" field put "100"
11.- Make "Update .rrd File" checkbox Checked
12.- Make "Active" checkbox Checked
13.- Then Press Save.
14.- In the list of DS select "Edit Data" in the "Get SNMP Data" that is in the right of the "router1_cpu" you already created.
15.- Fill there the IP and the SNMP community.

This will start to get the data every 5 minutes.

The next step it to build the graph.

Hope this help you.
Guest

Post by Guest »

Thank you !

ok, I did as described, do I use the OID as well ?

I checked the /var/www/html/cacti-0.6.8a/rra/router1_cpu.rrd is there, but I can not locate it in : graphs or graphs hierarchy in the console.

what would the next step be to graph/ put into graph ?
dbenders
Posts: 28
Joined: Mon Oct 14, 2002 2:02 pm
Location: Santiago, CHILE

Answer

Post by dbenders »

You MUST to create the graph in the graph menu and then add it to the graph hierarchie as well.
Guest

Post by Guest »

Thank you, I did create a graph but there is no data appearing in the graph.

-------------------------------- this is the code in router1_cpu ------------
/usr/bin/rrdtool create \
/var/www/html/cacti-0.6.8a/rra/router1_cpu.rrd \
--step 300 \
DS:router1_cpu:GAUGE:600:0:100 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \

I also used the OID of "1.3.6.1.4.1.9.2.1.57" do I need the prepending . ? -or is there anyway to check the rrd to make sure it is collecting data ?
Joseph

Post by Joseph »

:|

Minor user error on this one.....

I was able to get it to graph, just needed to create the (area).

Another Quick Question:
Is there someway to get protocol data to a graph ie: http/ftp/smtp etc



Sources for MIB/OID info:
http://www.cisco.com/cgi-bin/Support/Mi ... r/unity.pl <--req.login
http://www.mibdepot.com/
http://www.alvestrand.no/objectid/top.html
http://jaguar.ir.miami.edu/~marcus/snmptrans_help.html <--very usefull
guest

cisco OID/MIB ?

Post by guest »

How do you pull stats CPU/MEM/TEMP from a Cisco 6509 Switch ? can I get netflow data from this or ipaccounting data ? do I need an OID if so what would it be for this data ?

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests