Skip to content

Instantly share code, notes, and snippets.

@shahriarhasib
Last active February 3, 2025 18:30
Show Gist options
  • Save shahriarhasib/0a5cf80cdd89ee838944b38c2a803db2 to your computer and use it in GitHub Desktop.
Save shahriarhasib/0a5cf80cdd89ee838944b38c2a803db2 to your computer and use it in GitHub Desktop.
Configaring Zabbix Agent
#Download zabbix agent on the server want to be monitored
#Select OS version and follow the steps from here: https://www.zabbix.com/download
zagentdconf=' /etc/zabbix/zabbix_agentd.conf'
zserver=IP_Of_Zabbix_Server
zserveractive=IP_Of_Zabbix_Server
#Update Server= and ServerActive= value by IP_Of_Zabbix_Server in /etc/zabbix/zabbix_agentd.conf:
sed -i 's/^Server=127.0.0.1/Server='$zserver'/g' $zagentdconf
sed -i 's/^ServerActive=127.0.0.1/ServerActive='$zserveractive'/g' $zagentdconf
#Change Hostname:
sed -i 's/^Hostname=Zabbix server//g' $zagentdconf
#Hostname=CallServer
#Give shell access to zabbix agent to exceute command at /etc/sudoers
echo "zabbix ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
sudo systemctl restart zabbix-agent
#Checking log for zabbix agent
cat /var/log/zabbix/zabbix_agentd.log | grep connection
or
tail -f /var/log/zabbix/zabbix_agentd.log | grep connection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment