Ad Widget

Collapse

Zabbix agent updates itself every month

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • colizab
    Junior Member
    • May 2024
    • 5

    #1

    Zabbix agent updates itself every month

    Hi,

    We have a problem with the automatic update of the zabbix agent. Last month, I modified zabbix_agentd.conf to run a script that checks whether a reboot is required for the host.
    But the agent switches to version 6.4.15.2400 without me doing anything.
    We've seen that the agent updates itself once a month.

    the problem with this update is that the zabbix_agentd.conf file doesn't keep the parameters I've added such as :
    UserParameter=Check_If_Need_Reboot,powershell -NoProfile -ExecutionPolicy bypass -File "C:\Program Files\Zabbix Agent\Script\Check_If_Need_Reboot.ps1"

    it generates a new file and changes the old file to old format

    Exemple :
    PS C:\Users\administrateur.MTI> get-childitem 'C:\Program Files\Zabbix Agent\'

    Répertoire : C:\Program Files\Zabbix Agent

    Mode LastWriteTime Length Name
    ---- ------------- ------ ----
    d----- 26/04/2024 09:19 Script
    d----- 22/05/2024 17:08 zabbix_agentd.d
    -a---- 22/05/2024 17:08 66 psk.key
    -a---- 23/05/2024 11:55 16523 zabbix_agentd.conf
    -a---- 05/02/2024 16:25 16352 zabbix_agentd.conf.old.6.4.11.2400
    -a---- 29/02/2024 08:18 16352 zabbix_agentd.conf.old.6.4.12.2400
    -a---- 28/03/2024 15:25 16352 zabbix_agentd.conf.old.6.4.13.2400
    -a---- 26/04/2024 09:19 16516 zabbix_agentd.conf.old.6.4.14.2400
    -a---- 21/05/2024 15:26 3224176 zabbix_agentd.exe
    -a---- 23/05/2024 02:13 1343 zabbix_agentd.log
    -a---- 21/05/2024 15:27 2851432 zabbix_get.exe
    -a---- 21/05/2024 15:27 2913904 zabbix_sender.exe​

    I therefore have to enter the line in each conf file every month per server when the agent updates

    Do you know how I can solve this problem?

  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    #2
    My best practice whenever installing a Zabbix agent (or agent 2) is to put all my customizations in a separate file: /etc/zabbix/zabbix_agentd.d/agent.conf (or /etc/zabbix/zabbix_agent2.d/agent.conf). All the .conf files in those directories are included automatically by the default agent configuration file.

    Now, my example is for unix-style agents, but see your zabbix_agentd.conf on Windows if it also has the Include directive already configured by default.

    This way you don't have to modify the default configuration file at all, and the upgrade process does not touch your additional conf files in the included directory, thus your changes are preserved across upgrades.

    See the documentation: https://www.zabbix.com/documentation...td_win#include

    Markku
    Last edited by Markku; 23-05-2024, 19:10. Reason: Fixed the paths with the missing zabbix directory

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1781

      #3
      I see Zabbix server and proxy still haven't got this same Include directory configuration by default, but by any means go and vote for https://support.zabbix.com/browse/ZBXNEXT-4641 (ZBXNEXT-4641) in case you (any reader of this post) would benefit from that enhancement.

      Markku

      Comment

      • colizab
        Junior Member
        • May 2024
        • 5

        #4
        Hi,

        Thank for you reply!
        I want to try and it's work with your advice

        Thank you !

        Comment

        Working...