Found solution to some failing querries

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

Moderators: Developers, Moderators

Post Reply
khutton
Cacti User
Posts: 77
Joined: Tue Jun 18, 2002 9:01 am
Location: Alexandria, Virginia
Contact:

Found solution to some failing querries

Post by khutton »

This may have been said already and I apologize if it has. I was attempting to graph memory utilization on some of my cisco gear and was getting a funny error when cmd.php was being run. Simply said, the snmpget query was returning a value of ":6367068 bytes". The fact that the response was not purely a number was causing the value to not be inserted into the rrd file. In turn the information was not being graphed. To aleviate the problem I had to edit the snmpget command that cacti was using so it would only return the value I was looking for. Here is how I did it.

Please use caution. This did work for me. It may not work for everyone.

edit /cacti/lib/snmp.php
around line 221 there is an if else statement DEPENDING ON WHICH VERSION OF SNMP YOU HAVE YOU MUST EDIT THE CORRECT LINE

for net-snmp you should add -OvU
v = return value not iod and value
U = do not return the units

Here is the code form the file that should be edited.

if (read_config_option("smnp_version") == "ucd-snmp") {
$snmp_value = exec(read_config_option("path_snmpget") . " -v$version -t $timeout $hostname:$port $snmp_auth $oid");
}elseif (read_config_option("smnp_version") == "net-snmp") {
$snmp_value = exec(read_config_option("path_snmpget") . " $snmp_auth -OvU -v $version -t $timeout $hostname:$port $oid");

Any input on whether there is a better way to accomplish should be posted. Hope this helps someone out there.
khutton
Cacti User
Posts: 77
Joined: Tue Jun 18, 2002 9:01 am
Location: Alexandria, Virginia
Contact:

Post by khutton »

This did not solve my NBAR query problem. Any knowledge or help with that would be greatly appreciated.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest