ADVANCED Cisco CPU Utilization Template

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

Moderators: Developers, Moderators

mjc
Cacti User
Posts: 53
Joined: Thu May 12, 2005 7:26 pm

ADVANCED Cisco CPU Utilization Template

Post by mjc »

hi all,

i love cacti and this is no bad word to the guys at cacti they have done a bloody fabulous job, however when i was using the cisco cpu templates i simply was not quite happy with it.

one fundamental issue i found is that because it doesnt graph 5 second utilisation your momentary spikes are not represented in the graph.

this means the impact of things like the bgp scanner spiking the router to 50% are not actually represented in the default cacti cisco cpu template.

here is an example of my graphs, this is a edge router providing ethernet services, nothing special.

Image

now lets look at a bgp router holding a number of tables to a number of peers, you can see the 5 second spikes in comparison to the 1 and 5 minute utilisation. this granularity gives us much better visibility of momentary loads.

Image

like what you see?

download the xml template


--matt
Ciscocow
Posts: 5
Joined: Wed Nov 30, 2005 11:20 am

Post by Ciscocow »

i tried to import the xml file but it does not seem to want to work
mjc
Cacti User
Posts: 53
Joined: Thu May 12, 2005 7:26 pm

Post by mjc »

Ciscocow wrote:i tried to import the xml file but it does not seem to want to work
what version of cacti? i had some problems with importing templates which i think was linked to poor escaping by cacti which is due to be fixed in 0.8.6h.

i will try re-exporting the graph template with dependancies if you want to try again?

--matt
Lojak
Posts: 14
Joined: Thu Sep 30, 2004 10:38 pm

Post by Lojak »

Has this been updated to 0.8.6h?
mjc
Cacti User
Posts: 53
Joined: Thu May 12, 2005 7:26 pm

Post by mjc »

Lojak wrote:Has this been updated to 0.8.6h?
seems to work just fine for me..

# uname -a
Linux monitor02 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005 i686 i686 i386 GNU/Linux

# cat /etc/redhat-release
Red Hat Enterprise Linux ES release 4 (Nahant)

# rpm -qa | grep -i cact
cacti-0.8.6h-1
cacti-cactid-0.8.6e-1
redcap
Posts: 18
Joined: Mon Jan 23, 2006 5:49 am

Post by redcap »

Hi,

No problems importating templates, and graphs are created.
Only: it doesn't seem to measure correctly: everything stays at value "0"

I checked with rrdtool: rrds are generated every 5 minutes, but seems to contain no valueable data:

See attached rrdtool dump output

It seems the rrd files are not generated correctly.
On the other hand, when doing an snmpwalk on an OID I found in the xml file, I get a value back

Code: Select all

server:/usr/share/cacti/site/rra# snmpwalk -v 2c -c kiekeboe cisco .1.3.6.1.4.1.9.2.1.56.0
SNMPv2-SMI::enterprises.9.2.1.56.0 = INTEGER: 9
server:/usr/share/cacti/site/rra# snmpwalk -v 2c -c kiekeboe cisco .1.3.6.1.4.1.9.2.1.56.0
SNMPv2-SMI::enterprises.9.2.1.56.0 = INTEGER: 10
server:/usr/share/cacti/site/rra# snmpwalk -v 2c -c kiekeboe cisco .1.3.6.1.4.1.9.2.1.56.0
SNMPv2-SMI::enterprises.9.2.1.56.0 = INTEGER: 9
fyi: already deleted and reenterd any references to cpu templates, data-sources,...

Any ideas?
Thanks
Steven
Attachments
cisco_1min_cpu_119.rrd.zip
(79.76 KiB) Downloaded 1705 times
redcap
Posts: 18
Joined: Mon Jan 23, 2006 5:49 am

Post by redcap »

Fixed it.
For some reason the snmd oid values were not entered in the database.
I mannually entered them via phpmyadmin.
for example for the 5min cpu:

Code: Select all

UPDATE `poller_item` SET `arg1` = '.1.3.6.1.4.1.9.2.1.58.0' WHERE `local_data_id` =120 AND CONVERT( `rrd_name` USING utf8 ) = '5min_cpu' LIMIT 1 ;
Don't know if this is an error of me, or an error in the template.
Anyway, I just imported the template as instructed.
fyi: using cacti 0.8.6h
zeroy
Posts: 25
Joined: Wed Jan 25, 2006 8:27 am

Post by zeroy »

using cacti 0.8.6h, import graph template OK but no graph displayed.

WORKS NOW - Thanks m8!
¬¬ZeRoY¬¬
mjc
Cacti User
Posts: 53
Joined: Thu May 12, 2005 7:26 pm

Post by mjc »

redcap wrote:Fixed it.
For some reason the snmd oid values were not entered in the database.
I mannually entered them via phpmyadmin.
for example for the 5min cpu:

Code: Select all

UPDATE `poller_item` SET `arg1` = '.1.3.6.1.4.1.9.2.1.58.0' WHERE `local_data_id` =120 AND CONVERT( `rrd_name` USING utf8 ) = '5min_cpu' LIMIT 1 ;
Don't know if this is an error of me, or an error in the template.
Anyway, I just imported the template as instructed.
fyi: using cacti 0.8.6h
hmm thats wierd.. ill try importing the template onto a fresh system with a clean db and see what happens..
duckeo
Posts: 9
Joined: Thu Feb 16, 2006 8:58 pm

Post by duckeo »

I found a similar issue with this template and the advanced proc memory templates.

The OID's aren't being inserted into mysql properly.

I found I had to match up the database ids and data_input_fields and then insert the OID myself. It may be a mysql permissions problem or other bug with cacti.

I'll keep an eye out for other issues I see importing templates.
duckeo
Posts: 9
Joined: Thu Feb 16, 2006 8:58 pm

Post by duckeo »

I'm finding either bugs in the template or bugs in Cacti's template engine which prevents the OIDs being inserted to the data_input_data table.

Through some troubleshooting the missing statements I had to manually add are:

Code: Select all

INSERT into data_input_data SET t_value="",value=".1.3.6.1.4.1.9.2.1.56.0", data_template_data_id="70", data_input_field_id="6";
INSERT into data_input_data SET t_value="",value="", data_template_data_id="70", data_input_field_id="5";
INSERT into data_input_data SET t_value="",value="", data_template_data_id="70", data_input_field_id="4";
INSERT into data_input_data SET t_value="",value="", data_template_data_id="70", data_input_field_id="3";
INSERT into data_input_data SET t_value="",value="", data_template_data_id="70", data_input_field_id="2";
INSERT into data_input_data SET t_value="",value="", data_template_data_id="70", data_input_field_id="1";


INSERT into data_input_data SET t_value="",value=".1.3.6.1.4.1.9.2.1.57.0", data_template_data_id="71", data_input_field_id="6";
INSERT into  data_input_data SET t_value="",value="", data_template_data_id="71",  data_input_field_id="5";
INSERT into  data_input_data SET t_value="",value="", data_template_data_id="71",  data_input_field_id="4";
INSERT into  data_input_data SET t_value="",value="", data_template_data_id="71",  data_input_field_id="3";
INSERT into  data_input_data SET t_value="",value="", data_template_data_id="71",  data_input_field_id="2";
INSERT into  data_input_data SET t_value="",value="", data_template_data_id="71",  data_input_field_id="1";
This seems to happen because cacti wants to 'UPDATE" where data_input_id="71" but no rows exist with "71", so the update completes successfully with no rows modified.

This is a temporary fix until I can either report a bug or figure out what's really going on :)

Hope that helps, I'll be adding a similar post to the PROC MEM template.
abertram
Posts: 1
Joined: Tue Aug 28, 2007 2:40 pm

Post by abertram »

Where do you make this change at? I imported the template and am getting no data graphing.
krap_rz
Posts: 26
Joined: Thu May 18, 2006 5:23 am
Location: Cyberjaya, Malaysia
Contact:

Post by krap_rz »

FYI, after reading some cisco mib and thorogh checking in the thread (Thanks to mjc!!!) i have manage to create templates for Cisco Cpu utilization, and it seems to be working in order.

merely the same with mjc's template, but using snmp OID#. When check, the numbers are same if we run cisco cli "show process cpu"

The std, Cisco CPU template most likely not correct. This probably due to IOS update to version 12. (Mine is applied for v12.4) And the graph works like a charm on 2800, 3800, 7200vxr routers. I think it will work also on 1800 series.
Attachments
cacti_graph_template_cisco_cpu_utilization_5sec_1min_5min.xml
cacti cisco cpu utilization template
(19.83 KiB) Downloaded 3851 times
my cpu image
my cpu image
cpu image.png (41.18 KiB) Viewed 36482 times
KeyBoarD Is MightieR ThaN ThE sWorD, iF onLy ConNecTed tO tHe InTernET..
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Post by niobe »

Hmm, wouldn't one need to change the poller cron job to every 5 seconds for this to be accurate? Otherwise you are polling a 5 second stat every minute.
artagel
Cacti User
Posts: 226
Joined: Wed May 21, 2008 11:33 pm

Post by artagel »

I know this is a late reply, but anyways..
Cisco routers provide a 5 second 1 min and 5 min load. This doesn't mean you are going to get a plot every 5 seconds for the 5 second load. But you are going to the max in the last 5 seconds of the query, and the max for the last minute and the last 5 minutes.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests