Ad Widget

Collapse

Zabbix Agent - cannot execute binary file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • markfree
    Senior Member
    • Apr 2019
    • 868

    #1

    Zabbix Agent - cannot execute binary file

    I have some legacy servers that require monitoring. Due the "locked" state of these servers, I can't use repositories or rpm packages.
    Code:
    # cat /etc/redhat-release
    CentOS release 5.10 (Final)
    # uname -sr
    Linux 2.6.18-371.el5PAE
    Code:
    # cat /etc/redhat-release
    Red Hat Linux release 8.0 (Psyche)
    # uname -sr
    Linux 2.4.18-14bigmem
    I was trying to install Zabbix Agent 6.2 on them using the pre-compiled binary, but I keep getting the "cannot execute binary file​" error.

    Code:
    # sh zabbix/sbin/zabbix_agentd -V
    zabbix/sbin/zabbix_agentd: zabbix/sbin/zabbix_agentd: cannot execute binary file
    Previously I was able to use Agent 4.4 with no issues, but the latest version won't start.
    I've tried the Zabbix Agent for Linux 2.4, 2.6 and 3.0 and all of them fail to execute.

    Any idea of how to debug that?​
    Last edited by markfree; 12-10-2022, 03:44.
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    #2
    Um, I don't think you should be running a binary with the shell executable (sh). How about just ./zabbix/sbin/zabbix_agentd?

    Markku

    Comment

    • markfree
      Senior Member
      • Apr 2019
      • 868

      #3
      I did try to start the Agent with relative and absolute paths, but none of that worked out.
      The sh from above was just my last attempt.

      Comment

      • Markku
        Senior Member
        Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
        • Sep 2018
        • 1781

        #4
        Did you already read/try these: https://superuser.com/questions/4359...te-binary-file

        Markku

        Comment

        • markfree
          Senior Member
          • Apr 2019
          • 868

          #5
          Thanks for your insight Markku . I forgot to check for the system arch.
          Both systems are i686.
          That was it.

          For the server with kernel 2.4, I had to use Agent 3.0 x32 binary and now it is working fine.

          But for server with kernel 2.6, using "zabbix_agent-6.2.3-linux-2.6-i386", it fails to start the agent.
          Code:
          # uname -srm
          Linux 2.6.18-371.el5PAE i686​
          The log points to a socket error.
          Code:
          20611:20221013:125140.235 Starting Zabbix Agent [PXL1CEASU002]. Zabbix 6.2.3 (revision 98ee88fc19d).
          20611:20221013:125140.235 **** Enabled features ****
          20611:20221013:125140.235 IPv6 support: NO
          20611:20221013:125140.235 TLS support: NO
          20611:20221013:125140.235 **************************
          20611:20221013:125140.235 using configuration file: /etc/zabbix/zabbix_agentd.conf
          20611:20221013:125140.235 In zbx_load_modules()
          20611:20221013:125140.235 End of zbx_load_modules():SUCCEED
          20611:20221013:125140.235 listener failed: socket() for [[-]:10050] failed: [22] Invalid argument
          20611:20221013:125140.236 In zbx_unload_modules()
          20611:20221013:125140.236 End of zbx_unload_modules()
          20611:20221013:125140.236 Zabbix Agent stopped. Zabbix 6.2.3 (revision 98ee88fc19d).​
          The agent kind of works, but won't start as process.
          Code:
          # zabbix_agentd -t system.hostname
          system.hostname [s|pxl1ceasu002]​
          I know the system is very old, but I can't update it.
          I've seen an old issue, but I'm not sure it is really related.

          Any idea on how to diagnose this error?
          Last edited by markfree; 13-10-2022, 17:54.

          Comment

          • Markku
            Senior Member
            Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
            • Sep 2018
            • 1781

            #6
            No other idea than if you don't need passive items, try StartAgents=0 in the agent configuration file.

            Markku

            Comment


            • markfree
              markfree commented
              Editing a comment
              Most items are passive.

            • Markku
              Markku commented
              Editing a comment
              Hmm, did you try that config anyway? I mean, if the reason for using passive items is firewall access, maybe you can add a passive proxy nearby and then change the items active, if that solves the executable problem.

              Markku
          • markosa
            Senior Member
            Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
            • Aug 2022
            • 104

            #7
            Just guessing... SELinux in use?

            Comment


            • markfree
              markfree commented
              Editing a comment
              SELinux is disabled.
              # getenforce
              Disabled
          • markfree
            Senior Member
            • Apr 2019
            • 868

            #8
            Hmm, did you try that config anyway? I mean, if the reason for using passive items is firewall access, maybe you can add a passive proxy nearby and then change the items active, if that solves the executable problem.
            If disabling passive checks, the agents starts. Still, the agent is not capable of reaching the proxy.
            Code:
            # zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
            # ps -ef | grep zabbix
            zabbix 31857 1 0 08:18 ? 00:00:00 zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
            zabbix 31858 31857 0 08:18 ? 00:00:00 zabbix_agentd: collector [idle 1 sec]
            zabbix 31859 31857 0 08:18 ? 00:00:00 zabbix_agentd: active checks #1 [idle 1 sec]​​
            Code:
            31857:20221014:081813.287 Starting Zabbix Agent [PXL1CEASU002]. Zabbix 6.2.3 (revision 98ee88fc19d).
            31857:20221014:081813.287 **** Enabled features ****
            31857:20221014:081813.287 IPv6 support: NO
            31857:20221014:081813.287 TLS support: NO
            31857:20221014:081813.287 **************************
            31857:20221014:081813.287 using configuration file: /etc/zabbix/zabbix_agentd.conf
            31857:20221014:081813.287 agent #0 started [main process]
            31858:20221014:081813.287 agent #1 started [collector]
            31859:20221014:081813.288 agent #2 started [active checks #1]
            31859:20221014:081813.289 Unable to connect to [10.8.6.11]:10051 [cannot create socket [[10.8.6.11]:10051]: [22] Invalid argument]
            31859:20221014:081813.289 Unable to send heartbeat message to [10.8.6.11]:10051 [cannot create socket [[10.8.6.11]:10051]: [22] Invalid argument]
            31859:20221014:081813.289 Unable to connect to [10.8.6.11]:10051 [cannot create socket [[10.8.6.11]:10051]: [22] Invalid argument]
            31859:20221014:081813.289 Active check configuration update started to fail


            But I don't get it. Why is it failing to start a socket?
            Code:
            listener failed: socket() for [[-]:10050] failed: [22] Invalid argument​
            I could not find any access restrictions.
            Last edited by markfree; 14-10-2022, 13:34.

            Comment

          • markfree
            Senior Member
            • Apr 2019
            • 868

            #9
            Check this: https://support.zabbix.com/browse/ZBX-3395 found that via: https://www.reddit.com/r/zabbix/comm...td_cant_start/
            reddit discussion sounds like what you are experiencing.​
            I've seen that issue tracker, and it is closed as "Won't fix​" unfortunately.
            It seems the socket won't open due to the old RHEL kernel.
            Last edited by markfree; 14-10-2022, 15:21.

            Comment

            • markfree
              Senior Member
              • Apr 2019
              • 868

              #10
              Using an Auto Registration action with HostMetadata, the Server actually created the host but could not establish a communication.
              Code:
              $ grep -v "^#" /etc/zabbix/zabbix_agentd.conf | grep .
              LogFile=/tmp/zabbix_agentd.log
              LogFileSize=10
              StartAgents=0
              ServerActive=10.8.6.11
              Hostname=PXL1CEASU017
              HostMetadata=linux proxy_bsb​
              There are no other processes using Zabbix ports.
              If I start a listening socket using NetCat, I'm able to start a connection and transfer messages with no issues.
              Code:
              # HOST:
              $ nc -l 172.24.168.97 10050
              message # received
              Code:
              # PROXY
              $ nc 172.24.168.97 10050
              message # sent
              Also, I was able to start a passive Agent at another identical server, with the same Distro, same version and same kernel, and had no issues at all.​

              Comment

              Working...