Ad Widget

Collapse

protocol request info

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DmitryL
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2016
    • 278

    #16
    Check my last comment.

    Comment

    • AlBoPo
      Junior Member
      • Aug 2018
      • 23

      #17
      DmitryL I think you touched what I didn't understand!

      In fact I try to add additional data to an exisiting custom agent wrote by another team I don't have any contact anymore with.

      Up to now, they collect snmp data, and send it to zabbix_server_ip:10051 and they send a JSON string like:

      {"request":"history data","host":"LL709601401410","data":[{"host":"4567","key":"zabbix[host,snmp,available]","clock":1534944976,"ns":924934000,"value":"2"},{ "host":"4567","key":"upsAlarmsOnUPS","clock":15349 44976,"ns":924934000,"value":""},{"host":"4567","k ey":"zabbix[host,snmp,available]","clock":1534945062,"ns":581188000,"value":"2"},{ "host":"4567","key":"upsAlarmsOnUPS","clock":15349 45062,"ns":581188000,"value":""},{"host":"4567","k ey":"zabbix[host,snmp,available]","clock":1534953475,"ns":576634000,"value":"2"},{ "host":"4567","key":"upsAlarmsOnUPS","clock":15349 53475,"ns":576634000,"value":""},{"host":"4567","k ey":"zabbix[host,snmp,available]","clock":1535016082,"ns":821557000,"value":"2"},{ "host":"4567","key":"upsAlarmsOnUPS","clock":15350 16082,"ns":821557000,"value":""},{"host":"4567","k ey":"zabbix[host,snmp,available]","clock":1535024247,"ns":434162000,"value":"2"},{ "host":"4567","key":"upsAlarmsOnUPS","clock":15350 24247,"ns":434162000,"value":""}],"clock":1535024291,"ns":0}

      These data are well received and processed by Zabbix server.

      So I hoped to use the same connection channel to send my JSON string. And for a reason I don't understand but which could be what you suspect, that don't works.

      So I'd like to understand why SNMP data are succesfully sent to that channel for that host and why mine are not!

      Comment

      • DmitryL
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2016
        • 278

        #18
        Just my assumption that host which received SNMP data is monitored by Zabbix server directly, not by the proxy. Then it should work.
        In your case host LL709601401410 is monitored through the proxy LL709601401410 (You should see it in Administration -> Proxies).

        If that is true, then all data should be sent to the Proxy IP address, and the proxy will forward it to the Server.
        If your host is monitored by the proxy, but you are sending data directly to the Server - it will not work.

        Comment

        • AlBoPo
          Junior Member
          • Aug 2018
          • 23

          #19
          So the proxies are defined like that: https://i.imgur.com/EuFW5AZ.png

          the ZS110 is the host where SNMP data are defined: https://i.imgur.com/QW2WD05.png

          Both LL709601401410 and ZS110 seem to be monitored by the LL709601401410 proxy no?

          Proxy IP address ??? AFAIK, these proxies are software/virtual entities created by zabbix itself no?
          Last edited by AlBoPo; 23-08-2018, 13:57.

          Comment

          • DmitryL
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • May 2016
            • 278

            #20
            They are using "request" : "history data" which basically imitates proxy sending data to server.
            However, you are using "request":"agent data" which imitates agent sending data to proxy/server

            it still should work, but you need to change IP address in your C script from Zabbix server IP to Zabbix proxy IP.

            Comment

            • DmitryL
              Senior Member
              Zabbix Certified SpecialistZabbix Certified Professional
              • May 2016
              • 278

              #21
              If you want to use history data:
              Code:
              telnet <zabbix_server_ip> 10051
              {"request":"history data","host" : "<proxy_name>", "clock":"1534953473","ns":"564379000","data":[{"host":"<hostname>","key":"test","value" :5,"clock":1534953473,"ns":564379000}]}
              If you want to use agent data:
              Code:
              telnet <zabbix_proxy_ip> 10051
              {"request":"agent data","data":[{"host":"test","key":"test","value" :1,"clock":1534953473,"ns":564379000}]}

              Comment

              • AlBoPo
                Junior Member
                • Aug 2018
                • 23

                #22
                In fact as I said, proxies and server are running on the same machine but

                {"request":"history data","host" : "<proxy_name>", ...

                is certainly what I didn't understand here. I going to test it like that.

                Anyway, if I cannot address the proxy through a different IP, how to do?

                And in fact if I look at the proxy creation, I do not look any IP address specification in Zabbix 3.4.7: https://i.imgur.com/o0GhX9f.png


                PS: I tried the "history data" request and it works; Thanks a lot. Now, for my knowledge, I did like if there is any way to use "agent data" in my configuration?
                Last edited by AlBoPo; 23-08-2018, 14:22.

                Comment

                • DmitryL
                  Senior Member
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • May 2016
                  • 278

                  #23
                  If proxy and server are on the same machine then proxy should have different listening port.
                  So you should use telnet on the proxy port.
                  Request stays the same.

                  Comment

                  • AlBoPo
                    Junior Member
                    • Aug 2018
                    • 23

                    #24
                    Ok, I think everything is clear to me now.

                    Thanks a lot

                    Comment

                    Working...