cactid and snmp_port

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

Moderators: Developers, Moderators

Post Reply
axel
Posts: 3
Joined: Tue Jun 20, 2006 3:42 am

cactid and snmp_port

Post by axel »

Hi,

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 */
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

The lastest SVN revision should fix it (never tried on my own, but it was reported)
Reinhard
axel
Posts: 3
Joined: Tue Jun 20, 2006 3:42 am

Post by axel »

I check it.

Axel
axel
Posts: 3
Joined: Tue Jun 20, 2006 3:42 am

Post by axel »

lvm wrote:The lastest SVN revision should fix it (never tried on my own, but it was reported)
Reinhard
Yes it works. Sorry.

Regards,

Axel
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests