Ad Widget

Collapse

How to change from passive to active agent monitoring?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • moses.moore
    Junior Member
    • Dec 2014
    • 24

    #1

    How to change from passive to active agent monitoring?

    I understand that zabbix agents can either act passively (waiting for each request from the mother server) or active (initiating contact with the mother server, asking the server what she expects, and uploading answers).

    Is there a HOWTO or instructions how to change Hosts that were using "Zabbix Agent" to "Zabbix Agent Active"? The instructions on how to configure the zabbix_agentd seems clear, but not how to configure the server.

    So far I've seen a description that I'd have to make full clones of every template on the host, and change the type of every item on every template to 'Zabbix agent (active)', but that seems so arduous to ask every user to do in every installation, that surely that's not the right way to do things.
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    In Zabbix agent configuration one defines what the agent should support: passive only, active only or passive and active checks.

    Whether an item gets passively or actively checked by Zabbix agent is defined on item level.
    See Zabbix agent item types.

    So, in fact to move from passive to active Zabbix agent item checks (or vice versa) one has to (mass) update the respective item types.

    Comment

    • moses.moore
      Junior Member
      • Dec 2014
      • 24

      #3
      I ended up having to find my own solution. Here's my notes, so that someone else can find what I did:

      -----
      Before I start changing hosts from passive to active checks, I needed to
      make three new templates-objects. For each of
      'Template App Zabbix Agent', 'Template OS Linux' and
      'Template App MySQL', do:

      - Go to Configuration : Templates, select template $name
      - scroll down, click 'Full Clone'. Change the clone's name to "$name
      Active" and click 'Add' at the bottom.
      - In Configuraiton : Templates, Find the new "$name Active" template,
      click on the 'Items' item on its row.
      - Click on the checkbox in the upper-left to select all rows, scroll
      down to the dropdown and select 'Mass Update' and click 'Go'
      - Click the checkbox for 'Type' and select 'Zabbix Agent (active)' in
      the dropdown that appears. Scroll down and click the 'Update' button.

      As a shortcut, I also changed 'Template OS Linux Active' to
      include 'Template App Zabbix Agent Active'.

      On the child, change /etc/zabbix/zabbix_agentd.d/local to include
      a `ServerActive=nnn.nnn.nnn.nnn` line, and double-check that the
      `Hostname=` line matches what is set as the 'Host Name' in the Host
      object config (that's Host Name not Visible Name). Restart
      zabbix_agentd. the agentd should start calling mother and asking
      for chores. Leave the `Server=127.0.0.1,nnn.nnn.nnn.nnn` and `ListenIP=`
      lines in, because the Zabbix mother still wants to pester children
      to see if they're awake, and so the mother can do "on trigger tell
      child to run diagnostic command xyzzy".

      [ In my own environment, I don't use the standard Zabbix ports, so
      I had "ServerActive=nnn.nnn.nnn.nnn:qqqq", but don't add the port
      number like this in the "Server=" line. ]

      On the mother, change the config for that host to remove 'Template
      OS Linux' and 'Template App Zabbix Agent' and add 'Template OS Linux
      Active' (which already pulls in Template App Zabbix Agent Active').
      If you see 'Template App foobar', replace it with the 'Template App
      foobar Active' if it exists. You'll get an information alert about
      "host name of zabbix_agentd was changed on $childname" and that's
      okay.

      Mistakes I fell into easily:
      - "template unlinked, duplicate keys," it's because I told
      you above to have one template include another, and I tried to
      attach the included template (Zabbix isn't smart enough to detect
      already-imported templates).
      - "agent unreachable," I would forget to include my nonstandard
      port number ":qqqq" in the "ServerActive=" line in the child's config,
      or I forgot to restart zabbix_agentd after I made the changes.

      [EDIT: forum software converts colon-p to so had to change to using ":qqqq"]

      Comment

      • tchjts1
        Senior Member
        • May 2008
        • 1605

        #4
        Originally posted by moses.moore

        [EDIT: forum software converts colon-p to so had to change to using ":qqqq"]
        You can avoid that happening by using code tags enclosed in brackets []
        use code and /code

        Code:
        That will make it look like this, and what would normally be converted to a smiley face :) is kept as it should be.

        Comment

        • qbab
          Junior Member
          • Mar 2015
          • 3

          #5
          I've just used this method and it works but ...
          "Item prototypes" (automatic discovery for example: filesystems) does not change to "Zabbix agent (active)" . One must change it manually and every item one by one (no mass update available for prototype items).

          So guys, keep that in mind.

          Comment

          Working...