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.
check ifOperStatus when gathering interfaces
Moderators: Developers, Moderators
This is quite easy to do. In include/snmp_functions.php add the following line before line 123:
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
Code: Select all
if(cacti_snmp_get($hostname, $community, ".1.3.6.1.2.1.2.2.1.7.$interface_number", "", "") != "up(1)") continue;
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
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
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]
[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]
Re: check ifOperStatus when gathering interfaces
Cacti indicates the state of the interface under the "create graphs for this host" under the device section.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.
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
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
Who is online
Users browsing this forum: No registered users and 4 guests