I had the problem described in http://bugs.cacti.net/view.php?id=418 with the version 0.8.6g of cactid.
My net-snmp version is 5.2.1.2.
So I used a debugger on cactid and on snmpget. The difference I noticed is that snmpget doesn't use the snmp_port variable but the session.peername is declared as hostname:port.
You'll find in this post the quick and dirty modification of snmp.c.
Is there someone who still have this kind of problem.
Regards,
Axel Luissant
Code: Select all
--- cacti-cactid-0.8.6g/snmp.c 2006-01-12 01:25:55.000000000 +0100
+++ cacti-cactid-0.8.6g-mod/snmp.c 2006-06-20 10:50:22.000000000 +0200
@@ -96,6 +96,7 @@
char *snmp_username, char *snmp_password, int snmp_port, int snmp_timeout) {
void *sessp = NULL;
struct snmp_session session;
+ static char snmp_hostname[255];
/* initialize SNMP */
thread_mutex_lock(LOCK_SNMP);
@@ -130,7 +131,8 @@
return 0;
}
- session.peername = hostname;
+ sprintf(snmp_hostname,"%s:%d",hostname,snmp_port);
+ session.peername = snmp_hostname ;
session.retries = 3;
session.remote_port = snmp_port;
session.timeout = (snmp_timeout * 1000); /* net-snmp likes microseconds */