check ifOperStatus when gathering interfaces

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
signal15

check ifOperStatus when gathering interfaces

Post by signal15 »

Cacti should not gather interfaces that are administratively shutdown, as if you try to graph them, a counter with an index for that interface may not exist.

Plus, when gathering interfaces on devices that have hundreds of them, it sucks having to go through and see which ones are actually being used before making graphs for them.
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

This is quite easy to do. In include/snmp_functions.php add the following line before line 123:

Code: Select all

if(cacti_snmp_get($hostname, $community, ".1.3.6.1.2.1.2.2.1.7.$interface_number", "", "") != "up(1)") continue;
I don't have a chance to check if it works right now. If there are problems plase indicate them.

Actually I think cacti should collect all interfaces (even with administratively down). They should be marked as down and should be skipped later when using "Make all graphs" operation. Default cacti is prepared for this because it has unused "AdminStatus" field in internal DB.

- bulek
nsanders
Posts: 21
Joined: Thu Oct 19, 2006 2:01 pm

Post by nsanders »

There is no snmp_functions.php in my Cacti 0.8.6h, is this data relevant any more? I would like to be able to not produce graphs for "down" interfaces. My 196 port switch produces a lot of wasted graphs.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

This is not a suggested action, as it is to specific.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

Re: check ifOperStatus when gathering interfaces

Post by egarnel »

signal15 wrote:Cacti should not gather interfaces that are administratively shutdown, as if you try to graph them, a counter with an index for that interface may not exist.

Plus, when gathering interfaces on devices that have hundreds of them, it sucks having to go through and see which ones are actually being used before making graphs for them.
Cacti indicates the state of the interface under the "create graphs for this host" under the device section.

Any interface with a status of 2 is down. You have the option to create or not create a graph per interface.
We only have cisco switches here and from what I can tell, an index does get created even if the int is in shutdown; I can't speak for other vendor devices.

I do agree with your point of having to review all the interfaces for active ones. It would be nice to have an option to "hide" inactive interfaces
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey
styrofoam
Posts: 20
Joined: Thu Nov 16, 2006 2:29 pm

Post by styrofoam »

Or even a "select/toggle all UP interfaces" in the Graph creation screen.
Click that button, and every interface that's up gets a check box. Then I could go through and weed out the few I don't want.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests