Skip to content

Instantly share code, notes, and snippets.

@kujiy
Created August 12, 2016 05:53
Show Gist options
  • Save kujiy/c13b0f4c033ca303d2fc78875e56cbb4 to your computer and use it in GitHub Desktop.
Save kujiy/c13b0f4c033ca303d2fc78875e56cbb4 to your computer and use it in GitHub Desktop.
How to install the latest stable version of zabbix_agentd automatically. How to get the latest version of zabbix-agentd
#!/bin/bash
# get latest stable version
VER=$(curl -s http://heanet.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/ | grep -P "alt=\"\[DIR\]\" /> <a href=" | grep -v alpha | grep -v beta | awk -F'[\"]' '{print $6}' | sed -e "s/\///" | tail -1 )
eyel "---------------------------------------------------"
eblu Install zabbix-agent version
egre $VER
eyel "---------------------------------------------------"
if [[ ! "$VER" =~ ^[0-9]*?\.[0-9]*?\.[0-9] ]]
then
ered "Failed to get the latest stable version of zabbix-agent."
exit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment