Ad Widget

Collapse

Additional servers on zabbix_agentd.conf.d/xxx.conf

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MatiasCampo
    Junior Member
    • Jun 2022
    • 3

    #1

    Additional servers on zabbix_agentd.conf.d/xxx.conf

    Hello! This is my first post, and I'm getting to know Zabbix (and liking it so far).

    I have a fairly specific scenario, and I'm wondering what my options are. A bit of background:
    • I work in a company organized as Global / Regional / Local IT teams. I'm at the regional level.
    • Global IT has a Zabbix server that monitors all Linux deployments globally. This is set up automatically with Ansible.
    • I added a regional Zabbix server, running on Linux. Thus, it is also monitored by the global Zabbix server.
    Here is my current zabbix_agentd.conf file:

    TLSConnect=psk
    TLSAccept=psk
    TLSPSKFile=/etc/zabbix/zabbix_agentd.psk
    TLSPSKIdentity=PSK_001

    PidFile=/var/run/zabbix/zabbix_agentd.pid
    LogFile=/var/log/zabbix-agent/zabbix_agentd.log
    LogFileSize=0
    Timeout=10
    Server=10.xxx.xxx.67,10.yyy.yyy.30,127.0.0.1,172.0.0.0/8
    ServerActive=10.xxx.xxx.67,10.yyy.yyy.30,127.0.0.1
    HostnameItem=system.run[hostname -s | awk '{print tolower($0)}']
    Include=/etc/zabbix/zabbix_agentd.conf.d/*.conf


    The IP marked in red is the regional (mine) server, all of the others are set via Ansible.

    Now, the actual issue: Each time the Global Ansible server runs an update cycle, it resets the zabbix_agentd.conf file to a default configuration, which ends up removing my server's IP address from the file; when this happens, my server loses access to its own agent.

    My first thought was to add a "my_zabbix_agentd.conf" file in /etc/zabbix/zabbix_agentd.conf.d/ with a Server and ServerActive parameters set there. With the last line the configuration should pick it up, and Ansible should not actually touch the file, solving the initial problem. My actual question is if there is any way to specify additional IP addresses on that file instead of overriding the entire setting? Something like this (I know it's not valid syntax, that's what I'm asking):

    Server+=10.yyy.yyy.30
    ServerActive+=10.yyy.yyy.30


    I'd like to b able to specify additional servers, not override the entire setting, just in case there is a change of server/IP done at the Global level and published via Ansible, and that change not be overriden by my included .conf file.

    Any ideas? Thanks!!!
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    I don't think there is an option to do it this way.
    If you are able to drop files to your servers without problems, then maybe it is possible to do it with a little intermediate script, which extracts data from main config, adds your needed servers and then drops it to conf.d directory? Run it often enough to catch changes in main config file...

    Comment

    Working...