Ad Widget

Collapse

ZBX red status (timed out)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WebGreg
    Member
    • Feb 2021
    • 49

    #1

    ZBX red status (timed out)

    Hello Guys.

    I'm trying to install the first agent and I can't.

    Server=192.168.1.5 (the agent on it is working fine) - Ubuntu 20
    Host=192.168.1.128 - Windows 7

    But getting red status:

    Get value from agent failed: ZBX_TCP_READ() timed out


    1. Lets check if port 10050 is open: netstat -an | findstr 10050

    TCP 0.0.0.0:10050 0.0.0.0:0 LISTENING
    TCP [::]:10050 [::]:0 LISTENING

    2. Firewall and antivirus are disabled.

    3. From server: telnet 192.168.1.128 10050

    On the host side in agent log I get:

    failed to accept an incoming connection: from 192.168.1.5: reading first byte from connection failed: [0x0000274C] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

    4. On the server: sudo netstat -ntlp | grep LISTEN

    tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 881/zabbix_agentd
    tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 1159/zabbix_server
    tcp6 0 0 :::10050 :::* LISTEN 881/zabbix_agentd
    tcp6 0 0 :::10051 :::* LISTEN

    5. I have tried with the agent configuration in active and passive mode

    6. The agent in active mode gave me: netstat -an | findstr 10050

    TCP 0.0.0.0:10050 0.0.0.0:0 LISTENING
    TCP 10.0.5.0:10050 192.168.1.5:56862 SYN_RECEIVED
    TCP [::]:10050 [::]:0 LISTENING

    But status is still red and no data recived.



    Any hints?
  • WebGreg
    Member
    • Feb 2021
    • 49

    #2
    The agent in active mode works, but still with red status.

    By server side I tried with: nc -v -z 192.168.1.128 10050 command and:

    Connection to 192.168.1.128 10050 port [tcp/zabbix-agent] succeeded!

    Comment

    • Hamardaban
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • May 2019
      • 2713

      #3
      Read the documentation carefully - status is only relevant to passive checks
      It's good that you checked the port availability and traffic flow. Next, see what the server and agent will write to the logs when trying to establish a connection .

      Comment

      • WebGreg
        Member
        • Feb 2021
        • 49

        #4
        Yes I know. And I want it in passive mode but works for me only active. Sorry for my english. What I meant was that if in active works, then communication is OK - so why isn't it passive?
        I know there are differences in the direction of communication - what side initiating the connection and where what port needs to be opened. But I think the ports are open on both sides.

        I tried disable active mode and try only in passive but no diffrence.

        Log looks OK for me.


        HOST:
        6140:20210226:183508.912 using configuration file: C:\Program Files\Zabbix Agent\zabbix_agentd.conf
        6140:20210226:183510.046 agent #0 started [main process]
        2548:20210226:183510.048 agent #1 started [collector]
        11780:20210226:183510.049 agent #2 started[listener #1]
        11056:20210226:183510.050 agent #3 started[listener #2]
        8872:20210226:183510.051 agent #4 started[listener #3]
        12260:20210226:183510.052 agent #5 started[listener #4]
        4580:20210226:183510.053 agent #6 started[listener #5]

        before in active mode there was one line more:
        10316:20210226:143657.954 agent #7 started [active checks #1]

        SERVER:
        822:20210226:143555.376 active check configuration update from [127.0.0.1:10051] is working again
        823:20210226:143555.376 active check configuration update from [192.168.1.5:10051] is working again
        Last edited by WebGreg; 26-02-2021, 21:01.

        Comment

        • Hamardaban
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • May 2019
          • 2713

          #5
          Please show the frontend picture with the agent settings and the agent config text ( remove the comments!)

          Comment

          • WebGreg
            Member
            • Feb 2021
            • 49

            #6
            Click image for larger version

Name:	67753100f8ba3.jpg
Views:	2561
Size:	72.0 KB
ID:	419606



            HOST AGENT CONF:
            LogFile=C:\Program Files\Zabbix Agent\zabbix_agentd.log
            Server=192.168.1.5
            ServerActive=192.168.1.5
            Hostname=P2018-15-A
            Include=C:\Program Files\Zabbix Agent\zabbix_agentd.conf.d\

            SERVER CONF:
            LogFile=/var/log/zabbix/zabbix_server.log
            LogFileSize=100
            PidFile=/run/zabbix/zabbix_server.pid
            SocketDir=/run/zabbix
            DBName=zabbix
            DBUser=***********
            DBPassword=*********
            StartPollers=5
            StartPollersUnreachable=5
            CacheSize=128M
            HistoryCacheSize=1024M
            ValueCacheSize=128M
            Timeout=10
            StatsAllowedIP=127.0.0.1,192.168.1.128

            SERVER AGENT CONF
            LogFileSize=0
            Server=127.0.0.1,192.168.1.5,192.168.1.128
            ServerActive=127.0.0.1,192.168.1.5
            Hostname=Zabbix_server



            Comment

            • Hamardaban
              Senior Member
              Zabbix Certified SpecialistZabbix Certified Professional
              • May 2019
              • 2713

              #7
              in server.conf add SourceIP=192.168.1.5

              in host agent.conf add (for example)
              DenyKey=system.run[shutdown*]
              AllowKey=system.run[*]
              Last edited by Hamardaban; 27-02-2021, 06:11.

              Comment

              • WebGreg
                Member
                • Feb 2021
                • 49

                #8
                Originally posted by Hamardaban
                in server.conf add (...) in host agent.conf add
                I added - no change.

                Originally posted by cyber
                Server=127.0.0.1,192.168.1.5,192.168.1.128 in server agent conf... that .128 address, It does not hurt, but it should not be there...
                Yea... You know... whan I couldn't get a connection I started to mess I test every option that comes to my mind



                Please tell me if i'm wrong...

                1. ZBX is red because of passive mode.
                2. In passive mode, the server initiates a connection on port 10050.
                3. If I check from server side: nc -v -z host_ip 10050
                and I will get an answer:
                Connection to host_ip 10050 port [tcp/zabbix-agent] succeeded!
                It means that nothing block connection and if ZBX is red it exclude the problem with network - it have to be something in config?

                What does the status check? Some item? Maybe there is something wrong? I tired with "Windows by Zabbix agent active" and "Windows by Zabbix agent" templates.


                Edit: No latest value data for Zabbix agent - agent.ping.

                I tried with:
                Code:
                [B]# zabbix_get -k agent.ping -s TARGET_HOST[/B]
                and "Command 'zabbix_get' not found"

                Maybe this is the reason?

                Code:
                [B]# sudo apt install zabbix-get[/B]
                Now zabbix_get returns 1 from server command line, but still without the latest data value.

                Click image for larger version  Name:	ping.jpg Views:	0 Size:	45.1 KB ID:	419637

                And from host agent log (after "get value and test"):

                3612:20210227:200629.910 Requested [agent.ping]
                3612:20210227:200629.911 Sending back [1]
                5212:20210227:200630.387 In collect_perfstat()
                5212:20210227:200630.391 End of collect_perfstat()

                if the agent receives the request and sends a response why I get timed out?

                SOLVED - I changed TimeoutT=30 (before I had 10) in server.conf. But why does it take so long? Problem with server optimization?

                Number of processes [avg]: 197.3348
                Maximum number of processes [avg]: 4.19M
                Trigger: Configured max number of processes is too low (<1024)

                eth0 Bits recived [avg]: 123.78 Kbps
                eth0 Bits sent [avg]: 378.83 Kbps

                CPU Jumps:
                Context switches per second [avg]: 3.77K
                Interrupts per second [avg]: 669.9407
                Load average [15m avg]: 1.2748
                CPU utilization [avg]: 21.35 %
                CPU iowait time [avg]: 13.63 % (max: 46.34%)

                Free swap space [avg]: 3.83 GB

                Disk average queue size [avg]: 0.5 (max 3.5)
                Disk utilization [avg]: 45.93% (max: 99.36%)
                Read request avg waiting time [avg]: 11.08ms
                Write request avg waiting time [avg]: 3.5ms
                Read rate [avg]: 3.24 r/s (max: 153.35)
                Write rate [avg]: 249.75 w/s (1144.79)

                Memory utilization [max] 24%
                Last edited by WebGreg; 27-02-2021, 21:35.

                Comment

                • cyber
                  Senior Member
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Dec 2006
                  • 4807

                  #9
                  Server=127.0.0.1,192.168.1.5,192.168.1.128 in server agent conf... that .128 address, It does not hurt, but it should not be there...
                  And make up your mind, which interface you are going to use for servers agent config. Either localhost or real one... Confugure it in frontend accordingly and leave one IP in config. Having ListenIP parameter in server config helps to keep it also on one interface only.
                  Having multiple IP-s in config makes it check for config multiple times...

                  Comment

                  Working...