Ad Widget

Collapse

Active monitoring on zabbix for hosts behind NAT

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PratapSingh
    Junior Member
    • Apr 2016
    • 29

    #1

    Active monitoring on zabbix for hosts behind NAT

    Hi All,

    I am trying to setup active monitoring for my hosts which are behind NAT environment on AWS VPC.

    I followed steps available on below two URLs


    &
    http://serverfault.com/questions/554...-active-checks

    I see graphs data are getting updated, as of now I have added only one server to verify the setup so that I can proceed with adding more server.

    However we notice "RED" notification for "ZBX" under Configuration -> Hosts -> AVAILABILITY .

    How can we disable passive monitoring completely so we should not get annoying red symbol on our dashboard.

    Thanks,
    Pratap
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    Try to telnet your server on port 10051.
    If it will be not working it will mean your FW/SG settings are incorrect.
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    • PratapSingh
      Junior Member
      • Apr 2016
      • 29

      #3
      Hi ,

      Telnet to port 10051 works from the client/agent to zabbix server.

      Thanks,
      ./Pratap

      Comment

      • kloczek
        Senior Member
        • Jun 2006
        • 1771

        #4
        So what you see on zabbix agent side in agent logs?
        http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
        https://kloczek.wordpress.com/
        zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
        My zabbix templates https://github.com/kloczek/zabbix-templates

        Comment

        • PratapSingh
          Junior Member
          • Apr 2016
          • 29

          #5
          This is what I see in zabbix log

          Code:
          * zabbix_agentd stopping...                                                                                          [ OK ]
           * zabbix_agentd starting...                                                                                          [ OK ]
            5580:20160503:023311.516 Got signal [signal:15(SIGTERM),sender_pid:21068,sender_uid:0,reason:0]. Exiting ...
            5580:20160503:023311.525 Zabbix Agent stopped. Zabbix 2.2.2 (revision 42525).
           21085:20160503:023311.566 Starting Zabbix Agent [zabix-agent-active]. Zabbix 2.2.2 (revision 42525).
           21085:20160503:023311.567 using configuration file: /etc/zabbix/zabbix_agentd.conf
           21087:20160503:023311.567 agent #1 started [active checks #1]
           21086:20160503:023311.567 agent #0 started [collector]

          Telnet output to zabbix server from active agent host:

          Code:
          telnet zabbix-server 10051
          Trying 55.78.189.90...
          Connected to zabbix-server.
          Escape character is '^]'.
          ^]
          telnet> q
          Connection closed.
          I see the graphs getting updated on zabbix dashboard for my active agent but I also see red mark for "ZBX" under Configuration -> Hosts -> AVAILABILITY.

          Thanks,
          ./Pratap

          EDIT
          Also I had added Auto registration action and linked two template to Auto registration Action however when host get registered to zabbix it does not get any template assigned to it. When I try to add the same linked active agent template to auto registered host I get below error on dashboard :

          Template cannot be linked to another template more than once even through other templates.
          However If I add normal template which I have not linked it gets added to host template and I get graph on dashboard for auto registered host.

          My template which I copied and created for active agent are as below:

          Template App Zabbix Agent Active
          Template OS Linux Active
          Above template are assigned to Auto Registration action created. But does not get assigned to host once registered automatically.

          But if I assign template "Template OS Linux" manually to auto registered host its get added and graphs are getting updated as well.

          Followed instruction given on URL

          Last edited by PratapSingh; 03-05-2016, 13:55.

          Comment

          • PratapSingh
            Junior Member
            • Apr 2016
            • 29

            #6
            Issue with red symbol for "ZBX" under Configuration -> Hosts -> AVAILABILITY, got fixed after recreating everything from scratch. I deleted host group, action and all host added (which were only two host). Then I recreated host group, actions for it and it worked fine and I am not getting red mark on the dashboard.


            However I am still having the issue for template assignment. I had selected the template in "Action" but I see the auto registered hosts are not having any template assigned under "TEMPLATES", this field remains blank for auto registered host. Due to this monitoring of these hosts are disabled. When I add the template manually against any individual host(auto registered host) monitoring gets enabled and it works without any issue.

            Is there anything I am missing for auto-registration actions?
            Last edited by PratapSingh; 06-05-2016, 09:10.

            Comment

            • bbrendon
              Senior Member
              • Sep 2005
              • 870

              #7
              Originally posted by PratapSingh
              Hi All,

              I am trying to setup active monitoring for my hosts which are behind NAT environment on AWS VPC.

              I followed steps available on below two URLs


              &
              http://serverfault.com/questions/554...-active-checks

              I see graphs data are getting updated, as of now I have added only one server to verify the setup so that I can proceed with adding more server.

              However we notice "RED" notification for "ZBX" under Configuration -> Hosts -> AVAILABILITY .

              How can we disable passive monitoring completely so we should not get annoying red symbol on our dashboard.

              Thanks,
              Pratap
              I'm pretty sure that's a long-standing bug. Everyone I work with ignores that column and just pays attention to the actual triggers.
              Unofficial Zabbix Expert
              Blog, Corporate Site

              Comment

              • bbrendon
                Senior Member
                • Sep 2005
                • 870

                #8
                Thanks to you I went poking around. Found some red ones that aren't really red. I was able to fix it with this. I should have done this on day one.

                Code:
                --- include/html.inc.php.orig   2016-05-07 16:17:09.356893717 -0700
                +++ include/html.inc.php        2016-05-07 16:15:36.945144192 -0700
                @@ -587,7 +587,8 @@
                 function getHostAvailabilityTable($host) {
                        $container = (new CDiv())->addClass(ZBX_STYLE_STATUS_CONTAINER);
                
                -       foreach (['zbx' => '', 'snmp' => 'snmp_', 'jmx' => 'jmx_', 'ipmi' => 'ipmi_'] as $type => $prefix) {
                +       //foreach (['zbx' => '', 'snmp' => 'snmp_', 'jmx' => 'jmx_', 'ipmi' => 'ipmi_'] as $type => $prefix) {
                +       foreach (['snmp' => 'snmp_', 'jmx' => 'jmx_', 'ipmi' => 'ipmi_'] as $type => $prefix) {
                                switch ($host[$prefix.'available']) {
                                        case HOST_AVAILABLE_TRUE:
                                                $ai = (new CSpan($type))->addClass(ZBX_STYLE_STATUS_GREEN);
                Unofficial Zabbix Expert
                Blog, Corporate Site

                Comment

                • PratapSingh
                  Junior Member
                  • Apr 2016
                  • 29

                  #9
                  Thanks Brendon,

                  However I face the new issue with template not getting assigned to auto-registered hosts. Due to which graphs and alerting not getting updated.

                  I have to assign template manually, though I have given the template in triggers but that seems to be not working.

                  Any clue here as well.

                  Comment

                  • kloczek
                    Senior Member
                    • Jun 2006
                    • 1771

                    #10
                    Originally posted by PratapSingh
                    However I face the new issue with template not getting assigned to auto-registered hosts. Due to which graphs and alerting not getting updated.
                    Auto-registration with adding templates is working without problems.
                    All what you need is add in Operations tab use exact templates.
                    Of course if you have multiple actions set of conditions in each actions in Conditions tab must be defined in a way which will cause that only one action will be fired.
                    If you have situation where hos has been registered but without adding templates it is very possible that another action is hit. By default empty list in Operations is causing host registration.
                    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
                    https://kloczek.wordpress.com/
                    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
                    My zabbix templates https://github.com/kloczek/zabbix-templates

                    Comment

                    • PratapSingh
                      Junior Member
                      • Apr 2016
                      • 29

                      #11
                      I am following exactly as mentioned. Still I see hosts are getting added without templates assigned to it. I have attached image for my action under zabbix for your reference.
                      Attached Files

                      Comment

                      • kloczek
                        Senior Member
                        • Jun 2006
                        • 1771

                        #12
                        Originally posted by PratapSingh
                        I am following exactly as mentioned. Still I see hosts are getting added without templates assigned to it. I have attached image for my action under zabbix for your reference.
                        I understand however if you have registered host without templates it means that you have probably other action with overlapping conditions.
                        So as I wrote you should have look on you list of actions and check other actions conditions
                        http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
                        https://kloczek.wordpress.com/
                        zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
                        My zabbix templates https://github.com/kloczek/zabbix-templates

                        Comment

                        • PratapSingh
                          Junior Member
                          • Apr 2016
                          • 29

                          #13
                          If I understood correctly for each action I have to assign an unique template. Is that correct understanding or am I again wrong. I have assigned template name ->"Template OS Linux Active" to multiple actions. I have to create unique new(cloned) template for each and every new action.

                          Comment

                          • kloczek
                            Senior Member
                            • Jun 2006
                            • 1771

                            #14
                            Originally posted by PratapSingh
                            If I understood correctly for each action I have to assign an unique template. Is that correct understanding or am I again wrong. I have assigned template name ->"Template OS Linux Active" to multiple actions. I have to create unique new(cloned) template for each and every new action.
                            Nope. Each unique set of action conditions can assign even the same template(s).
                            For example you may have few groups of hosts working under Linux but with different applications so every of such actions will be adding use OS Linux specific template and second template(s) with monitoring exact application(s).
                            One action per host or group of hosts doing the same things.
                            You don't need to clone anything as long as you are using exactly the same set of metrics.

                            Cloning is to make initial copy of some template if you are going to add some changes in new variant of well known template or if you are going to start working on next version of the templates.
                            It is another way to deal with some common and variable parts of some templates.
                            If your A template has for example some set of triggers which are using some macros you can create A1 template inheriting A template with changed values of macros or new triggers which should be used on some exact set of systems. In such case any change made in A template will be automatically propagated to A1 template as well. So here you have typical inheritance mechanism.
                            http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
                            https://kloczek.wordpress.com/
                            zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
                            My zabbix templates https://github.com/kloczek/zabbix-templates

                            Comment

                            • PratapSingh
                              Junior Member
                              • Apr 2016
                              • 29

                              #15
                              Thanks Brendon and Kloczek.

                              Both issue have resolved for me. Cheers

                              Comment

                              Working...