Ad Widget

Collapse

monitor active proxy last seen

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alescri
    Member
    • May 2019
    • 32

    #1

    monitor active proxy last seen

    Good morning,
    Is possible to monitor the "last seen" value of an active proxy with a trigger?
    I ask because today I realized that I didn't get an alert because the proxy was offline.
    thanks for your reply
  • rwalter
    Junior Member
    • Apr 2018
    • 2

    #2
    I would like to know this as well. same type of issue.

    Comment

    • ingus.vilnis
      Senior Member
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Mar 2014
      • 908

      #3
      Hi,

      Checklist
      In Administration -> Proxies you have your proxy and it successfully exchanges the data with server.
      In Configuration -> Hosts you have the proxy added as a host. Desirably with the same name as in Administration -> Proxies and matches actual host name but that depends on ones taste. Thus you can use it in a nice template for all proxies.
      The proxy has Linux and Template App Zabbix Proxy linked to it.
      The proxy is monitored by itself!!! Never monitor the proxy from server, all graphs for proxy are useless then.

      In the Template App Zabbix proxy create the following item. (Naming up to you, item key matters)
      Name: Time - Last time data received from proxy
      Type: Zabbix internal
      Key: zabbix[proxy,{HOST.HOST},lastaccess] (you may replace the {HOST.HOST} macro with other name and achieve other flexibility there, up to you.
      Type of info: Numeric (unsigned)
      Units: uptime
      Update interval: 1m

      Check if the item receives data.

      Now the Trigger.
      Name: Zabbix - Not receiving data for > {$PROXY_LASTACCESS_NODATA_DSTR} from proxy {HOST.HOST} (up to you to create the macro, I use the value 3m there)
      Expression: {Template App Zabbix Proxy:zabbix[proxy,{HOST.HOST},lastaccess].fuzzytime({$PROXY_LASTACCESS_NODATA_DSTR})}=0

      And that's pretty much it. Test it by blocking the connection from proxy to server or by just stopping the proxy of that's ok.

      Comment


      • Jarbelix
        Jarbelix commented
        Editing a comment
        Thanks for the excellent response. Congratulations on sharing knowledge.

      • Roberto Garcia
        Roberto Garcia commented
        Editing a comment
        My proxy and my host does not have the same name, My Proxie´s name is "MXOFDF" and my Host´s name is "MXOFDFZP001"... when I check in the latest data the following error appears: Proxy "MXOFDFZP001" does not exist. Is mandatory to match the Proxy and host names?
    • Himura
      Junior Member
      • Feb 2021
      • 14

      #4
      Hello ingus.vilnis and thank you very much for the reply. Could you please assist a bit with my problem as well..
      I did what you've wrote above, but for me it does not work well... Since I'm complete newbie in that questions - I would really appreciate your advices.

      I've set up a home lab with the following configuration:
      zabbix-proxy active
      Click image for larger version

Name:	proxy-status.png
Views:	7064
Size:	7.2 KB
ID:	418728

      host with the same name as proxy has and template for Zabbix Proxy
      Click image for larger version

Name:	hosts.png
Views:	7060
Size:	36.7 KB
ID:	418729

      host details
      Click image for larger version

Name:	host details.png
Views:	7265
Size:	23.1 KB
ID:	418730

      I've created the new item in the template Zabbix Proxy
      Click image for larger version

Name:	templates - new item created.png
Views:	7016
Size:	39.5 KB
ID:	418731

      and I new trigger with the names, advices by you
      Click image for larger version

Name:	templates - new trigger created.png
Views:	7287
Size:	47.1 KB
ID:	418732

      After I turn off the proxy I have no data in the "Monitoring > Problems" area.

      Could you please tell me what I did wrong ?

      Many thanks in advance.

      Comment

      • alescri
        Member
        • May 2019
        • 32

        #5
        Originally posted by Himura
        Hello ingus.vilnis and thank you very much for the reply. Could you please assist a bit with my problem as well..
        I did what you've wrote above, but for me it does not work well... Since I'm complete newbie in that questions - I would really appreciate your advices.

        I've set up a home lab with the following configuration:
        zabbix-proxy active
        Click image for larger version

Name:	proxy-status.png
Views:	7064
Size:	7.2 KB
ID:	418728

        host with the same name as proxy has and template for Zabbix Proxy
        Click image for larger version

Name:	hosts.png
Views:	7060
Size:	36.7 KB
ID:	418729

        host details
        Click image for larger version

Name:	host details.png
Views:	7265
Size:	23.1 KB
ID:	418730

        I've created the new item in the template Zabbix Proxy
        Click image for larger version

Name:	templates - new item created.png
Views:	7016
Size:	39.5 KB
ID:	418731

        and I new trigger with the names, advices by you
        Click image for larger version

Name:	templates - new trigger created.png
Views:	7287
Size:	47.1 KB
ID:	418732

        After I turn off the proxy I have no data in the "Monitoring > Problems" area.

        Could you please tell me what I did wrong ?

        Many thanks in advance.
        hello, i installed the zabbix agent in the proxy .

        Comment

        • Himura
          Junior Member
          • Feb 2021
          • 14

          #6
          Originally posted by alescri

          hello, i installed the zabbix agent in the proxy .
          Hello and thanks a lot for the reply! Do you mean that you've just installed the agent (in which mode?) and motinoring proxy just as a normal host?

          Comment

          • alescri
            Member
            • May 2019
            • 32

            #7
            Originally posted by Himura

            Hello and thanks a lot for the reply! Do you mean that you've just installed the agent (in which mode?) and motinoring proxy just as a normal host?
            i did in that way.
            and actually works

            Comment

            • Himura
              Junior Member
              • Feb 2021
              • 14

              #8
              Originally posted by alescri

              i did in that way.
              and actually works
              Thanks for the reply! I'm very newbie in that area, and it took me a while to reproduce the method, mentioned by ingus.vilnis. From now I've configured 2 triggers for the proxy:
              1) agent ping ;
              2) last data received;
              These triggers are under the different time interval. So if I do not recieve any data from the proxy, but no warning comes from the agent - it means that something is wroing with the proxy itself and I should take care on that.
              If agent is not running properly - I receive just 2 warnings, that is quite ok for me.

              Dear forum members, thank you very much for your suggests and advices. It helps a lot to the newbies like me.

              Comment

              • RaulChiarella
                Member
                • Apr 2021
                • 59

                #9
                Hey...
                I think i am kind dull.

                I did this but when i went to Latest Data and checked the value generated by that item (zabbix[proxy,{HOST.HOST},lastaccess]) it said 18835 days, 15:39:14
                hahahah But that is very weird since Last Seen is just 8 days!!!

                Please can someone help me?

                Comment


                • ingus.vilnis
                  ingus.vilnis commented
                  Editing a comment
                  Hi

                  Go to the item configuration.

                  In field Units enter "unixtime"

                  Update and check the value displayed now.
              • RaulChiarella
                Member
                • Apr 2021
                • 59

                #10
                Originally posted by RaulChiarella
                Hey...
                I think i am kind dull.

                I did this but when i went to Latest Data and checked the value generated by that item (zabbix[proxy,{HOST.HOST},lastaccess]) it said 18835 days, 15:39:14
                hahahah But that is very weird since Last Seen is just 8 days!!!

                Please can someone help me?
                Thank you!
                Now it displayed 2021-07-27 12:39:14.

                Comment

                • Spectator
                  Member
                  • Sep 2021
                  • 71

                  #11
                  I tried under Zabbix 6 alpha6, but I can't add the trigger (works well under Zabbix 5.4).
                  In the version 6 the template name was changed by factory from "Template App Zabbix Proxy" to "Zabbix proxy health".

                  Do you have any ideas?
                  Click image for larger version

Name:	Zabbix_trigger_hozzaadas_hiba.jpg
Views:	5917
Size:	170.6 KB
ID:	435148

                  Comment

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

                    #12
                    Wrong syntax for it I think..
                    The syntax of a simple useful expression is "function(/host/key,parameter)<operator><constant>"

                    Your expression does not look like this.... And same would not work on 5.4 either.

                    Comment

                    • Spectator
                      Member
                      • Sep 2021
                      • 71

                      #13
                      Dear Cyber,

                      Thank you for your response!
                      I’m pretty beginner in Zabbix, could you possibly help me to articulate the above expression in the correct syntax?

                      I'm sorry, I remembered badly. It still worked under 5.0 LTS (not 5.4, I don't currently have a 5.4 Zabbix):

                      Click image for larger version

Name:	Zabbix_trigger_hozzaadas_ok.jpg
Views:	5849
Size:	286.2 KB
ID:	435152

                      Comment

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

                        #14
                        I don't have 5.4 either.. I suggest to use that "Add" button there beside "Expression" box. It will open up a wizard and you can choose needed item and needed function and it will format it for you.
                        For too many times I have seen people struggling with syntax and avoiding that button, like its poisonous..

                        Comment

                        • Spectator
                          Member
                          • Sep 2021
                          • 71

                          #15
                          Dear Cyber!
                          Thank you very much, you gave a very good idea! It was solved with the wizard, at least it seems to work.

                          This is the result:

                          Expression: fuzzytime(/Zabbix proxy health/zabbix[proxy,{HOST.HOST},lastaccess],{$PROXY_LASTACCESS_NODATA_DSTR})=0

                          Comment

                          Working...