Easy Update on Custom Scripts

Every time that you need to add or change an UserParameter on zabbix_agentd.conf you need to restart the agent. It’s easy if you have less than 10 servers, but could be a trouble if you have more than 30 servers.

Automation Tools like CFEngine and Puppet do this work well done, but unfortunately they aren’t used in many companies.

But it’s possible using a Dynamic UserParameter:

1) add two lines on zabbix_agentd.conf and restart the agent:

2) create the script file /etc/zabbix/zabbix_agentd/custom_getvalue

Don’t forget to set execute permission:

Now when you need create a new script, you must update this script and restart is unnecessary.

Remote Updates

Finally, let’s create a script to update custom_getvalue script remotely. Before make sure to publish your custom_getvalue script on a WebServer.

Create the file /etc/zabbix/zabbix_agentd/custom_updatescript:

Don’t forget to set execute permission:

Remote updates can be done from Zabbix Server/Proxy using zabbix_get utility:

It’s a contribution from laneovcc:

in my way i config zabbix-agent.conf to include a UserParameter.conf then use system.run[wget http://server/UserParameter.conf -O /path/to/UserParameter.conf ] to update the UserParameter.conf and system.run[services zabbix-agentd restart] to restart the agent



4 Responses to “ “Easy Update on Custom Scripts”

  1. Sergey says:

    Isn’t it a security breach? Why not use scp for remote copying a script, it will not take more work to do than calling zabbix_get?

  2. laneovcc says:

    in my way i config zabbix-agent.conf to include a UserParameter.conf then use system.run[wget http://server/UserParameter.conf -O /path/to/UserParameter.conf ] to update the UserParameter.conf and system.run[services zabbix-agentd restart] to restart the agent

Leave a Reply

*