Cisco interface operational status monitor

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

Moderators: Developers, Moderators

Post Reply
Xof
Posts: 1
Joined: Tue Feb 27, 2007 1:41 pm

Post by Xof »

In fact, according to lib/snmp.php, it seems that cacti first tries to use the snmp module of php instead of snmp binaries provided by ucd snmp or net snmp.

So a solution is to prevent php to load the snmp extension module.

Code: Select all

On Fedora Core6, update /etc/php.d/snmp.ini:
replace 
   extension=snmp.so
by 
   ;extension=snmp.so
At least for net snmp there is one specific option which removes the symbolic labels from enumeration values (see man snmpcmd). I have cheched the lib/snmp.php script and snmpwalk is executed with this needed option.

Now graphes are created with correct values.
yeled
Posts: 6
Joined: Mon Mar 05, 2007 6:24 pm

Post by yeled »

i found that with net-snmp, the trick is to replace the regexp in lib/snmp.php

Code: Select all

define("REGEXP_SNMP_TRIM", "(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):");
with this

Code: Select all

define("REGEXP_SNMP_TRIM", "(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):|(up|down)\(|\)$");
Last edited by yeled on Mon Mar 05, 2007 6:57 pm, edited 1 time in total.
yeled
Posts: 6
Joined: Mon Mar 05, 2007 6:24 pm

Post by yeled »

i found that with net-snmp, the trick is to replace the regexp in lib/snmp.php

Code: Select all

define("REGEXP_SNMP_TRIM", "(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):");
with this
define("REGEXP_SNMP_TRIM", "(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):|(up|down)\(|\)$");
yeled
Posts: 6
Joined: Mon Mar 05, 2007 6:24 pm

Post by yeled »

i found that with net-snmp, the trick is to replace the regexp in lib/snmp.php

Code: Select all

define("REGEXP_SNMP_TRIM", "(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):");
with this

Code: Select all

define("REGEXP_SNMP_TRIM", "(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):|(up|down)\(|\)$");
crackrocksteady
Posts: 45
Joined: Wed Dec 06, 2006 12:02 am
Location: Perth , Australia

Post by crackrocksteady »

This worked for me,

Thanks Yeled.
smartech1
Posts: 38
Joined: Mon Feb 05, 2007 8:03 am
Contact:

I dont see " Interface-status" template in Graph t

Post by smartech1 »

Hi,

I configured as mentioned above after importing the templates.but I don't find "Interface status" template in Graph template drop down box. Instead i see only "interface-traffic" for the respective interface.

This is what debug says. FInd the attached screen shot.

Please suggest me further.

RRDTool Command:

/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Ganesha_Router - Interface Status" \
--rigid \
--base=1000 \
--height=50 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="status" \
--slope-mode \
AREA:#FFC73B:"Current status\:" \
GPRINT::LAST:"%8.2lf%s\n" \
COMMENT:"(1 = Up | 2 = Down)\n"

RRDTool Says:

ERROR: parameter '#FFC73B' does not represent a number in line AREA:#FFC73B:Current status\:
:cry:
Attachments
Unable to take dropdown open Printscreen shot,but it doesn't shows interface-status template here.
Unable to take dropdown open Printscreen shot,but it doesn't shows interface-status template here.
Screenshot.jpg (77.91 KiB) Viewed 14097 times
bengelly
Cacti User
Posts: 57
Joined: Fri Jan 26, 2007 2:28 am

Post by bengelly »

Hi flipflap,

I am using your template to monitor my APs and it's veru useful...

I found out yesterday that the OID your are using could also be used to monitor the status of any interface (for example the status of an ethernet port on a switch...)... could you be kind enough to modify your template in order to do this ?

Thanks a lot !!!
Gangstamc
Posts: 1
Joined: Fri Mar 16, 2007 12:00 pm

Post by Gangstamc »

OK I am wondering is it possible to integrate this with my traffic flow graph. I would like to have it so that the graph is shaded when the interface is up and graphs the input and output flow rate and then leaves a blank spot on the graph to show when the interface is down.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

I've been trying to get this working for a weathermap today. I have modified the interface.xml so that opStatus is an output, added the VALUE/REGEXP suggested here, modified lib/snmp.php as suggested by yeled, disabled the php-snmp module, and still I get a 'U' rather than a real result. snmpwalk shows the normal "up(1)" result.

I have a graph template and data template that seem to work OK, and new data sources are created, and polled, as expected. I just don't get useful data out of interface.xml... is there anything else to check? The DEBUG mode log lines just say:

Code: Select all

03/19/2007 03:20:08 PM - CACTID: Poller[0] Host[156] DS[2693] WARNING: Result from SNMP not valid. Partial Result: ...
03/19/2007 03:20:08 PM - CACTID: Poller[0] Host[156] DS[2693] SNMP: v2: 10.225.6.12, dsname: op_status, oid: .1.3.6.1.2.1.2.2.1.8.10101, value: U
03/19/2007 03:20:08 PM - CACTID: Poller[0] Host[156] DS[2694] WARNING: Result from SNMP not valid. Partial Result: ...
03/19/2007 03:20:08 PM - CACTID: Poller[0] Host[156] DS[2694] SNMP: v2: 10.225.6.12, dsname: op_status, oid: .1.3.6.1.2.1.2.2.1.8.10115, value: U
It's a Cisco 3650G, in case it's relevant, and:
Cacti Version - 0.8.6j
Plugin Architecture - 1.1
Poller Type - Cactid v0.8.6i
Server Info - FreeBSD 6.2-RELEASE
Web Server - Apache/2.0.59 (FreeBSD) PHP/5.2.1 with Suhosin-Patch
PHP - 5.2.1
PHP Extensions - session, Reflection, date, libxml, apache2handler, pdf, zlib, bz2, mcrypt, mbstring, xml, pcre, standard, openssl, mysql, gd, ctype
MySQL - 5.0.33-log
RRDTool - 1.2.19
SNMP - 5.3.1
Plugins
  • PHP Network Weathermap (weathermap - v0.9pre1)
    Update Checker (update - v0.3)
    Poller Performance Report (pollperf - v0.2)
    Host Info (hostinfo - v0.1)
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Translating up(1) to 1 would require the snmpcmd option -e. But cacti does not set this option, AFAIK. You may try to change the code. Next approach would be to use a Script Data Query; but for only translating a single item, this semms a big overkill to me.
Reinhard
schouaib
Posts: 4
Joined: Fri Jan 12, 2007 11:44 am

Post by schouaib »

are you using CMD ou cactid for polling, when I changed the poller to use CMD, it works fine. I think that it's a problem with cactid (I use cactid 0.8.6g)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

schouaib wrote:are you using CMD ou cactid for polling, when I changed the poller to use CMD, it works fine. I think that it's a problem with cactid (I use cactid 0.8.6g)
I use cactid 0.8.6h (I think), but cmd.php isn't really an option for me...
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
neovox
Cacti User
Posts: 52
Joined: Tue Jan 02, 2007 8:22 am
Location: MI

Post by neovox »

Has any one been successful using this with cactid as opposed to with cmd.php?

Like some of the folks previous, I have made the changes indicated in the post but still get a result of 'U' instead of '1' when using cactid, which the system doesn't seem to be able to interpret. It does however work using the cmd.php poller.

I'm currently running Cacti 0.8.6i. I monitor mostly interface traffic on only 8 hosts, however one host, a Cisco 7613, has quite a few interfaces, so I end up with about 1700 DataSources and 861 RDDs. Poller time is usually between 70 & 100. I personally don't have a poller preference, but I was under the understanding that cactid is more efficient.

That said, Is there anyone successfully using this template with cactid? If not, is there any reason for me not to move to using cmd.php instead of cactid simply to address the issues I'm having with this template?

Thanks,

M
fernandakp
Posts: 27
Joined: Thu Jun 21, 2007 9:30 am

the third template doesnt work

Post by fernandakp »

Hi.
I tried to import the tree templates. The two fisrt ones was OK, but the third one doesnt work out... when i tried to import this error appears:
Error: XML parse error.

Is this third template important to the correct function of this feature? Or it just update the interface.xml with the string "output" in the ifOperStatus tag ??
djoki
Posts: 26
Joined: Wed Aug 15, 2007 4:13 pm

Post by djoki »

hello,

cacti_data_query_snmp_interface_statistics.xml must be in snmp_queries directory ?

thx
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests