Descriptions on Graphing SNMP Interfaces

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
chrism
Posts: 13
Joined: Tue Sep 10, 2002 7:56 am

Descriptions on Graphing SNMP Interfaces

Post by chrism »

I'm starting to look at setting up cacti charts for our main router network. I've added the routers using 'snmp interfaces', and cacti goes off to find the interface information. I can then select 'view interfaces' and it gives me the table as expected.

However! Our network admins (in their infinite wisdom) have used relatively meaningless names for the snmp interfaces, as below:

5 Serial0/0.1 0.256 mbit 10.xx.xx.xx
7 Serial0/0.3 0.008 mbit 10.xx.xx.xy
8 Serial0/0.4 0.256 mbit 10.xx.xx.xz

If I select 'Make all graphs' (or select an individual one) it only gives the descriptions above as an option. If I walk the SNMP stack manually, I find that there's an OID that gives the following:

ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifAlias.5 = **** Main PVC to Manchester DLCI 101****
ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifAlias.7 = ****Backup management PVC to Bracknell DTC****
ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifAlias.8 = ****Main PVC to Leicester DLCI 104****

They've defined the description as an alias when setting up the router. Is the alias OID captured anywhere, and if so, is it easy to patch Cacti to allow the use of the alias for the graph title? It's much more meaningful than the snmp description in this case. (I know that I could manually extract the alias via an SNMPWALK as above and build the graph manually, but I thought I'd check if there was an easy way first :)

Is this practice of sticking a descriptive entry in an alias widespread, or is it just a hangup of our Network managers?

Cheers,
Chris
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Chris,

I have no solution for you only small clarifcation. I assume you have Cisco routers. In MIB you can find actually three objects describing the interface: ifName, ifDescr and ifAlias. Two first ones are set by a router and there is no way to change them. They look like this:
ifName - Se0/0.1
ifDescr - Serial0/0.1

The third one is related to "interface description" command which your network admins use for meaningful name and looks like this:
ifAlias - **** Main PVC to Manchester DLCI 101****

- bulek
met
Posts: 12
Joined: Thu Aug 01, 2002 7:32 am

Post by met »

Hi,

I had the same problem and my solution was to patch function get_snmp_interfaces in include/snmp_functions.php in order to
query the device for alias in addition to descr, and join both
strings if alias is present.

Code: Select all

$interface_alias = cacti_snmp_get($hostname, $community, ".1.3.6.1.2.1.31.1.1.1.18.$interface_number", "", "")
if ($interface_description != $interface_alias ) {
   $interface_description = $interface_description . " " . $interface_alias;
}
Regards,

Marco.
chrism
Posts: 13
Joined: Tue Sep 10, 2002 7:56 am

Post by chrism »

Thanks Marco,

Your patch works a treat :D

Cheers,
Chris
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Small remark - the patch makes impossible to use interface description instead of index for polling like kampanilla described here:
http://www.raxnet.net/board/viewtopic.php?t=678

- bulek
met
Posts: 12
Joined: Thu Aug 01, 2002 7:32 am

Post by met »

bulek wrote:Small remark - the patch makes impossible to use interface description instead of index for polling like kampanilla described here:
http://www.raxnet.net/board/viewtopic.php?t=678
You are right, I didn't noticed it since I use spine.pl, which doesn't support anything but ifNum to poll an interface (actually I wasn't aware of this feature :) ).

If needed, one could add a column to snmp_host_interfaces to hold the alias, or separate description from alias with a special char to be able to recover the description field.

Marco
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests