[ZBX-13393] Zabbix agent does not compile on AlphaServer Tru64 5.1B Created: 2018 Jan 25  Updated: 2024 Apr 10  Resolved: 2018 Jul 23

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 3.0.14
Fix Version/s: 3.0.20rc1, 3.4.12rc1, 4.0.0alpha9, 4.0 (plan)

Type: Problem report Priority: Trivial
Reporter: Andris Mednis Assignee: Andris Mednis
Resolution: Fixed Votes: 0
Labels: compilation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

AlphaServer Tru64 5.1B


Team: Team A
Sprint: Sprint 33, Sprint 34, Sprint 35, Sprint 36, Sprint 37, Sprint 39
Story Points: 2

 Description   
$ ./configure --enable-agent
$ make
...
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


 Comments   
Comment by Andris Mednis [ 2018 Jan 25 ]

This issue was created from https://www.zabbix.com/forum/showthread.php?t=60506

Comment by Andris Mednis [ 2018 Jan 25 ]

Compiling cpu.c can be fixed with patch:

Index: src/libs/zbxsysinfo/osf/cpu.c
===================================================================
--- src/libs/zbxsysinfo/osf/cpu.c	(revision 77102)
+++ src/libs/zbxsysinfo/osf/cpu.c	(working copy)
@@ -96,7 +96,7 @@
 	else if (0 == strcmp(tmp, "avg5"))
 		ret = EXECUTE_DBL("uptime | awk '{printf(\"%s\", $(NF-1))}' | sed 's/[ ,]//g'", result);
 	else if (0 == strcmp(tmp, "avg15"))
-		ret = EXECUTE_DBL(cmd, "uptime | awk '{printf(\"%s\", $(NF-2))}' | sed 's/[ ,]//g'", result);
+		ret = EXECUTE_DBL("uptime | awk '{printf(\"%s\", $(NF-2))}' | sed 's/[ ,]//g'", result);
 	else
 	{
 		SET_MSG_RESULT(result, zbx_strdup(NULL, "Invalid second parameter."));
Comment by Andris Mednis [ 2018 Jan 25 ]

Next issue is proc.c:

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
Comment by Andris Mednis [ 2018 Jan 25 ]

Compiling proc.c can be fixed with patch:

Index: src/libs/zbxsysinfo/osf/proc.c
===================================================================
--- src/libs/zbxsysinfo/osf/proc.c	(revision 77102)
+++ src/libs/zbxsysinfo/osf/proc.c	(working copy)
@@ -17,6 +17,7 @@
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 **/
 
+#include <sys/procfs.h>
 #include "common.h"
 #include "sysinfo.h"
 #include "zbxregexp.h"
Comment by Andris Mednis [ 2018 Jan 25 ]

Then an issue with swap.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);
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
Comment by Andris Mednis [ 2018 May 08 ]

Compiling swap.c probably could be fixed with patch:

Index: src/libs/zbxsysinfo/osf/swap.c
===================================================================
--- src/libs/zbxsysinfo/osf/swap.c      (revision 80505)
+++ src/libs/zbxsysinfo/osf/swap.c      (revision 80506)
@@ -188,7 +188,7 @@

         init_result(&result_tmp);

-       if (SYSINFO_RET_OK != SYSTEM_SWAP_TOTAL(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
+       if (SYSINFO_RET_OK != SYSTEM_SWAP_TOTAL(&result_tmp) || !(result_tmp.type & AR_UINT64))
                return SYSINFO_RET_FAIL;
        tot_val = result_tmp.ui64;

@@ -199,7 +199,7 @@
                return SYSINFO_RET_FAIL;
        }

-       if (SYSINFO_RET_OK != SYSTEM_SWAP_FREE(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
+       if (SYSINFO_RET_OK != SYSTEM_SWAP_FREE(&result_tmp) || !(result_tmp.type & AR_UINT64))
                return SYSINFO_RET_FAIL;
        free_val = result_tmp.ui64;

@@ -218,7 +218,7 @@

         init_result(&result_tmp);

-       if (SYSINFO_RET_OK != SYSTEM_SWAP_TOTAL(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
+       if (SYSINFO_RET_OK != SYSTEM_SWAP_TOTAL(&result_tmp) || !(result_tmp.type & AR_UINT64))
                return SYSINFO_RET_FAIL;
        tot_val = result_tmp.ui64;

@@ -229,7 +229,7 @@
                return SYSINFO_RET_FAIL;
        }

-       if (SYSINFO_RET_OK != SYSTEM_SWAP_FREE(cmd, param, flags, &result_tmp) || !(result_tmp.type & AR_UINT64))
+       if (SYSINFO_RET_OK != SYSTEM_SWAP_FREE(&result_tmp) || !(result_tmp.type & AR_UINT64))
                return SYSINFO_RET_FAIL;
        free_val = result_tmp.ui64;
Comment by Andris Mednis [ 2018 May 08 ]

cdany2000, could you test compilation with swap.c patch ? All 3 patches are included in development branch svn://svn.zabbix.com/branches/dev/ZBX-13393, based on current 3.0.

Just ask, if some help is needed.

Comment by Dany Cote [ 2018 May 14 ]

Thanks alot Andris,

 

Sorry I am relatively busy for now, but I will try your modificaiton on the next days ( or next week )  and back to you with the result.

Regards.

Comment by Andris Mednis [ 2018 May 14 ]

Thanks, Dany!

Great.

Comment by Bruno Miretti [ 2018 Jul 19 ]

Hi,

I faced these issues too on Tru64 V5.1B. I tried the workarounds mentioned here and then I can confirm the compilation worked fine.

Thanks a lot.

Bruno

Comment by Andris Mednis [ 2018 Jul 20 ]

Thanks, Bruno!

Nice to hear

Comment by Andris Mednis [ 2018 Jul 20 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-13393 (for 3.0).

Comment by Andris Mednis [ 2018 Jul 20 ]

Available in versions:

  • pre-3.0.20rc1 r82880
  • pre-3.4.12rc1 r82881
  • pre-4.0.0alpha9 (trunk) r82882
Comment by Andris Mednis [ 2018 Jul 20 ]

No documentation changes required.

Generated at Sat Apr 27 07:54:02 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.