Ad Widget

Collapse

Compiling Zabbix agent 2 on AIX

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabbaix
    Junior Member
    • Jan 2013
    • 5

    #1

    Compiling Zabbix agent 2 on AIX

    Has anyone successfully compiled from source Agent2 on AIX?
    If so, please share how.

    Here is how far I have come trying to compile it.

    My environment:
    AIX 7200-03-03-1914
    gcc (GCC) 8.3.0
    go version go1.14.7 aix/ppc64
    zabbix-5.0.4 sources

    export OBJECT_MODE=64

    CFLAGS=-maix64 ./configure --enable-agent2 --with-libpcre=/opt/freeware



    Configure script successfully finished:

    Configuration:

    Detected OS: aix7.2.3.0
    Install path: /usr/local
    Compilation arch: aix

    Compiler: /app/zabbix-5/zabbix-5.0.4/compile gcc
    Compiler flags: -maix64 -I/opt/freeware/include

    Library-specific flags:

    Enable server: no

    Enable proxy: no

    Enable agent: no

    Enable agent 2: yes

    Enable Java gateway: no

    LDAP support: no
    IPv6 support: no

    ---------------------------------

    Then I run make and had to edit "src/go/Makefile.am" to solve some minor problems (unterminated ' string etc.):

    #diff Makefile.am.orig Makefile.am
    < BUILD_TIME=`date +%H:%M:%S`
    < BUILD_DATE=`date +"%b %_d %Y"`
    ---
    > BUILD_TIME=`date +"%H:%M:%S"`
    > BUILD_DATE=`date +"%b %d %Y"`
    12c12
    < GOLDFLAGS += -X '${PKG}.compileDate=${BUILD_DATE}'
    ---
    > GOLDFLAGS += -X ${PKG}.compileDate=${BUILD_DATE}



    I have re-run make and now I am stucked here:

    /app/zabbix-5/zabbix-5.0.4/compile gcc -DZABBIX_DAEMON -DDEFAULT_CONFIG_FILE=""/usr/local/etc/zabbix_agentd.conf"" -DDEFAULT_LOAD_MODULE_PATH=""/usr/local/lib/modules"" -maix64 -I/opt/freeware/include -L/opt/freeware/lib -o zabbix_agentd zabbix_agentd-zabbix_agentd.o libzbxagent.a logfiles/libzbxlogfiles.a ../../src/libs/zbxsysinfo/libzbxagentsysinfo.a ../../src/libs/zbxsysinfo/aix/libspecsysinfo.a ../../src/libs/zbxsysinfo/aix/libspechostnamesysinfo.a ../../src/libs/zbxsysinfo/agent/libagentsysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxregexp/libzbxregexp.a ../../src/libs/zbxalgo/libzbxalgo.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxcomms/libzbxcomms.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxjson/libzbxjson.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcrypto/libzbxcrypto.a ../../src/libs/zbxexec/libzbxexec.a ../../src/libs/zbxcompress/libzbxcompress.a ../../src/libs/zbxmodules/libzbxmodules.a ../../src/libs/zbxhttp/libzbxhttp.a -lm -lperfstat -lpcre -liconv
    ld: 0711-224 WARNING: Duplicate symbol: Hyp_Name
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    ld: 0711-224 WARNING: Duplicate symbol: Hyp_Name
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    Target "all-am" is up to date.
    Target "all" is up to date.
    Making all in go
    CGO_CFLAGS="" CGO_LDFLAGS="/app/zabbix-5/zabbix-5.0.4/src/zabbix_agent/logfiles/libzbxlogfiles.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxcomms/libzbxcomms.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxcommon/libzbxcommon.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxcrypto/libzbxcrypto.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxsys/libzbxsys.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxnix/libzbxnix.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxconf/libzbxconf.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxhttp/libzbxhttp.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxcompress/libzbxcompress.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxregexp/libzbxregexp.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxsysinfo/libzbxagent2sysinfo.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxsysinfo/common/libcommonsysinfo.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxsysinfo/simple/libsimplesysinfo.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxsysinfo/aix/libspechostnamesysinfo.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxsysinfo/aix/libspecsysinfo.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxexec/libzbxexec.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxalgo/libzbxalgo.a /app/zabbix-5/zabbix-5.0.4/src/libs/zbxjson/libzbxjson.a -lm -lperfstat -lpcre -liconv " go build -ldflags="-X zabbix.com/pkg/version.titleMessage=zabbix_agent2 -X zabbix.com/pkg/version.compileDate=`date +"%b %d %Y"` -X zabbix.com/pkg/version.compileTime=`date +"%H:%M:%S"` -X zabbix.com/pkg/version.compileOs=`go env GOOS` -X zabbix.com/pkg/version.compileArch=`go env GOARCH` -X main.confDefault=/usr/local/etc/zabbix_agent2.conf" -o bin ./...
    /bin/sh: -X: not found.
    /bin/sh: -X: not found.
    /bin/sh: -X: not found.
    /bin/sh: -X: not found.
    go: downloading github.com/fsnotify/fsnotify v1.4.9
    go: downloading github.com/memcachier/mc/v3 v3.0.1
    go: downloading github.com/dustin/gomemcached v0.0.0-20160817010731-a2284a01c143
    go: downloading golang.org/x/sys v0.0.0-20200428200454-593003d681fa
    go: downloading github.com/go-sql-driver/mysql v1.5.0
    go: downloading github.com/godbus/dbus v4.1.0+incompatible
    go: downloading github.com/go-ole/go-ole v1.2.4
    go: downloading github.com/mattn/go-sqlite3 v2.0.3+incompatible
    go: downloading github.com/jackc/pgx v3.6.2+incompatible
    go: downloading github.com/go-ldap/ldap v3.0.3+incompatible
    go: downloading github.com/godror/godror v0.19.4
    go: downloading github.com/omeid/go-yarn v0.0.1
    go: downloading github.com/mediocregopher/radix/v3 v3.5.0
    go: downloading gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d
    go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
    go: downloading github.com/go-logfmt/logfmt v0.5.0
    go: downloading github.com/jackc/pgx/v4 v4.6.0
    go: downloading github.com/jackc/puddle v1.1.0
    go: downloading github.com/jackc/pgconn v1.5.0
    go: downloading github.com/jackc/pgproto3 v1.1.0
    go: downloading github.com/jackc/pgio v1.0.0
    go: downloading github.com/jackc/pgtype v1.3.0
    go: downloading github.com/jackc/pgpassfile v1.0.0
    go: downloading github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8
    go: downloading github.com/jackc/chunkreader v1.0.0
    go: downloading golang.org/x/text v0.3.2
    go: downloading golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59
    go: downloading github.com/jackc/pgproto3/v2 v2.0.1
    go: downloading github.com/jackc/chunkreader/v2 v2.0.1
    can't load package: package %d is not in GOROOT (/opt/freeware/lib/golang/src/%d)
    can't load package: package %Ydate +%H:%M:%Sgo env GOOSgo env GOARCH is not in GOROOT (/opt/freeware/lib/golang/src/%Ydate +%H:%M:%Sgo env GOOSgo env GOARCH)
    can't load package: package -o is not in GOROOT (/opt/freeware/lib/golang/src/-o)
    can't load package: package bin is not in GOROOT (/opt/freeware/lib/golang/src/bin)
    cmd/zabbix_agent2/zabbix_agent2.go:31:2: build constraints exclude all Go files in /app/zabbix-5/zabbix-5.0.4/src/go/plugins
    make: 1254-004 The error code from the last command is 1.


    Stop.
    make: 1254-004 The error code from the last command is 1.


    Stop.
    make: 1254-004 The error code from the last command is 1.


    Stop.


    Please advise how to solve this.
    I will provide any additional information if needed.
    Thank you!
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    Are you using the AIX 'make' command, or GNU make (gmake)?

    If you're not using GNU make, I recommend you try a clean build (re-extract the source code, don't start with the files that have already been modified) with GNU make.

    Comment

    • zabbaix
      Junior Member
      • Jan 2013
      • 5

      #3
      Originally posted by tim.mooney
      Are you using the AIX 'make' command, or GNU make (gmake)?

      If you're not using GNU make, I recommend you try a clean build (re-extract the source code, don't start with the files that have already been modified) with GNU make.
      I have re-extracted the source and tried building afresh using GNU make - no go

      #make --version
      GNU Make 4.2.1
      Built for powerpc-ibm-aix6.1.9.0
      Copyright (C) 1988-2016 Free Software Foundation, Inc.
      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.

      #make
      Making all in src
      make[1]: Entering directory '/app/zabbix-5/zabbix-5.0.4/src'
      Making all in libs
      make[2]: Entering directory '/app/zabbix-5/zabbix-5.0.4/src/libs'
      Making all in zbxcrypto
      make[3]: Entering directory '/app/zabbix-5/zabbix-5.0.4/src/libs/zbxcrypto'
      /app/zabbix-5/zabbix-5.0.4/compile gcc -DHAVE_CONFIG_H -I. -I../../../include -maix64 -I/opt/freeware/include -MT libzbxcrypto_a-base64.o -MD -MP -MF .deps/libzbxcrypto_a-base64.Tpo -c -o libzbxcrypto_a-base64.o `test -f 'base64.c' || echo './'`base64.c
      mv -f .deps/libzbxcrypto_a-base64.Tpo .deps/libzbxcrypto_a-base64.Po
      /app/zabbix-5/zabbix-5.0.4/compile gcc -DHAVE_CONFIG_H -I. -I../../../include -maix64 -I/opt/freeware/include -MT libzbxcrypto_a-md5.o -MD -MP -MF .deps/libzbxcrypto_a-md5.Tpo -c -o libzbxcrypto_a-md5.o `test -f 'md5.c' || echo './'`md5.c
      mv -f .deps/libzbxcrypto_a-md5.Tpo .deps/libzbxcrypto_a-md5.Po
      /app/zabbix-5/zabbix-5.0.4/compile gcc -DHAVE_CONFIG_H -I. -I../../../include -maix64 -I/opt/freeware/include -MT libzbxcrypto_a-tls.o -MD -MP -MF .deps/libzbxcrypto_a-tls.Tpo -c -o libzbxcrypto_a-tls.o `test -f 'tls.c' || echo './'`tls.c
      mv -f .deps/libzbxcrypto_a-tls.Tpo .deps/libzbxcrypto_a-tls.Po
      /app/zabbix-5/zabbix-5.0.4/compile gcc -DHAVE_CONFIG_H -I. -I../../../include -maix64 -I/opt/freeware/include -MT libzbxcrypto_a-tls_version.o -MD -MP -MF .deps/libzbxcrypto_a-tls_version.Tpo -c -o libzbxcrypto_a-tls_version.o `test -f 'tls_version.c' || echo './'`tls_version.c
      mv -f .deps/libzbxcrypto_a-tls_version.Tpo .deps/libzbxcrypto_a-tls_version.Po
      rm -f libzbxcrypto.a
      ar cru libzbxcrypto.a libzbxcrypto_a-base64.o libzbxcrypto_a-md5.o libzbxcrypto_a-tls.o libzbxcrypto_a-tls_version.o
      ranlib libzbxcrypto.a
      ar: Error 0
      ar: 0707-106 Internal error while reading the fixed
      header of archive file libzbxcrypto.a.
      ranlib: 0654-601 Execution of ar failed
      Usage: ranlib [-t] [-X {32|64|32_64}] [--] file ...
      make[3]: *** [Makefile:442: libzbxcrypto.a] Error 1
      make[3]: Leaving directory '/app/zabbix-5/zabbix-5.0.4/src/libs/zbxcrypto'
      make[2]: *** [Makefile:526: all-recursive] Error 1
      make[2]: Leaving directory '/app/zabbix-5/zabbix-5.0.4/src/libs'
      make[1]: *** [Makefile:494: all-recursive] Error 1
      make[1]: Leaving directory '/app/zabbix-5/zabbix-5.0.4/src'
      make: *** [Makefile:533: all-recursive] Error 1


      libzbxcrypto.a seems empty:
      #cat libzbxcrypto.a
      !<arch>



      Any suggestions?

      Comment

      Working...