oid issue

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

Moderators: Developers, Moderators

Post Reply
L2tp

oid issue

Post by L2tp »

I use cacti with a bunch of Cisco devices. SNMP interface description of each port on a device is collected by oid .1.3.6.1.2.1.2.2.1.2.x This quite useless for device like Cisco L3 (48+) port, and i prefer oid .1.3.6.1.4.1.9.2.2.1.1.x (locIfDescr cisco configuration description). I've changed the original oid with the new in snmp_functions.php but something goes wrong: the script collects no text about description. Is there something to do that i've missed?


Thanks & sorry for my awful english
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I am not sure if this will work completely how you intend it to. Not only must you change the '.1.3.6.1.2.1.2.2.1.1' OID in the 'get_snmp_interfaces' function, but you must change it everywhere in that function as well.

The interface description comes from line 123:

Code: Select all

$interface_description = cacti_snmp_get($hostname, $community, ".1.3.6.1.2.1.2.2.1.2.$interface_number", "", "");
Make sure the OID points to that of what you are looking for.

Other than that, I am not exactly sure why it is not working correctly.

-Ian
L2tp

Post by L2tp »

The problem cold be due to snmp answer:

snmpget 192.168.xxx.xxx public .1.3.6.1.4.1.9.2.2.1.1.28.1
enterprises.9.2.2.1.1.28.1 = "----> Def. gateway"

snmpget 192.168.xxx.xxx public .1.3.6.1.2.1.2.2.1.2.1
interfaces.ifTable.ifEntry.ifDescr.1 = FastEthernet0/0

I think Quotation marks can generate some error: when i change the oid and refresh interfaces the field Description contains only one quotation mark.

Now i try to modify something about stripping char in cacti_snmp_get function.

P.S. I use external snmpget (UCD-SNMP)
L2tp

Post by L2tp »

Now it works very well,

The problem was in the stripping of "strange" char

I've changed:
$interface_description = cacti_snmp_get($hostname, $community, ".1.3.6.1.2.1.2.2.1.2.$interface_number", "", "");
to
$interface_description = cacti_snmp_get($hostname, $community, ".1.3.6.1.4.1.9.2.2.1.1.28.$interface_number", "", "");

and added at line 55 (snmp_functions.php)
$snmp_value = str_replace("\"", "", $snmp_value);
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests