Zabbix agent
https://www.zabbix.com/download_agents
-------------------
create a startup.sh
/path/to/zabbix_agentd -c /path/to/conf/zabbix_agentd.conf
-------------------
create shutdown.sh
ps -ef|grep /path/to/zabbix_agentd |grep -v grep |awk '{print $2}' |xargs kill -9
--------------------
zabbix_agentd.conf
Include=/path/to/zabbix_agent/conf/zabbix_agentd/*.conf
Timeout=10
HostnameItem=system.hostname
ServerActive={10.1.2.123_zabbix_server_ip}
ListenPort=10050
Server=10.1.2.123
LogFileSize=10
LogFile=/path/to/logs/zabbix_agentd.log
PidFile=/path/to/zabbix_agent/zabbix_agentd.pid
---------------------
/path/to/conf/zabbix_agentd/example.conf
example.conf
-----------
UserParameter=system.test,who|wc -l
UserParameter=check_cpu,./custom_script.sh
UserParameter=mysql.replication.discovery[*], mysql -h"$1" -P"$2" -sNX -e "show slave status"
UserParameter=mysql.slave_status, mysql -h"$1" -P"$2" -sNX -e "show slave status"
----------------------------
mysql.replication.discovery[*], mysql -h"$1" -P"$2" -sNX -e "show slave status"
==> We will set the specific values when creating this item.
UserParameter
A user-defined parameter to monitor. There can be several user-defined parameters.
Format: UserParameter=<key>,<shell command>
Note that the shell command must not return empty string or EOL only. Shell commands may have relative paths, if the UserParameterDir parameter is specified.
Example:
UserParameter=system.test,who|wc -l
UserParameter=check_cpu,./custom_script.sh
Comments
Post a Comment