Ad Widget

Collapse

Can Zabbix server push agent changes to hosts?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #1

    Can Zabbix server push agent changes to hosts?

    We have the need to add new Zabbix IP addresses to the zabbix_agentd.conf on the hosts. Is Zabbix capable of pushing out changes to the conf fiels?
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    Originally posted by tchjts1
    We have the need to add new Zabbix IP addresses to the zabbix_agentd.conf on the hosts. Is Zabbix capable of pushing out changes to the conf fiels?
    It is theoretically possible using remote commands, but practically it will be a challenge. You could have the remote command download a new conf file, but there is a permissions and or security risk in doing so. The best way to handle this is to use a configuration management system such as CFEngine.
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • NOB
      Senior Member
      Zabbix Certified Specialist
      • Mar 2007
      • 469

      #3
      Originally posted by tchjts1
      We have the need to add new Zabbix IP addresses to the zabbix_agentd.conf on the hosts. Is Zabbix capable of pushing out changes to the conf fiels?
      No, not out of the box.

      We use a ZABBIX Cluster setup and specify the virtual IP address as first, then
      the real IP of both ZABBIX-Servers as the second and third IP addresses in the
      zabbix_agentd.conf file. We hope to solve most of these problems
      with this setup. Even a migration, e.g., from 1.4 to 1.6, would be possible this way !

      This might be too late for you, but we separate the agentd.conf file in
      three parts:
      1. main part (zabbix_agentd.conf)
      2. another part just with the Server IPs added using the Include= statement
      3. another part with the user parameters, added using the Include= statement

      That would make updating the Server IPs easier !

      The following is all just theory, right now. Not tested, not yet verified, just ideas:

      We just overwrite the file containing the Server IPs which contains just the line Server=a.b.c.d,e.f.g.h
      with a remote command (echo "Server=i.j.k.l,m.n.o.p" >zabbix_agentd.conf) or - for Windows - use smbclient to get/edit/replace the agentd.conf file.

      Then you have to restart the agent. For agents on Windows use
      either psexec (from Windows) or winexec (from Linux).
      It should be possible to write a script (using nohup) to restart the agent on Linux/UNIX, too.

      Experiences and feedback very much appreciated !

      Regards

      Norbert.

      Comment

      Working...