Cisco interface operational status monitor

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

Moderators: Moderators, Developers

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

#31 Post by Xof » Tue Feb 27, 2007 1:55 pm

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

#32 Post by yeled » Mon Mar 05, 2007 6:51 pm

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

#33 Post by yeled » Mon Mar 05, 2007 6:52 pm

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

#34 Post by yeled » Mon Mar 05, 2007 6:53 pm

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

#35 Post by crackrocksteady » Wed Mar 07, 2007 10:56 pm

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

#36 Post by smartech1 » Thu Mar 08, 2007 8:26 am

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
Screenshot.jpg
Unable to take dropdown open Printscreen shot,but it doesn't shows interface-status template here.
Screenshot.jpg (77.91 KiB) Viewed 12688 times

bengelly
Cacti User
Posts: 57
Joined: Fri Jan 26, 2007 2:28 am

#37 Post by bengelly » Thu Mar 15, 2007 2:49 am

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

#38 Post by Gangstamc » Mon Mar 19, 2007 11:56 am

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: 5330
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

#39 Post by Howie » Mon Mar 19, 2007 2:45 pm

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.98 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: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#40 Post by gandalf » Tue Mar 20, 2007 12:44 pm

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

#41 Post by schouaib » Sat Mar 24, 2007 7:57 am

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: 5330
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

#42 Post by Howie » Sat Mar 24, 2007 9:36 am

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.98 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

#43 Post by neovox » Wed Jun 06, 2007 12:37 pm

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

#44 Post by fernandakp » Thu Jun 28, 2007 8:48 am

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

#45 Post by djoki » Fri Aug 17, 2007 3:17 pm

hello,

cacti_data_query_snmp_interface_statistics.xml must be in snmp_queries directory ?

thx

Post Reply