Cisco interface operational status monitor

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

Moderators: Moderators, Developers

Post Reply
Author
Message
User avatar
willieb
Cacti User
Posts: 160
Joined: Thu Jan 22, 2009 10:09 am
Location: South GA

Re: Cisco interface operational status monitor

#91 Post by willieb » Wed Aug 03, 2011 9:06 am

I installed this template and it works great.

One thing to note is that I figured out you can create 1 baseline threshold template to apply to all interface status monitors. I based it on 2 hours. What this does is alert upon an up or down change. Then within 2 hours it restores and uses the new value as the base.

For example I set the template to baseline with a deviation up and down of 25%. So when the interface is up (1) and changes to down (2), it alerts because the new value is above 1.25. Then after the average for 2 hours goes above 1.25, the alert will be restored. Then after 2 hours the new threshold for down is 1.5. So when the status changes back to up (1), you will be alerted again. Then once again it will reset itself after 2 hours. I love it!
-willieb

User avatar
willieb
Cacti User
Posts: 160
Joined: Thu Jan 22, 2009 10:09 am
Location: South GA

Re: Cisco interface operational status monitor

#92 Post by willieb » Tue Oct 11, 2011 6:02 pm

Question: What is status of "0" mean? Does anyone know? I had to disable interface alerts because occasionally some of my switches, all interfaces will randomly go to "0" which cacti alerts me on. It gets pretty irritating dealing with all the false alerts. I only want it to alert if it goes to "1" or "2". So typically an interface should be a 1 (up) or a 2 (down). so if a 2 goes to 1 or a 1 goes to 2, then I want to know.

Is there a better way to alert on interface status without alerting on a "0" status. Thanks.
-willieb

sukanta
Cacti User
Posts: 139
Joined: Tue Jan 26, 2010 6:12 am

Re: Cisco interface operational status monitor

#93 Post by sukanta » Sat Oct 29, 2011 10:43 am

After Upgrading to Cacti 0.8.7h .. Facing intermittent link down status in graph although in router CLI there is no such log.It is happening only for one polling. Next polling again normal.


Anybody else facing the issue??

User avatar
willieb
Cacti User
Posts: 160
Joined: Thu Jan 22, 2009 10:09 am
Location: South GA

Re: Cisco interface operational status monitor

#94 Post by willieb » Sat Oct 29, 2011 11:26 am

I am still on "g" release. I think an snmp response of 0 is legit as I get it from several different vendor switches (including Cisco). I don't know what 0 means nor do I want to alert on it. I only want to know if an interface goes from up (1) to down (2) or down (2) to up (1).

The way I have mine setup now is all intefaces above 1.5 is breached so all downed interfaces are active breached thresholds. This works great until it gets a response of 0 and alerts for no actual status change.

I even have tried setting minimum trigger duration to 10 minutes (2 queries) to no avail. Funny thing is also, on the graph it never shows a drop to 0...??

Any ideas how I can setup thresholds to only alert from 1 to 2 or 2 to 1 change? Thanks in advance.
-willieb

sukanta
Cacti User
Posts: 139
Joined: Tue Jan 26, 2010 6:12 am

Re: Cisco interface operational status monitor

#95 Post by sukanta » Sat Oct 29, 2011 1:30 pm

willieb wrote:I am still on "g" release. I think an snmp response of 0 is legit as I get it from several different vendor switches (including Cisco). I don't know what 0 means nor do I want to alert on it. I only want to know if an interface goes from up (1) to down (2) or down (2) to up (1).

The way I have mine setup now is all intefaces above 1.5 is breached so all downed interfaces are active breached thresholds. This works great until it gets a response of 0 and alerts for no actual status change.

I even have tried setting minimum trigger duration to 10 minutes (2 queries) to no avail. Funny thing is also, on the graph it never shows a drop to 0...??

Any ideas how I can setup thresholds to only alert from 1 to 2 or 2 to 1 change? Thanks in advance.
For me it is simple:

High Threshold 1 with exact value, in normal condition it will be 1 only.0 will come when there is no response from that device/port.It happened when the card gone faulty.

0=No Response
1=up
2=Down
3=Loop

Also you can set low threshold as .1

User avatar
willieb
Cacti User
Posts: 160
Joined: Thu Jan 22, 2009 10:09 am
Location: South GA

Re: Cisco interface operational status monitor

#96 Post by willieb » Sat Oct 29, 2011 2:15 pm

sukanta wrote:
willieb wrote:I am still on "g" release. I think an snmp response of 0 is legit as I get it from several different vendor switches (including Cisco). I don't know what 0 means nor do I want to alert on it. I only want to know if an interface goes from up (1) to down (2) or down (2) to up (1).

The way I have mine setup now is all intefaces above 1.5 is breached so all downed interfaces are active breached thresholds. This works great until it gets a response of 0 and alerts for no actual status change.

I even have tried setting minimum trigger duration to 10 minutes (2 queries) to no avail. Funny thing is also, on the graph it never shows a drop to 0...??

Any ideas how I can setup thresholds to only alert from 1 to 2 or 2 to 1 change? Thanks in advance.
For me it is simple:

High Threshold 1 with exact value, in normal condition it will be 1 only.0 will come when there is no response from that device/port.It happened when the card gone faulty.

0=No Response
1=up
2=Down
3=Loop

Also you can set low threshold as .1
I guess it's not so easy with what I am trying to accomplish.

With no low threshold set, and a high threshold set to exactly 1, then downed ports that come up (from 2 to 1) will not alert.

I have mine set to 1.5 for the high threshold. It works great alerting me from 1's to 2's and 2's to 1's. But there are times when I guess there's no response from the ports therefore the switch returns a "0" for all ports. This means I get alerted on 2 to 0 status changes when the downed ports never changed status, if that makes sense.

I don't think it means a card or switch is bad, but I can surely understand a no response from the port maybe. My reasoning for this is that I have many switches that all of a sudden return 0's for all ports so I am alerted for all downed ports saying they came up, when indeed they didn't.

I have disabled int stat alerts for now until I can find a better solution.

Long story short, I want to be alerted from a 2 to 1 but not a 2 to 0 change.
-willieb

madsn
Cacti User
Posts: 50
Joined: Tue Oct 13, 2009 6:26 am

Re: Cisco interface operational status monitor

#97 Post by madsn » Fri Nov 25, 2011 10:28 am

Just recently made a new installation of cacti with Cacti 0.8.7h and the new PIA 3.0. As always I downloaded the templates in this post and made the modification to /lib/snmp.php replacing:

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)\(|\)$");
Which is described earlier in this post, but ater I did this my polling failed all the time. After some investigation I noticed that there has been made a small change in Cacti 0.8.7h so that the string you have to replace looks like this:

Code: Select all

define("REGEXP_SNMP_TRIM", "/(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):/i");
and the string you have to replace it with looks like this:

Code: Select all

define("REGEXP_SNMP_TRIM", "/(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):|(up|down)\(|\)$/i");
Just if anyone runs into the same problem as I did.

CCNAJ
Posts: 30
Joined: Fri Apr 15, 2011 7:13 am
Location: Australia

Re: Cisco interface operational status monitor

#98 Post by CCNAJ » Wed Dec 28, 2011 11:58 pm

Hey All,

Thanks to all who have gone before and made it work.
I like this template but one thing annoys me.... if up = 1 is up then down should = -1. This way the graph can show almost like a gauge.

I tried to do this by using a CDEF but I am just too new to understand where and if this is possible...
My logic is - IF Result = up then return 1, IF result = down then return -1
Still a little confused after reading this : http://oss.oetiker.ch/rrdtool/tut/cdeftutorial.en.html
CDEF:result=value,UN,0,value,IF

My best guess is : CDEF:result=1,UN,0,-1,IF
But NFI if that is correct.......help..... :)
++++++ Cacti Newbie ++++++++++++++++++++++++++++++++++++++++++
Cacti 0.8.8f with PIA on a Centos6 VM
Plugins Used: Infopage | RouterConfigs | Spikekill | BOOST | REALTIME | CLOG

micronemo
Posts: 6
Joined: Wed Nov 14, 2012 9:36 am

Re: Cisco interface operational status monitor

#99 Post by micronemo » Thu Nov 15, 2012 5:30 am

hello
i am a new cati user
i test any possible solution but don't work
someone can help me ?
thanks very very much

micronemo
Posts: 6
Joined: Wed Nov 14, 2012 9:36 am

Re: Cisco interface operational status monitor

#100 Post by micronemo » Wed Sep 04, 2013 2:33 pm

I have centos 6.3, cacti-0.8.8b

I do:
1. Import Template from Local File cacti_data_query_snmp_interface_statistics_730.xml, cacti_data_template_interface_status_190.xml, cacti_graph_template_interface_status_679.xml

2. Make changes in file interface.xml
[[email protected] snmp_queries]# cat interface.xml
......................
<ifOperStatus>
<name>Status</name>
<method>walk</method>
<source>VALUE/REGEXP:[a-zA-Z]{1,}\(([1-]{1})+\)$</source>
<direction>output</direction>
<oid>.1.3.6.1.2.1.2.2.1.8</oid>
</ifOperStatus>
......................

3. Make changes as said yeled in /var/www/html/cacti/lib/snmp.php
define("REGEXP_SNMP_TRIM", "(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):|(up|down)\(|\)$");

Results:
1. No error mesages
2. I see graph of status interface in tree view mode


Why I can't see the status of interface in preview mode ?

User avatar
proohu01
Posts: 45
Joined: Mon Dec 20, 2004 3:13 am
Location: The Netherlands

Re: Cisco interface operational status monitor

#101 Post by proohu01 » Tue Nov 05, 2013 4:20 am

I have CentOS 6.4, cacti-0.8.8b

I only changed the lib/snmp.php to look like this:

Code: Select all

define("REGEXP_SNMP_TRIM", "/(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):|(up|down|dormant|testing|notpresent)\(|\)$/i");
Note that I also included dormant;testing and notpresent. We use the status "dormant" to see if a router is using the celular interface or not. If it is, the status becomes 5, THOLD gives us a warning. See Cisco page: http://tools.cisco.com/Support/SNMP/do/ ... .1.2.2.1.8

Make sure to change the comment field in the graph template "Interface - Status" to read "(1=Up | 2=Down | 3=Testing | 4=Unknown | 5=Dormant | 6=notPresent)"

The graph works perfect. Also in preview mode.
Cacti Version - 0.8.8b
CentOS 6.4

User avatar
JorisFRST
Cacti User
Posts: 212
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Re: Cisco interface operational status monitor

#102 Post by JorisFRST » Fri Jan 24, 2014 8:48 am

madsn wrote:Just recently made a new installation of cacti with Cacti 0.8.7h and the new PIA 3.0. As always I downloaded the templates in this post and made the modification to /lib/snmp.php replacing:

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)\(|\)$");
Which is described earlier in this post, but ater I did this my polling failed all the time. After some investigation I noticed that there has been made a small change in Cacti 0.8.7h so that the string you have to replace looks like this:

Code: Select all

define("REGEXP_SNMP_TRIM", "/(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):/i");
and the string you have to replace it with looks like this:

Code: Select all

define("REGEXP_SNMP_TRIM", "/(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):|(up|down)\(|\)$/i");
Just if anyone runs into the same problem as I did.
Thank you very much, just did a new 0.8.8b install and the old fix gave the same errors as you described.
New fix works very well.
Joris.
http://www.routerjanitor.com

zygemini
Posts: 13
Joined: Fri Apr 04, 2014 2:41 am

Re: One more strange trouble

#103 Post by zygemini » Fri Jul 25, 2014 3:33 am

maxxic wrote:I have FedoreCore 6, cacti-0.8.6j

I do:
1. Import Template from Local File cacti_data_query_snmp_interface_statistics_730.xml, cacti_data_template_interface_status_190.xml, cacti_graph_template_interface_status_679.xml

2. Make changes in file interface.xml
[[email protected] snmp_queries]# cat interface.xml
......................
<ifOperStatus>
<name>Status</name>
<method>walk</method>
<source>VALUE/REGEXP:[a-zA-Z]{1,}\(([1-]{1})+\)$</source>
<direction>output</direction>
<oid>.1.3.6.1.2.1.2.2.1.8</oid>
</ifOperStatus>
......................

3. Make changes as said yeled in /var/www/html/cacti/lib/snmp.php
define("REGEXP_SNMP_TRIM", "(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):|(up|down)\(|\)$");

Results:
1. No error mesages
2. I don't see graph of status interface
3. But if I click in place where graf is must be - I SEE it!

Why I can't see the status of interface in tree view mode?

Pleease, help! :'-(

I am on cacti 0.8.8b,and i have done the modification as above, as i have the "output: U" error. But once i change the define("REGEXP_SNMP_TRIM", "(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):|(up|down)\(|\)$");
, i got the " Host did not respond to SNMP" error.

I found that in my file , it is written originally
define("REGEXP_SNMP_TRIM", "/(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):/i");
not exactly as you mentioned. So what should i do to modify this line?

User avatar
JorisFRST
Cacti User
Posts: 212
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Re: Cisco interface operational status monitor

#104 Post by JorisFRST » Fri Jul 25, 2014 4:03 am

My install is using this line :

define("REGEXP_SNMP_TRIM", "/(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):|(up|down)\(|\)$/i");
Joris.
http://www.routerjanitor.com

zygemini
Posts: 13
Joined: Fri Apr 04, 2014 2:41 am

Re: Cisco interface operational status monitor

#105 Post by zygemini » Fri Jul 25, 2014 4:09 am

madsn wrote:Just recently made a new installation of cacti with Cacti 0.8.7h and the new PIA 3.0. As always I downloaded the templates in this post and made the modification to /lib/snmp.php replacing:

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)\(|\)$");
Which is described earlier in this post, but ater I did this my polling failed all the time. After some investigation I noticed that there has been made a small change in Cacti 0.8.7h so that the string you have to replace looks like this:

Code: Select all

define("REGEXP_SNMP_TRIM", "/(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):/i");
and the string you have to replace it with looks like this:

Code: Select all

define("REGEXP_SNMP_TRIM", "/(hex|counter(32|64)|gauge|gauge(32|64)|float|ipaddress|string|integer):|(up|down)\(|\)$/i");
Just if anyone runs into the same problem as I did.
Thank you very much , it fixed my issue too.

Post Reply