diff --git a/zabbix_agent.sh b/zabbix_agent.sh index 14b149d..e3fce39 100644 --- a/zabbix_agent.sh +++ b/zabbix_agent.sh @@ -90,6 +90,20 @@ else exit fi +# test if not a VM and if so, install the smartctl stuff +if [ "${VM}" == "false" ]; then + # download the sudo file + wget -O /etc/sudoers.d/sudoers_zabbix_smartctl https://raw.githubusercontent.com/v-zhuravlev/zbx-smartctl/master/sudoers_zabbix_smartctl + chmod 440 /etc/sudoers.d/sudoers_zabbix_smartctl + # make the directories + mkdir /etc/zabbix/zabbix_agentd.d /etc/zabbix/scripts + # download the conf and discovery scripts + wget -O /etc/zabbix/zabbix_agentd.d/zabbix_smartctl.conf https://raw.githubusercontent.com/v-zhuravlev/zbx-smartctl/master/zabbix_smartctl.conf + wget -O /etc/zabbix/scripts/smartctl-disks-discovery.pl https://raw.githubusercontent.com/v-zhuravlev/zbx-smartctl/master/discovery-scripts/nix/smartctl-disks-discovery.pl + chown zabbix:zabbix /etc/zabbix/scripts/smartctl-disks-discovery.pl + chmod u+x /etc/zabbix/scripts/smartctl-disks-discovery.pl +fi + #cheeck before running this as it adds lines to keep comments if [ $(grep -c "^Server=127.0.0.1" /etc/zabbix/zabbix_agentd.conf) -eq 1 ]; then