Ad Widget

Collapse

Zabbix agent compilation on AlphaServer Tru64 5.1B

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cdany2000
    Junior Member
    • Jan 2018
    • 4

    #1

    Zabbix agent compilation on AlphaServer Tru64 5.1B

    Hi,

    I can compile easily v1.1 and v1.8.22 of zabbix agent on AlphaServer Tru64 5.1B

    But I have a problem with version 3.x

    I try now with zabbix-3.0.14, the ./configure --enable-agent pass successfully, but when a run make, the make look good and after a moment I get this error:


    .......
    .....
    rm -f libsimplesysinfo.a
    ar cru libsimplesysinfo.a libsimplesysinfo_a-simple.o libsimplesysinfo_a-ntp.o
    ranlib libsimplesysinfo.a
    Making all in osf
    source='cpu.c' object='libspecsysinfo_a-cpu.o' libtool=no DEPDIR=.deps depmode=none /bin/bash ../../../../depcomp cc -DHAVE_CONFIG_H -I. -I../../../../include -I../../../../src/zabbix_agent/ -g -c -o libspecsysinfo_a-cpu.o `test -f 'cpu.c' || echo './'`cpu.c
    cc: Error: cpu.c, line 99: In this statement, "cmd" is not declared. (undeclared)
    ret = EXECUTE_DBL(cmd, "uptime | awk '{printf(\"%s\", $(NF-2))}' | sed 's/[ ,]//g'", result);
    ----------------------------------^
    cc: Warning: cpu.c, line 99: In this statement, the referenced type of the pointer value ""uptime | awk '{printf("%s", $(NF-2))}' | sed 's/[ ,]//g'"" is "char", which is not compatible with "struct declared without a tag". (ptrmismatch)
    ret = EXECUTE_DBL(cmd, "uptime | awk '{printf(\"%s\", $(NF-2))}' | sed 's/[ ,]//g'", result);
    ---------------------------------------^
    cc: Error: cpu.c, line 99: In this statement, "EXECUTE_DBL" expects 2 arguments, but 3 are supplied. (toomanyargs)
    ret = EXECUTE_DBL(cmd, "uptime | awk '{printf(\"%s\", $(NF-2))}' | sed 's/[ ,]//g'", result);
    ----------------------^
    *** Exit 1
    Stop.
    *** Exit 1
    Stop.
    *** Exit 1
    Stop.
    *** Exit 1
    Stop.
    *** Exit 1
    Stop.

    Somebody know why ?
  • andris
    Zabbix developer
    • Feb 2012
    • 228

    #2
    Hi!

    You can try to delete "cmd." part in src/libs/zbxsysinfo/osf/cpu.c.
    So, line 99 from
    Code:
    		ret = EXECUTE_DBL(cmd, "uptime | awk '{printf(\"%s\", $(NF-2))}' | sed 's/[ ,]//g'", result);
    becomes
    Code:
    		ret = EXECUTE_DBL("uptime | awk '{printf(\"%s\", $(NF-2))}' | sed 's/[ ,]//g'", result);
    and compile again.
    Please tell us did it help. We do not have access to this platform, but we can fix this bug with your help.

    Comment

    • cdany2000
      Junior Member
      • Jan 2018
      • 4

      #3
      Hi andris,

      First thanks alot for your fast and precius help on this post , is greatly appreciated ( and my apologies for my english ).

      I was expected no answer for this question, and I am really happy

      Is much better with your modification, now I got this error :

      .....
      Making all in osf
      source='cpu.c' object='libspecsysinfo_a-cpu.o' libtool=no DEPDIR=.deps depmode=none /bin/bash ../../../../depcomp cc -DHAVE_CONFIG_H -I. -I../../../../include -I../../../../src/zabbix_agent/ -g -c -o libspecsysinfo_a-cpu.o `test -f 'cpu.c' || echo './'`cpu.c
      source='diskio.c' object='libspecsysinfo_a-diskio.o' libtool=no DEPDIR=.deps depmode=none /bin/bash ../../../../depcomp cc -DHAVE_CONFIG_H -I. -I../../../../include -I../../../../src/zabbix_agent/ -g -c -o libspecsysinfo_a-diskio.o `test -f 'diskio.c' || echo './'`diskio.c
      source='diskspace.c' object='libspecsysinfo_a-diskspace.o' libtool=no DEPDIR=.deps depmode=none /bin/bash ../../../../depcomp cc -DHAVE_CONFIG_H -I. -I../../../../include -I../../../../src/zabbix_agent/ -g -c -o libspecsysinfo_a-diskspace.o `test -f 'diskspace.c' || echo './'`diskspace.c
      source='inodes.c' object='libspecsysinfo_a-inodes.o' libtool=no DEPDIR=.deps depmode=none /bin/bash ../../../../depcomp cc -DHAVE_CONFIG_H -I. -I../../../../include -I../../../../src/zabbix_agent/ -g -c -o libspecsysinfo_a-inodes.o `test -f 'inodes.c' || echo './'`inodes.c
      source='kernel.c' object='libspecsysinfo_a-kernel.o' libtool=no DEPDIR=.deps depmode=none /bin/bash ../../../../depcomp cc -DHAVE_CONFIG_H -I. -I../../../../include -I../../../../src/zabbix_agent/ -g -c -o libspecsysinfo_a-kernel.o `test -f 'kernel.c' || echo './'`kernel.c
      source='memory.c' object='libspecsysinfo_a-memory.o' libtool=no DEPDIR=.deps depmode=none /bin/bash ../../../../depcomp cc -DHAVE_CONFIG_H -I. -I../../../../include -I../../../../src/zabbix_agent/ -g -c -o libspecsysinfo_a-memory.o `test -f 'memory.c' || echo './'`memory.c
      source='osf.c' object='libspecsysinfo_a-osf.o' libtool=no DEPDIR=.deps depmode=none /bin/bash ../../../../depcomp cc -DHAVE_CONFIG_H -I. -I../../../../include -I../../../../src/zabbix_agent/ -g -c -o libspecsysinfo_a-osf.o `test -f 'osf.c' || echo './'`osf.c
      source='proc.c' object='libspecsysinfo_a-proc.o' libtool=no DEPDIR=.deps depmode=none /bin/bash ../../../../depcomp cc -DHAVE_CONFIG_H -I. -I../../../../include -I../../../../src/zabbix_agent/ -g -c -o libspecsysinfo_a-proc.o `test -f 'proc.c' || echo './'`proc.c
      cc: Info: ../../../../include/zbxalgo.h, line 317: Extraneous semicolon. (extrasemi)
      ZBX_VECTOR_DECL(uint64, zbx_uint64_t);
      -------------------------------------^
      cc: Info: ../../../../include/zbxalgo.h, line 318: Extraneous semicolon. (extrasemi)
      ZBX_PTR_VECTOR_DECL(str, char *);
      ^
      cc: Info: ../../../../include/zbxalgo.h, line 318: Extraneous semicolon. (extrasemi)
      ZBX_PTR_VECTOR_DECL(str, char *);
      --------------------------------^
      cc: Info: ../../../../include/zbxalgo.h, line 319: Extraneous semicolon. (extrasemi)
      ZBX_PTR_VECTOR_DECL(ptr, void *);
      ^
      cc: Info: ../../../../include/zbxalgo.h, line 319: Extraneous semicolon. (extrasemi)
      ZBX_PTR_VECTOR_DECL(ptr, void *);
      --------------------------------^
      cc: Info: ../../../../include/zbxalgo.h, line 320: Extraneous semicolon. (extrasemi)
      ZBX_VECTOR_DECL(ptr_pair, zbx_ptr_pair_t);
      -----------------------------------------^
      cc: Info: ../../../../include/zbxalgo.h, line 321: Extraneous semicolon. (extrasemi)
      ZBX_VECTOR_DECL(uint64_pair, zbx_uint64_pair_t);
      -----------------------------------------------^
      cc: Error: proc.c, line 32: In this declaration, "psinfo" has no linkage and is of an incomplete type. (incompnolink)
      struct prpsinfo psinfo;
      ------------------------^
      cc: Error: proc.c, line 95: In this statement, "PIOCPSINFO" is not declared. (undeclared)
      if (-1 == ioctl(proc, PIOCPSINFO, &psinfo))
      ----------------------------------------------^
      cc: Error: proc.c, line 158: In this declaration, "psinfo" has no linkage and is of an incomplete type. (incompnolink)
      struct prpsinfo psinfo;
      ------------------------^
      cc: Error: proc.c, line 186: In this statement, "PR_SRUN" is not declared. (undeclared)
      zbx_proc_stat = PR_SRUN;
      --------------------------------^
      cc: Error: proc.c, line 188: In this statement, "PR_SSLEEP" is not declared. (undeclared)
      zbx_proc_stat = PR_SSLEEP;
      --------------------------------^
      cc: Error: proc.c, line 190: In this statement, "PR_SZOMB" is not declared. (undeclared)
      zbx_proc_stat = PR_SZOMB;
      --------------------------------^
      cc: Error: proc.c, line 219: In this statement, "PIOCPSINFO" is not declared. (undeclared)
      if (-1 == ioctl(proc, PIOCPSINFO, &psinfo))
      ----------------------------------------------^
      *** Exit 1
      Stop.
      *** Exit 1
      Stop.
      *** Exit 1
      Stop.
      *** Exit 1
      Stop.
      *** Exit 1
      Stop.


      Again thanks alot for your help.

      Best regards.

      Comment

      • andris
        Zabbix developer
        • Feb 2012
        • 228

        #4
        Thanks for new info!

        It shows that compiling src/libs/zbxsysinfo/osf/proc.c fails because definitions of 'struct prpsinfo', PIOCPSINFO", PR_SRUN, PR_SSLEEP and PR_SZOMB are not found.

        I have no access to Tru64 system to find exactly where these missing definitions are located, so I will guess...
        Can you look into /usr/include directory ? Is there a file procfs.h ? If yes, then you can try to modify src/libs/zbxsysinfo/osf/proc.c to include it like:
        Code:
        #include <procfs.h>      <---- Here
        #include "common.h"
        #include "sysinfo.h"
        #include "zbxregexp.h"
        #include "log.h"
        If there is no /usr/include/procfs.h then maybe you have /usr/include/sys/procfs.h ?
        Then modify src/libs/zbxsysinfo/osf/proc.c to include it like:
        Code:
        #include <sys/procfs.h>      <---- Here
        #include "common.h"
        #include "sysinfo.h"
        #include "zbxregexp.h"
        #include "log.h"
        .... and compile again.

        Best regards
        Andris
        Last edited by andris; 24-01-2018, 11:41.

        Comment

        • cdany2000
          Junior Member
          • Jan 2018
          • 4

          #5
          Hello andris

          Thanks again for your great help.

          #include <procfs.h> was not present into the src/libs/zbxsysinfo/osf/proc.c file.

          You have right the includes are in /usr/include/ and procfs.h is in /usr/include/sys and I have added:


          Before :
          Code:
          #include "common.h"
          #include "sysinfo.h"
          #include "zbxregexp.h"
          #include "log.h"
          Now:
          Code:
          #include <sys/procfs.h>
          #include "common.h"
          #include "sysinfo.h"
          #include "zbxregexp.h"
          #include "log.h"
          Its look good now for proc.c

          Now I have this error in swap.c:

          Code:
          ....
          ...
          source='proc.c' object='libspecsysinfo_a-proc.o' libtool=no  DEPDIR=.deps depmode=none /bin/bash ../../../../depcomp  cc -DHAVE_CONFIG_H -I. -I../../../../include    -I../../../../src/zabbix_agent/ -g -c -o libspecsysinfo_a-proc.o `test -f 'proc.c' || echo './'`proc.c
          cc: Info: ../../../../include/zbxalgo.h, line 317: Extraneous semicolon. (extrasemi)
          ZBX_VECTOR_DECL(uint64, zbx_uint64_t);
          -------------------------------------^
          cc: Info: ../../../../include/zbxalgo.h, line 318: Extraneous semicolon. (extrasemi)
          ZBX_PTR_VECTOR_DECL(str, char *);
          ^
          cc: Info: ../../../../include/zbxalgo.h, line 318: Extraneous semicolon. (extrasemi)
          ZBX_PTR_VECTOR_DECL(str, char *);
          --------------------------------^
          cc: Info: ../../../../include/zbxalgo.h, line 319: Extraneous semicolon. (extrasemi)
          ZBX_PTR_VECTOR_DECL(ptr, void *);
          ^
          cc: Info: ../../../../include/zbxalgo.h, line 319: Extraneous semicolon. (extrasemi)
          ZBX_PTR_VECTOR_DECL(ptr, void *);
          --------------------------------^
          cc: Info: ../../../../include/zbxalgo.h, line 320: Extraneous semicolon. (extrasemi)
          ZBX_VECTOR_DECL(ptr_pair, zbx_ptr_pair_t);
          -----------------------------------------^
          cc: Info: ../../../../include/zbxalgo.h, line 321: Extraneous semicolon. (extrasemi)
          ZBX_VECTOR_DECL(uint64_pair, zbx_uint64_pair_t);
          source='software.c' object='libspecsysinfo_a-software.o' libtool=no  DEPDIR=.deps depmode=none /bin/bash ../../../../depcomp  cc -DHAVE_CONFIG_H -I. -I../../../../include    -I../../../../src/zabbix_agent/ -g -c -o libspecsysinfo_a-software.o `test -f 'software.c' || echo './'`software.c
          source='swap.c' object='libspecsysinfo_a-swap.o' libtool=no  DEPDIR=.deps depmode=none /bin/bash ../../../../depcomp  cc -DHAVE_CONFIG_H -I. -I../../../../include    -I../../../../src/zabbix_agent/ -g -c -o libspecsysinfo_a-swap.o `test -f 'swap.c' || echo './'`swap.c
          cc: Error: swap.c, line 191: In this statement, "cmd" is not declared. (undeclared)
                  if (SYSINFO_RET_OK != SYSTEM_SWAP_TOTAL(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
          ------------------------------------------------^
          cc: Error: swap.c, line 191: In this statement, "param" is not declared. (undeclared)
                  if (SYSINFO_RET_OK != SYSTEM_SWAP_TOTAL(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
          -----------------------------------------------------^
          cc: Error: swap.c, line 191: In this statement, "flags" is not declared. (undeclared)
                  if (SYSINFO_RET_OK != SYSTEM_SWAP_TOTAL(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
          ------------------------------------------------------------^
          cc: Error: swap.c, line 191: In this statement, "SYSTEM_SWAP_TOTAL" expects 1 arguments, but 4 are supplied. (toomanyargs)
                  if (SYSINFO_RET_OK != SYSTEM_SWAP_TOTAL(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
          ------------------------------^
          cc: Error: swap.c, line 202: In this statement, "SYSTEM_SWAP_FREE" expects 1 arguments, but 4 are supplied. (toomanyargs)
                  if (SYSINFO_RET_OK != SYSTEM_SWAP_FREE(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
          ------------------------------^
          cc: Error: swap.c, line 221: In this statement, "cmd" is not declared. (undeclared)
                  if (SYSINFO_RET_OK != SYSTEM_SWAP_TOTAL(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
          ------------------------------------------------^
          cc: Error: swap.c, line 221: In this statement, "param" is not declared. (undeclared)
                  if (SYSINFO_RET_OK != SYSTEM_SWAP_TOTAL(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
          -----------------------------------------------------^
          cc: Error: swap.c, line 221: In this statement, "flags" is not declared. (undeclared)
                  if (SYSINFO_RET_OK != SYSTEM_SWAP_TOTAL(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
          ------------------------------------------------------------^
          cc: Error: swap.c, line 221: In this statement, "SYSTEM_SWAP_TOTAL" expects 1 arguments, but 4 are supplied. (toomanyargs)
                  if (SYSINFO_RET_OK != SYSTEM_SWAP_TOTAL(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
          ------------------------------^
          cc: Error: swap.c, line 232: In this statement, "SYSTEM_SWAP_FREE" expects 1 arguments, but 4 are supplied. (toomanyargs)
                  if (SYSINFO_RET_OK != SYSTEM_SWAP_FREE(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
          ------------------------------^
          *** Exit 1
          Stop.
          *** Exit 1
          Stop.
          *** Exit 1
          Stop.
          *** Exit 1
          Stop.
          *** Exit 1
          Stop.
          Do you have any idea to resole the problem for src/libs/zbxsysinfo/osf/swap.c ? I tried to remove cmd like in cpu.c but no luck, is not the same syntax.

          Comment

          • andris
            Zabbix developer
            • Feb 2012
            • 228

            #6
            Hi!

            I created a bug report https://support.zabbix.com/browse/ZBX-13393.
            Let's continue there.

            Andris

            Comment

            • cdany2000
              Junior Member
              • Jan 2018
              • 4

              #7
              Many thanks for your help and to have opened the bug report. I continue to watching this issue.

              Regards.

              Comment

              Working...