Ad Widget

Collapse

Problem with zabbix_sender

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DonnEdwards
    Junior Member
    • Feb 2011
    • 19

    #1

    Problem with zabbix_sender

    Hi all

    I am running zabbix_agentd in my Windows Vista laptop. It connects correctly to the server, and the agent reports data correctly.

    However, when I run the zabbix_sender application, I get the following error:

    Code:
    zabbix_sender [808]: DEBUG: Send value error: *** Cannot connect to [192.10.10.25]:10051 [No connection could be made because the target machine actively refused it.]
    The command I ran was:
    Code:
    zabbix_sender -k "TrueCrypt" -o "Loaded" -c "c:\program files\zabbix\zabbix_agentd.win.conf" -vv
    Here is the Debug level 4 log for the agent:
    Code:
    6032:20110224:123633.715 Zabbix Agent started. Zabbix 1.8.3 (revision 13926).
      6032:20110224:123633.746 In init_perf_collector()
      6032:20110224:123633.746 cfg: para: [DebugLevel] val [4]
      6032:20110224:123633.746 cfg: para: [LogFile] val [c:\temp\zabbix_agentd.log]
      6032:20110224:123633.746 cfg: para: [Server] val [192.10.10.25]
      6032:20110224:123633.746 cfg: para: [Hostname] val [THINKER]
      6032:20110224:123633.746 cfg: para:[ListenPort] val [10050]
      6032:20110224:123633.746 cfg: para:[ListenIP] val [192.10.10.92]
      6032:20110224:123633.746 cfg: para: [ServerPort] val [10051]
      3792:20110224:123633.746 zabbix_agentd collector started
      5656:20110224:123633.746 zabbix_agentd listener started
      3816:20110224:123633.746 zabbix_agentd listener started
      2304:20110224:123633.746 zabbix_agentd listener started
      5116:20110224:123633.762 zabbix_agentd active check started [192.10.10.25:10051]
      3792:20110224:123633.762 In init_cpu_collector()
      5116:20110224:123633.762 In init_active_metrics()
      3792:20110224:123633.762 In GetCounterName() pdhIndex:238
      5116:20110224:123633.762 Buffer: first allocation for 100 elements
      5116:20110224:123633.762 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123633.762 End of send_buffer():SUCCEED
      5116:20110224:123633.762 refresh_active_checks('192.10.10.25',10051)
      3792:20110224:123633.809 In GetCounterName() pdhIndex:6
      3792:20110224:123633.809 In GetCounterName() pdhIndex:2
      3792:20110224:123633.809 In GetCounterName() pdhIndex:44
      3792:20110224:123633.809 In collect_cpustat()
      5116:20110224:123634.776 [B]Get active checks error: *** Cannot connect to [192.10.10.25]:10051 [No connection could be made because the target machine actively refused it.][/B]
      5116:20110224:123634.776 In process_active_checks('192.10.10.25',10051)
      5116:20110224:123634.776 In get_min_nextcheck()
      5116:20110224:123634.776 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123634.776 End of send_buffer():SUCCEED
      5116:20110224:123634.776 Sleeping for 1 seconds
      3792:20110224:123634.823 In collect_cpustat()
      2304:20110224:123635.696 Processing request.
      2304:20110224:123635.696 Requested [vm.memory.size[free]]
      2304:20110224:123635.696 Sending back [341786624]
      5116:20110224:123635.790 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123635.790 End of send_buffer():SUCCEED
      5116:20110224:123635.790 Sleeping for 1 seconds
      3792:20110224:123635.837 In collect_cpustat()
      5116:20110224:123636.804 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123636.804 End of send_buffer():SUCCEED
      5116:20110224:123636.804 Sleeping for 1 seconds
      3792:20110224:123636.851 In collect_cpustat()
      5116:20110224:123637.818 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123637.818 End of send_buffer():SUCCEED
      5116:20110224:123637.818 Sleeping for 1 seconds
      3792:20110224:123637.865 In collect_cpustat()
      5116:20110224:123638.832 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123638.832 End of send_buffer():SUCCEED
      5116:20110224:123638.832 Sleeping for 1 seconds
      3792:20110224:123638.879 In collect_cpustat()
      5116:20110224:123639.846 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123639.846 End of send_buffer():SUCCEED
      5116:20110224:123639.846 Sleeping for 1 seconds
      3792:20110224:123639.893 In collect_cpustat()
      5116:20110224:123640.860 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123640.860 End of send_buffer():SUCCEED
      5116:20110224:123640.860 Sleeping for 1 seconds
      3792:20110224:123640.907 In collect_cpustat()
      5116:20110224:123641.874 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123641.874 End of send_buffer():SUCCEED
      5116:20110224:123641.874 Sleeping for 1 seconds
      3792:20110224:123641.921 In collect_cpustat()
      5116:20110224:123642.888 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123642.888 End of send_buffer():SUCCEED
      5116:20110224:123642.888 Sleeping for 1 seconds
      3792:20110224:123642.935 In collect_cpustat()
      5116:20110224:123643.902 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123643.902 End of send_buffer():SUCCEED
      5116:20110224:123643.902 Sleeping for 1 seconds
      3792:20110224:123643.949 In collect_cpustat()
      5116:20110224:123644.916 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123644.916 End of send_buffer():SUCCEED
      5116:20110224:123644.916 Sleeping for 1 seconds
      3792:20110224:123644.963 In collect_cpustat()
      5116:20110224:123645.930 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123645.930 End of send_buffer():SUCCEED
      5116:20110224:123645.930 Sleeping for 1 seconds
      3792:20110224:123645.977 In collect_cpustat()
      5116:20110224:123646.944 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123646.944 End of send_buffer():SUCCEED
      5116:20110224:123646.944 Sleeping for 1 seconds
      3792:20110224:123646.991 In collect_cpustat()
      5116:20110224:123647.958 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123647.958 End of send_buffer():SUCCEED
      5116:20110224:123647.958 Sleeping for 1 seconds
      3792:20110224:123648.005 In collect_cpustat()
      5116:20110224:123648.972 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123648.972 End of send_buffer():SUCCEED
      5116:20110224:123648.972 Sleeping for 1 seconds
      3792:20110224:123649.019 In collect_cpustat()
      5116:20110224:123649.986 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123649.986 End of send_buffer():SUCCEED
      5116:20110224:123649.986 Sleeping for 1 seconds
      3792:20110224:123650.033 In collect_cpustat()
      3816:20110224:123650.750 Processing request.
      3816:20110224:123650.750 Requested [vm.memory.size[free]]
      3816:20110224:123650.750 Sending back [341856256]
      5116:20110224:123651.000 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123651.000 End of send_buffer():SUCCEED
      5116:20110224:123651.000 Sleeping for 1 seconds
      3792:20110224:123651.047 In collect_cpustat()
      5116:20110224:123652.014 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123652.014 End of send_buffer():SUCCEED
      5116:20110224:123652.014 Sleeping for 1 seconds
      3792:20110224:123652.061 In collect_cpustat()
      5116:20110224:123653.028 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123653.028 End of send_buffer():SUCCEED
      5116:20110224:123653.028 Sleeping for 1 seconds
      3792:20110224:123653.075 In collect_cpustat()
      5656:20110224:123654.026 Processing request.
      5656:20110224:123654.026 Requested [vfs.fs.size[c:,free]]
      5656:20110224:123654.026 Sending back [9812262912]
      5116:20110224:123654.042 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123654.042 End of send_buffer():SUCCEED
      5116:20110224:123654.042 Sleeping for 1 seconds
      3792:20110224:123654.089 In collect_cpustat()
      5116:20110224:123655.056 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123655.056 End of send_buffer():SUCCEED
      5116:20110224:123655.056 Sleeping for 1 seconds
      3792:20110224:123655.103 In collect_cpustat()
      5656:20110224:123656.039 Processing request.
      5656:20110224:123656.039 Requested [vm.memory.size[free]]
      5656:20110224:123656.039 Sending back [341819392]
      5116:20110224:123656.070 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123656.070 End of send_buffer():SUCCEED
      5116:20110224:123656.070 Sleeping for 1 seconds
      3792:20110224:123656.117 In collect_cpustat()
      5116:20110224:123657.084 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123657.084 End of send_buffer():SUCCEED
      5116:20110224:123657.084 Sleeping for 1 seconds
      3792:20110224:123657.131 In collect_cpustat()
      5116:20110224:123658.098 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123658.098 End of send_buffer():SUCCEED
      5116:20110224:123658.098 Sleeping for 1 seconds
      3792:20110224:123658.145 In collect_cpustat()
      5116:20110224:123659.112 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123659.112 End of send_buffer():SUCCEED
      5116:20110224:123659.112 Sleeping for 1 seconds
      3792:20110224:123659.159 In collect_cpustat()
      3816:20110224:123700.048 Processing request.
      3816:20110224:123700.048 Requested [agent.ping]
      3816:20110224:123700.048 Sending back [1]
      5116:20110224:123700.126 In send_buffer() host:'192.10.10.25' port:10051 values:0/100
      5116:20110224:123700.126 End of send_buffer():SUCCEED
      5116:20110224:123700.126 Sleeping for 1 seconds
      3792:20110224:123700.173 In collect_cpustat()
    FWIW, 192.10.10.25 is the Zabbix server. It is running Ubuntu 10.04 Server LTS, and the firewall is off. If I telnet to the server I can get the following:

    Code:
    sudo netstat -ntpl | grep zabbix
    tcp        0      0 127.0.0.1:10050         0.0.0.0:*               LISTEN      10111/zabbix_agentd
    tcp        0      0 127.0.0.1:10051         0.0.0.0:*               LISTEN      10131/zabbix_server
    Why is the server blocking the connection?

    I have been following the example on page 298 of "Zabbix 1.8 Network Monitoring" by Richard Olups
  • untergeek
    Senior Member
    Zabbix Certified Specialist
    • Jun 2009
    • 512

    #2
    Um. It would appear that you're listening on localhost:10051. In order for the agent to talk to the server it needs to be on a legitimate IP address, not a loop-back one.

    Try reconfiguring your zabbix_server.conf with ListenIP commented out or set to 0.0.0.0, e.g. ListenIP=0.0.0.0

    My netstat looks like this:

    Code:
    $ netstat -na | grep LIST | grep 1005
    tcp        0      0 0.0.0.0:10050               0.0.0.0:*                   LISTEN      
    tcp        0      0 0.0.0.0:10051               0.0.0.0:*                   LISTEN
    Last edited by untergeek; 24-02-2011, 21:18. Reason: Added netstat output

    Comment

    • DonnEdwards
      Junior Member
      • Feb 2011
      • 19

      #3
      Many thanks. This has fixed a number of other problems I have been scratching my head over too.

      Comment

      • jasonjackson
        Junior Member
        • Dec 2011
        • 1

        #4
        Sender problem, unrelated to other posts I've found.

        i seem to be unable to get zabbix_sender to work. always returns:

        Code:
        "Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.000086""
        ive read pretty much everything i could find online, and all of my hostnames match up. i just set up a little test on a vm with the latest version of zabbix, and im seeing the same issue. im running logs in debug mode 4 on the server and the client, and i dont see anything that really gives an indication

        Server log:

        Code:
        29260:20111215:204938.981 Trapper got [{
                "request":"sender data",
                "data":[
                        {
                                "host":"127.0.0.1",
                                "key":"system.run[\/data\/check.sh]",
                                "value":"95.0"}]}] len 197
         29260:20111215:204938.981 In recv_agenthistory()
         29260:20111215:204938.981 In process_hist_data()
         29260:20111215:204938.981 In process_mass_data()
         29260:20111215:204938.981 End of process_mass_data()
         29260:20111215:204938.981 End of process_hist_data():SUCCEED
         29260:20111215:204938.981 In zbx_send_response()
         29260:20111215:204938.982 zbx_send_response() '{
                "response":"success",
                "info":"Processed 0 Failed 1 Total 1 Seconds spent 0.000206"}'
         29260:20111215:204938.982 End of zbx_send_response():SUCCEED
         29260:20111215:204938.982 End of recv_agenthistory()
         29294:20111215:204939.655 In collect_selfmon_stats()
         29294:20111215:204939.655 End of collect_selfmon_stats()
         29294:20111215:204939.655 sleeping for 1 seconds
        ive tried using 127.0.0.1, localhost, and centos.local with a host file entry to make it work. telnet can connect to 10050 / 10051 fine, seems the message is received, but the processing of it is failing. my zabbix_sender command is: (ive tried all combinations of -s name. localhost, centos01.local, etc)

        Code:
        zabbix_sender -z 127.0.0.1 -s "Zabbbix server" -k system.run[/data/check.sh] -o 2
        Command output:

        Code:
        [root@centos01]# zabbix_sender -z 127.0.0.1 -s "Zabbbix server" -k system.run[/data/check.sh] -o 2
        zabbix_sender [19613]: DEBUG: answer [{
                "response":"success",
                "info":"Processed 0 Failed 1 Total 1 Seconds spent 0.000045"}]
        Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.000045"
        sent: 1; skipped: 0; total: 1
        i have also set up a service_state[httpd] of type trapper and a few other of the regular checks that ship with the zabbix server, all of these produce the
        same result.

        the server and agent are working fine in all other aspects, only having issues with zabbix_sender. item looks OK, is of type trapper. tried all of the different information / data types (numeric, unsigned, etc), key is correct. running the script as root, permissions are OK. centos 5.5, zabbix 1.8.9.

        Netstat:

        Code:
        [root@centos01 ~]# netstat -na | grep LIST | grep 1005
        tcp        0      0 0.0.0.0:10050               0.0.0.0:*                   LISTEN
        tcp        0      0 0.0.0.0:10051               0.0.0.0:*                   LISTEN
        A screen capture of my item:



        Also tried removing allowed hosts so its blank, but still errors.

        any thoughts?
        Last edited by jasonjackson; 16-12-2011, 08:15. Reason: Feedback from Richlv on IRC

        Comment

        • pdwalker
          Senior Member
          • Dec 2005
          • 166

          #5
          Did you ever get this one resolved?

          I'm having the same problem, and there seems to be no way to find out just why it failed.

          It's annoying.

          Comment

          • pdwalker
            Senior Member
            • Dec 2005
            • 166

            #6
            Some more information:

            From the host side:
            Code:
            $ zabbix_sender -vv -z <zabbix-server> -s <myhost> -k unknownTriggersCount -o 0
            zabbix_sender [22170]: DEBUG: answer [{
            	"response":"success",
            	"info":"Processed 0 Failed 1 Total 1 Seconds spent 0.000092"}]
            Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.000092"
            sent: 1; skipped: 0; total: 1
            From the zabbix server side (Debug=4)
            Code:
             22129:20120316:112808.364 Trapper got [{ 
                    "request":"sender data", 
                    "data":[
                            {
                                    "host":"obcorp.so1",
                                    "key":"unknownTriggersCount",
                                    "value":"0"}]}] len 116
             22129:20120316:112808.364 In recv_agenthistory()
             22129:20120316:112808.364 In process_hist_data()
             22129:20120316:112808.365 In process_mass_data()
             22129:20120316:112808.365 End of process_mass_data()
             22129:20120316:112808.365 End of process_hist_data():SUCCEED
             22129:20120316:112808.365 In zbx_send_response()
             22129:20120316:112808.365 zbx_send_response() '{
                    "response":"success",
                    "info":"Processed 0 Failed 1 Total 1 Seconds spent 0.000092"}'
             22129:20120316:112808.365 End of zbx_send_response():SUCCEED
             22129:20120316:112808.365 End of recv_agenthistory()
            There is absolutely nothing in there with debugging turned on to tell me why this fails for this host, and yet succeeds for other hosts.

            *sigh* Time to compile my own version of the zabbix server with special debugging code to find out why it is failing, I guess.

            Comment

            • MrKen
              Senior Member
              • Oct 2008
              • 652

              #7
              On the Configuration of Item screen, where it says Allowed Hosts, remove 'localhost' and enter the IP address of the host that is sending via Zabbix_Sender.



              MrKen
              Disclaimer: All of the above is pure speculation.

              Comment

              • pdwalker
                Senior Member
                • Dec 2005
                • 166

                #8
                Doh!

                I set that up once and then completely forgot all about it.

                Thank you!

                Comment

                • pdwalker
                  Senior Member
                  • Dec 2005
                  • 166

                  #9
                  No,

                  It turns out that that was not my problem. I did have everything defined properly. I also tried leaving the "Allowed hosts"

                  Looking into the zabbix_server code in src/libs/zbxdbhigh/proxy.c, function process_mass_data, I found the following line:

                  Code:
                  if (SUCCEED != DCconfig_get_item_by_key(&item, proxy_hostid, values[i].host_name, values[i].key))
                  Adding some additional debug statements shows that this conditional is the one failing. As to why it is failing, I still don't know. As I currently understand it, it is looking for the host/item key in a cache and failing when does not find it.

                  It fails even though the host/item is defined and can be found in the database.

                  Comment

                  • pkhooper
                    Junior Member
                    • Jan 2010
                    • 5

                    #10
                    Did you find a fix for this?

                    Hello pdwalker,

                    Did you find a fix for this issue?

                    I am seeing this same issue.

                    However, from my testing, I am not able to update any hosts via zabbix_sender.

                    I upgraded from 1.8.2 to 2.0rc2.

                    Regards,
                    Patrick.

                    Comment

                    Working...