Ad Widget

Collapse

Zabbix 1.5.4 compile with net-snmp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ataylo13
    Senior Member
    • Feb 2007
    • 122

    #1

    Zabbix 1.5.4 compile with net-snmp

    I am unable to compile the latest version of 1.5.4 with net-snmp. This is the error I get:

    if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -g -O2 -I/usr/include/mysql -g -pipe -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -I/usr/include/rpm -I/usr/include/rpm -I. -I/usr/include/net-snmp -I/usr/include -MT checks_snmp.o -MD -MP -MF ".deps/checks_snmp.Tpo" -c -o checks_snmp.o checks_snmp.c; \
    then mv -f ".deps/checks_snmp.Tpo" ".deps/checks_snmp.Po"; else rm -f ".deps/checks_snmp.Tpo"; exit 1; fi
    checks_snmp.c: In function `snmp_get_index':
    checks_snmp.c:213: error: structure has no member named `localname'
    checks_snmp.c: In function `get_snmp':
    checks_snmp.c:556: error: structure has no member named `localname'
    make[3]: *** [checks_snmp.o] Error 1
    make[3]: Leaving directory `/logs/files/zabbix/zabbix-1.5.4/src/zabbix_server/poller'
    make[2]: *** [install-recursive] Error 1
    make[2]: Leaving directory `/logs/files/zabbix/zabbix-1.5.4/src/zabbix_proxy'
    make[1]: *** [install-recursive] Error 1
    make[1]: Leaving directory `/logs/files/zabbix/zabbix-1.5.4/src'
    make: *** [install-recursive] Error 1


    I compiled with:
    ./configure --enable-server --enable-agent --with-mysql --prefix=/opt/zabbix --enable-proxy --with-net-snmp --with-ldap --with-libcurl

    if I remove --with-net-snmp it compiles and makes with no issues.
    Version : 1.8.8
    Current Configuration 1 Master and 3 Child Nodes
  • ngarnier
    Junior Member
    • Mar 2008
    • 21

    #2
    Same error :

    if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -g -O2 -I/usr/include/mysql -g -pipe -m32 -march=i386 -mtune=pentium4 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -I/usr/include/rpm -I/usr/include/rpm -I. -I/usr/include/net-snmp -MT checks_snmp.o -MD -MP -MF ".deps/checks_snmp.Tpo" -c -o checks_snmp.o checks_snmp.c; \
    then mv -f ".deps/checks_snmp.Tpo" ".deps/checks_snmp.Po"; else rm -f ".deps/checks_snmp.Tpo"; exit 1; fi
    checks_snmp.c: In function `snmp_get_index':
    checks_snmp.c:213: error: structure has no member named `localname'
    checks_snmp.c: In function `get_snmp':
    checks_snmp.c:556: error: structure has no member named `localname'
    make[3]: *** [checks_snmp.o] Error 1
    make[3]: Leaving directory `/root/zabbix-1.5.4/src/zabbix_server/poller'
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/root/zabbix-1.5.4/src/zabbix_proxy'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/root/zabbix-1.5.4/src'
    make: *** [all-recursive] Error 1


    ./configure --prefix=/opt/zabbix/1.5.4 --enable-server --enable-proxy --enable-agent --with-mysql --with-net-snmp

    Comment

    • theologu
      Junior Member
      • Dec 2007
      • 23

      #3
      I tried to compile on my Slackware 12 box, and it is working just fine!
      With 1.4.x versions I had to tweak the configure script to work with net-snmp and I see that with 1.5.4 it is working just as is.
      Just:
      ./configure --prefix=/opt/zabbix/1.5.4 --enable-server --enable-proxy --enable-agent --with-mysql --with-netsnmp
      make
      make install

      The configure script reports:

      Linker flags: -L/usr/lib/mysql -L/usr/lib -lcurl -L/usr/lib -lnetsnmp -lcrypto -lm -lcrypto -lwrap -lnsl -lcrypto -L/usr/lib -lnetsnmp -lcrypto -lm -lcrypto -lwrap -lnsl -lcrypto
      Libraries: -lm -lresolv -lmysqlclient -lcurl -lnetsnmp

      Net-SNMP version is 5.4; What distro are you using? and what snmp version?
      Last edited by theologu; 20-08-2008, 12:53.

      Comment

      • ngarnier
        Junior Member
        • Mar 2008
        • 21

        #4
        rpm -qa | grep net-snmp
        net-snmp-utils-5.1.2-11.EL4.7
        net-snmp-devel-5.1.2-11.EL4.7
        net-snmp-5.1.2-11.EL4.7
        net-snmp-libs-5.1.2-11.EL4.7
        net-snmp-perl-5.1.2-11.EL4.7

        The 1.5.3 works fine with this version.

        Comment

        • theologu
          Junior Member
          • Dec 2007
          • 23

          #5
          I think this has something to do with "IP source addresses" functionality added in zabbix, that uses "localname" api function used by snmp. Older snmp versions seems to lack "localname" function;

          You shouls check in your snmp_api.h header file ( somewhere in /usr/include/...) if struct snmp_session has a line: char *localname;

          If it does not, upgrade your net-snmp to 5.4 and it should compile fine.

          If upgrade of net-snmp is not possible, as last resort try to tweak (or comment?) src/zabbix_server/poller/checks_snmp.c at line 213 so it will not use session.localname .... I don`t know the impact of such thing, use this only as an experiment

          Comment

          • ngarnier
            Junior Member
            • Mar 2008
            • 21

            #6
            You're right, no localname entry in the structure ... think to upgrade.

            Thanks.

            Comment

            • Alexei
              Founder, CEO
              Zabbix Certified Trainer
              Zabbix Certified SpecialistZabbix Certified Professional
              • Sep 2004
              • 5654

              #7
              Thanks for reporting this. It will be fixed to work with all versions of net-snmp.
              Alexei Vladishev
              Creator of Zabbix, Product manager
              New York | Tokyo | Riga
              My Twitter

              Comment

              • ataylo13
                Senior Member
                • Feb 2007
                • 122

                #8
                I upgraded to net-snmp 5.4.1 and it compiled. Thanks for the tip.
                Version : 1.8.8
                Current Configuration 1 Master and 3 Child Nodes

                Comment

                • Tenzer
                  Senior Member
                  • Nov 2007
                  • 316

                  #9
                  Just for other people experiencing the same issue on Solaris 10. I had to remove the symlink "/opt/coolstack/include/net-snmp" which was installed with coolstack, otherwise the old snmp libraries included in Solaris would be used, instead of the new ones I had downloaded from sunfreeware.com.

                  Comment

                  • xs-
                    Senior Member
                    Zabbix Certified Specialist
                    • Dec 2007
                    • 393

                    #10
                    Originally posted by Alexei
                    Thanks for reporting this. It will be fixed to work with all versions of net-snmp.
                    One of our DM nodes is running RHEL4u6 and fails compiling zabbix-1.6 on this.
                    Seems issue is still there.

                    Comment

                    • boy01
                      Junior Member
                      • Dec 2007
                      • 24

                      #11
                      Originally posted by xs-
                      One of our DM nodes is running RHEL4u6 and fails compiling zabbix-1.6 on this.
                      Seems issue is still there.
                      On my CentOS 4.4 I changed in src/zabbix_server/poller/checks_snmp.c:
                      session.localname --> session.peername
                      and it compiles.

                      Not sure that is correct fix, thought. Maybe someone can verify?

                      Comment

                      • Alexei
                        Founder, CEO
                        Zabbix Certified Trainer
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Sep 2004
                        • 5654

                        #12
                        As a quick workaround, just comment this and previous line in C code and recompile.
                        Alexei Vladishev
                        Creator of Zabbix, Product manager
                        New York | Tokyo | Riga
                        My Twitter

                        Comment

                        • marcis
                          Junior Member
                          Zabbix Certified Specialist
                          • Jul 2007
                          • 17

                          #13
                          Originally posted by Tenzer
                          Just for other people experiencing the same issue on Solaris 10. I had to remove the symlink "/opt/coolstack/include/net-snmp" which was installed with coolstack, otherwise the old snmp libraries included in Solaris would be used, instead of the new ones I had downloaded from sunfreeware.com.
                          Huh! Thanks this was useful

                          Comment

                          Working...