add smartctl installer

This commit is contained in:
2021-02-26 10:33:49 -05:00
parent 42ebe392b2
commit 62bd6a4860

View File

@@ -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