Feature Request: snmp port

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

Moderators: Developers, Moderators

Post Reply
Guest

Post by Guest »

Very Very Nice. Did not take long to get setup. I have been using cricket for the last year.

Would like to be able to pull data from a snmpagent not running on port 161 (say port 1161, etc..).

It is easy to add to the perl scripts, but what about the built in Internal data gathers.

Thanks
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

If you don't mind editing a few lines of code, here is how to change the SNMP port number for the builtin SNMP functions.

On line 415 of 'include/snmp_functions.php' change the following line:

$snmp_output_octets = snmpget($snmp_ip, $snmp_community, "$snmp_octet_name.$snmp_interface_number");

to:

$snmp_output_octets = snmpget($snmp_ip . ":PORT#", $snmp_community, "$snmp_octet_name.$snmp_interface_number");

Then, change line 438 from:

$snmp_output_octets = snmpget($snmp_ip, $snmp_community, $snmp_oid);

to:

$snmp_output_octets = snmpget($snmp_ip . ":PORT#", $snmp_community, $snmp_oid);

Hope this helps.

-Ian
gilson
Posts: 27
Joined: Wed Jan 23, 2002 7:00 pm
Contact:

Post by gilson »

I think the easiest way is changing in 'cacti Settings'
from: /usr/bin/snmpget
to: /usr/bin/snmpget -p1161

I often change the 'retries' and 'timeout' parameters there: /usr/bin/snmpget -r2 -t5
Ie: 2 retries with 5 seconds for timeout

On Linux type 'man snmpcmd' for more options on snmp commands.

-Gilson
Guest

Post by Guest »

The port may vary from machine to machine (want data from net-snmp, but on E10k need to keep Sun snmp running). So on some machine the data will be on port 161 and other 1161. So I dont want to hard code the port.

Was hoping to have the port number prompted from the setup page for that machine or data collection page. I have made changes to include/snmp_functions.php to do this. Need to find and make changes to code that generates the web form for data input.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests