Ad Widget

Collapse

Zabbix 1.1Beta1 Compilation problem on NetBSD 2.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rinsan
    Junior Member
    • Sep 2005
    • 6

    #1

    Zabbix 1.1Beta1 Compilation problem on NetBSD 2.0

    On NetBSD RELEASE 2.0 i386

    ./configure --enable-server --enable-agent --with-pgsql=/usr/pk

    if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -g -O2 -MT sysinfo.o -MD -MP -MF ".deps/sysinfo.Tpo" -c -o sysinfo.o sysinfo.c; then mv -f ".deps/sysinfo.Tpo" ".deps/sysinfo.Po"; else rm -f ".deps/sysinfo.Tpo"; exit 1; fi
    sysinfo.c: In function `CHECK_DNS':
    sysinfo.c:2011: error: `NS_DEFAULTPORT' undeclared (first use in this function)
    sysinfo.c:2011: error: (Each undeclared identifier is reported only once
    sysinfo.c:2011: error: for each function it appears in.)
    sysinfo.c:2015: error: `ns_c_in' undeclared (first use in this function)
    sysinfo.c:2015: error: `ns_t_soa' undeclared (first use in this function)
    *** Error code 1

    Stop.
    make: stopped in /home/users/rinsan/scratch/download/zabbix-1.1beta1/src/libs/zbxsysinfo
  • yopito
    Junior Member
    • Sep 2005
    • 7

    #2
    same on NetBSD-1.6.2/i386

    solution: patch the incrimined file with this:

    ---------------------------------------------------------------------
    --- src/libs/zbxsysinfo/sysinfo.c.orig Mon Sep 19 16:31:04 2005
    +++ src/libs/zbxsysinfo/sysinfo.c
    @@ -2008,11 +2008,20 @@ int CHECK_DNS(const char *cmd, const cha

    _res.nsaddr_list[0].sin_addr = in;
    _res.nsaddr_list[0].sin_family = AF_INET;
    +#ifdef __NetBSD__
    + /* from arpa/nameser.h */
    + _res.nsaddr_list[0].sin_port = htons(NAMESERVER_PORT);
    +#else
    _res.nsaddr_list[0].sin_port = htons(NS_DEFAULTPORT);
    +#endif
    _res.nscount = 1;
    _res.retrans=5;

    +#ifdef __NetBSD__
    + /* from arpa/nameser.h */
    + result=res_query(zone,C_IN,T_SOA,respbuf,sizeof(re spbuf));
    +#else
    result=res_query(zone,ns_c_in,ns_t_soa,respbuf,siz eof(respbuf));
    +#endif
    *value = result!=-1 ? 1 : 0;

    return SYSINFO_RET_OK;
    ---------------------------------------------------------------------

    I attempt to package zabbix-1.1beta1 in the NetBSD package system (pkgsrc) : just began this morning, so building is in process.

    cheers.

    Comment

    • rinsan
      Junior Member
      • Sep 2005
      • 6

      #3
      Great work! THanks!

      Comment

      • yopito
        Junior Member
        • Sep 2005
        • 7

        #4
        the patch

        hello again,

        copy/paste patch content "inline" is not very nice.

        So my previous patch as an attached file.

        regards.
        Attached Files

        Comment

        • JLF
          Junior Member
          • Oct 2005
          • 3

          #5
          Patch works for OpenBSD 3.7 too

          The above patch works for OpenBSD 3.7 too, provided I did a "perl -pi -e 's/__NetBSD__/__OpenBSD__/g' zabbix.patch1" after downloading.

          Another caveat, the patch now allows for successful compilation after "./configure --enable-server --with-mysql --enable-agent". However, zabbix will NOT compile after running ./configure with --enable-snmp and/or --with-net-snmp switches.

          Thanks much for the patch...and for the program.

          Comment

          • marc
            Senior Member
            • Oct 2004
            • 146

            #6
            what error you get if compiling with-net-snmp. could be the FreeBSD issues who are fixed. maybe the patch need a little tweaking for NetBSD/OpenBSD but pls. let us know your error message.

            Comment

            • JLF
              Junior Member
              • Oct 2005
              • 3

              #7
              For zabbix-1.1beta1 on OpenBSD 3.7:

              <ConfigureCommand>
              ./configure --enable-server --with-mysql --enable-agent --with-net-snmp
              </ConfigureCommand>

              <ConfigurationOutputSnippit>
              checking for MySQL support... yes
              checking for floor... no
              checking for floor in -lm... yes
              checking for compress in -lz... yes
              checking for PostgreSQL support... no
              checking for NET-SNMP support... checking for main in -lcrypto... yes
              yes
              checking for UCD-SNMP support... no
              checking for LDAP support... no
              ok (openbsd3.7)
              configure: creating ./config.status
              </ConfigurationOutputSnippit>

              <MakeCommand>
              make
              </MakeCommand>

              <MakeOutputSnippit>
              ranlib libzbxpinger.a
              Making all in poller
              if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -I../../../include -I/usr/local/include/mysql -g -O2 -MT checks_agent.o -MD -\
              MP -MF ".deps/checks_agent.Tpo" -c -o checks_agent.o checks_agent.c; then mv -f ".deps/checks_agent.Tpo" ".deps/checks_agent.Po"; \
              else rm -f ".deps/checks_agent.Tpo"; exit 1; fi
              if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -I../../../include -I/usr/local/include/mysql -g -O2 -MT checks_internal.o -M\
              D -MP -MF ".deps/checks_internal.Tpo" -c -o checks_internal.o checks_internal.c; then mv -f ".deps/checks_internal.Tpo" ".deps/che\
              cks_internal.Po"; else rm -f ".deps/checks_internal.Tpo"; exit 1; fi
              if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -I../../../include -I/usr/local/include/mysql -g -O2 -MT checks_simple.o -MD \
              -MP -MF ".deps/checks_simple.Tpo" -c -o checks_simple.o checks_simple.c; then mv -f ".deps/checks_simple.Tpo" ".deps/checks_simple\
              .Po"; else rm -f ".deps/checks_simple.Tpo"; exit 1; fi
              if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -I../../../include -I/usr/local/include/mysql -g -O2 -MT checks_snmp.o -MD -M\
              P -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 r\
              m -f ".deps/checks_snmp.Tpo"; exit 1; fi
              In file included from checks_snmp.c:20:
              checks_snmp.h:35:46: net-snmp/net-snmp-config.h: No such file or directory
              checks_snmp.h:36:48: net-snmp/net-snmp-includes.h: No such file or directory
              checks_snmp.c: In function `get_value_snmp':
              checks_snmp.c:29: error: storage size of `session' isn't known
              checks_snmp.c:37: error: syntax error before "anOID"
              checks_snmp.c:38: error: `MAX_OID_LEN' undeclared (first use in this function)
              checks_snmp.c:38: error: (Each undeclared identifier is reported only once
              checks_snmp.c:38: error: for each function it appears in.)
              checks_snmp.c:56: error: `SNMP_VERSION_1' undeclared (first use in this function)
              [snip]
              checks_snmp.c:290: error: dereferencing pointer to incomplete type
              checks_snmp.c:294: error: `STAT_TIMEOUT' undeclared (first use in this function)
              *** Error code 1

              Stop in /usr/local/src/zabbix-1.1beta1/src/zabbix_server/poller.
              *** Error code 1

              Stop in /usr/local/src/zabbix-1.1beta1/src/zabbix_server/poller (line 300 of Makefile).
              *** Error code 1

              Stop in /usr/local/src/zabbix-1.1beta1/src/zabbix_server (line 295 of Makefile).
              *** Error code 1

              Stop in /usr/local/src/zabbix-1.1beta1/src (line 213 of Makefile).
              *** Error code 1

              Stop in /usr/local/src/zabbix-1.1beta1 (line 247 of Makefile).
              </MakeOutputSnippit>
              Last edited by JLF; 05-10-2005, 13:32.

              Comment

              • elmore
                Junior Member
                • Oct 2005
                • 1

                #8
                I have this same problem JLF, anyone have an answer?

                I'm running:

                Code:
                FreeBSD 5.3-RELEASE #0: Fri Nov  5 04:19:18 UTC 2004     [email protected]:/usr/obj/usr/src/sys/GENERIC
                configure:

                Code:
                ./configure --enable-server --enable-agent --enable-static \
                --with-mysql --with-net-snmp
                Error message:

                Code:
                if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -I../../../include -I/usr/local/include/mysql     -static -g -O2 -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
                In file included from checks_snmp.c:20:
                checks_snmp.h:35:39: net-snmp/net-snmp-config.h: No such file or directory
                checks_snmp.h:36:41: net-snmp/net-snmp-includes.h: No such file or directory
                checks_snmp.c: In function `get_value_snmp':
                checks_snmp.c:29: error: storage size of 'session' isn't known
                checks_snmp.c:37: error: syntax error before "anOID"
                checks_snmp.c:38: error: `MAX_OID_LEN' undeclared (first use in this function)
                checks_snmp.c:38: error: (Each undeclared identifier is reported only once
                checks_snmp.c:38: error: for each function it appears in.)
                checks_snmp.c:56: error: `SNMP_VERSION_1' undeclared (first use in this function)
                checks_snmp.c:60: error: `SNMP_VERSION_2c' undeclared (first use in this function)
                checks_snmp.c:94: error: `SNMP_VERSION_3' undeclared (first use in this function)
                checks_snmp.c:104: error: `SNMP_SEC_LEVEL_NOAUTH' undeclared (first use in this function)
                checks_snmp.c:108: error: `SNMP_SEC_LEVEL_AUTHNOPRIV' undeclared (first use in this function)
                checks_snmp.c:112: error: `SNMP_SEC_LEVEL_AUTHPRIV' undeclared (first use in this function)
                checks_snmp.c:122: error: `usmHMACMD5AuthProtocol' undeclared (first use in this function)
                checks_snmp.c:123: error: `oid' undeclared (first use in this function)
                checks_snmp.c:124: error: `USM_AUTH_KU_LEN' undeclared (first use in this function)
                checks_snmp.c:135: error: `SNMPERR_SUCCESS' undeclared (first use in this function)
                checks_snmp.c:152: error: `SOCK_STARTUP' undeclared (first use in this function)
                checks_snmp.c:153: warning: assignment makes pointer from integer without a cast
                checks_snmp.c:157: error: `SOCK_CLEANUP' undeclared (first use in this function)
                checks_snmp.c:164: error: `SNMP_MSG_GET' undeclared (first use in this function)
                checks_snmp.c:164: warning: assignment makes pointer from integer without a cast
                checks_snmp.c:165: error: `anOID' undeclared (first use in this function)
                checks_snmp.c:182: error: `STAT_SUCCESS' undeclared (first use in this function)
                checks_snmp.c:182: error: dereferencing pointer to incomplete type
                checks_snmp.c:182: error: `SNMP_ERR_NOERROR' undeclared (first use in this function)
                checks_snmp.c:191: error: dereferencing pointer to incomplete type
                checks_snmp.c:191: error: dereferencing pointer to incomplete type
                checks_snmp.c:197: error: dereferencing pointer to incomplete type
                checks_snmp.c:197: error: `ASN_UINTEGER' undeclared (first use in this function)
                checks_snmp.c:198: error: dereferencing pointer to incomplete type
                checks_snmp.c:198: error: `ASN_COUNTER' undeclared (first use in this function)
                checks_snmp.c:203: error: dereferencing pointer to incomplete type
                checks_snmp.c:203: error: `ASN_TIMETICKS' undeclared (first use in this function)
                checks_snmp.c:204: error: dereferencing pointer to incomplete type
                checks_snmp.c:204: error: `ASN_GAUGE' undeclared (first use in this function)
                checks_snmp.c:207: error: dereferencing pointer to incomplete type
                checks_snmp.c:213: error: dereferencing pointer to incomplete type
                checks_snmp.c:215: error: dereferencing pointer to incomplete type
                checks_snmp.c:222: error: `ASN_INTEGER' undeclared (first use in this function)
                checks_snmp.c:224: error: dereferencing pointer to incomplete type
                checks_snmp.c:225: error: dereferencing pointer to incomplete type
                checks_snmp.c:239: error: dereferencing pointer to incomplete type
                checks_snmp.c:239: error: `ASN_OCTET_STR' undeclared (first use in this function)
                checks_snmp.c:241: error: dereferencing pointer to incomplete type
                checks_snmp.c:241: error: dereferencing pointer to incomplete type
                checks_snmp.c:242: error: dereferencing pointer to incomplete type
                checks_snmp.c:253: error: dereferencing pointer to incomplete type
                checks_snmp.c:253: error: `ASN_IPADDRESS' undeclared (first use in this function)
                checks_snmp.c:255: error: dereferencing pointer to incomplete type
                checks_snmp.c:271: error: dereferencing pointer to incomplete type
                checks_snmp.c:272: error: dereferencing pointer to incomplete type
                checks_snmp.c:282: error: dereferencing pointer to incomplete type
                checks_snmp.c:283: error: dereferencing pointer to incomplete type
                checks_snmp.c:283: error: `SNMP_ERR_NOSUCHNAME' undeclared (first use in this function)
                checks_snmp.c:285: error: dereferencing pointer to incomplete type
                checks_snmp.c:290: error: dereferencing pointer to incomplete type
                checks_snmp.c:294: error: `STAT_TIMEOUT' undeclared (first use in this function)
                *** Error code 1
                
                Stop in /.amd_mnt/selma/host/vol/home/elmore/Public/zabbix/zabbix-1.1beta1/src/zabbix_server/poller.
                *** Error code 1
                
                Stop in /.amd_mnt/selma/host/vol/home/elmore/Public/zabbix/zabbix-1.1beta1/src/zabbix_server/poller.
                *** Error code 1
                
                Stop in /.amd_mnt/selma/host/vol/home/elmore/Public/zabbix/zabbix-1.1beta1/src/zabbix_server.
                *** Error code 1
                
                Stop in /.amd_mnt/selma/host/vol/home/elmore/Public/zabbix/zabbix-1.1beta1/src.
                *** Error code 1
                
                Stop in /.amd_mnt/selma/host/vol/home/elmore/Public/zabbix/zabbix-1.1beta1.

                woops nvm found the FreeBSD thread where this is documented. That'll teach me to post before reading the entire forum. Sorry! This post can be safely removed now.
                Last edited by elmore; 07-10-2005, 19:58.

                Comment

                • marc
                  Senior Member
                  • Oct 2004
                  • 146

                  #9
                  Originally posted by JLF
                  For zabbix-1.1beta1 on OpenBSD 3.7:

                  <ConfigureCommand>
                  ./configure --enable-server --with-mysql --enable-agent --with-net-snmp
                  </ConfigureCommand>

                  <ConfigurationOutputSnippit>
                  checking for MySQL support... yes
                  checking for floor... no
                  checking for floor in -lm... yes
                  checking for compress in -lz... yes
                  checking for PostgreSQL support... no
                  checking for NET-SNMP support... checking for main in -lcrypto... yes
                  yes
                  checking for UCD-SNMP support... no
                  checking for LDAP support... no
                  ok (openbsd3.7)
                  configure: creating ./config.status
                  </ConfigurationOutputSnippit>

                  <MakeCommand>
                  make
                  </MakeCommand>

                  <MakeOutputSnippit>
                  ranlib libzbxpinger.a
                  Making all in poller
                  if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -I../../../include -I/usr/local/include/mysql -g -O2 -MT checks_agent.o -MD -\
                  MP -MF ".deps/checks_agent.Tpo" -c -o checks_agent.o checks_agent.c; then mv -f ".deps/checks_agent.Tpo" ".deps/checks_agent.Po"; \
                  else rm -f ".deps/checks_agent.Tpo"; exit 1; fi
                  if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -I../../../include -I/usr/local/include/mysql -g -O2 -MT checks_internal.o -M\
                  D -MP -MF ".deps/checks_internal.Tpo" -c -o checks_internal.o checks_internal.c; then mv -f ".deps/checks_internal.Tpo" ".deps/che\
                  cks_internal.Po"; else rm -f ".deps/checks_internal.Tpo"; exit 1; fi
                  if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -I../../../include -I/usr/local/include/mysql -g -O2 -MT checks_simple.o -MD \
                  -MP -MF ".deps/checks_simple.Tpo" -c -o checks_simple.o checks_simple.c; then mv -f ".deps/checks_simple.Tpo" ".deps/checks_simple\
                  .Po"; else rm -f ".deps/checks_simple.Tpo"; exit 1; fi
                  if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -I../../../include -I/usr/local/include/mysql -g -O2 -MT checks_snmp.o -MD -M\
                  P -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 r\
                  m -f ".deps/checks_snmp.Tpo"; exit 1; fi
                  In file included from checks_snmp.c:20:
                  checks_snmp.h:35:46: net-snmp/net-snmp-config.h: No such file or directory
                  checks_snmp.h:36:48: net-snmp/net-snmp-includes.h: No such file or directory
                  checks_snmp.c: In function `get_value_snmp':
                  checks_snmp.c:29: error: storage size of `session' isn't known
                  checks_snmp.c:37: error: syntax error before "anOID"
                  checks_snmp.c:38: error: `MAX_OID_LEN' undeclared (first use in this function)
                  checks_snmp.c:38: error: (Each undeclared identifier is reported only once
                  checks_snmp.c:38: error: for each function it appears in.)
                  checks_snmp.c:56: error: `SNMP_VERSION_1' undeclared (first use in this function)
                  [snip]
                  checks_snmp.c:290: error: dereferencing pointer to incomplete type
                  checks_snmp.c:294: error: `STAT_TIMEOUT' undeclared (first use in this function)
                  *** Error code 1

                  Stop in /usr/local/src/zabbix-1.1beta1/src/zabbix_server/poller.
                  *** Error code 1

                  Stop in /usr/local/src/zabbix-1.1beta1/src/zabbix_server/poller (line 300 of Makefile).
                  *** Error code 1

                  Stop in /usr/local/src/zabbix-1.1beta1/src/zabbix_server (line 295 of Makefile).
                  *** Error code 1

                  Stop in /usr/local/src/zabbix-1.1beta1/src (line 213 of Makefile).
                  *** Error code 1

                  Stop in /usr/local/src/zabbix-1.1beta1 (line 247 of Makefile).
                  </MakeOutputSnippit>
                  make sure the INCLUDE line in src/zabbix_server/Makefile.am looks like:
                  INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @SNMP_INCLUDE@

                  if not, change it to this and remove Makefile.in in same dir. run automake. iam not sure if the fix is part of beta1, i think its being commited to cvs after beta1

                  Comment

                  • JLF
                    Junior Member
                    • Oct 2005
                    • 3

                    #10
                    Originally posted by marc
                    make sure the INCLUDE line in src/zabbix_server/Makefile.am looks like:
                    INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @SNMP_INCLUDE@

                    if not, change it to this and remove Makefile.in in same dir. run automake. iam not sure if the fix is part of beta1, i think its being commited to cvs after beta1
                    Yes, the second line of src/zabbix_server/Makefile.am matches the INCLUDES line above. (I did not have to edit it.) So, the error has not gone away.

                    Comment

                    Working...