-
Notifications
You must be signed in to change notification settings - Fork 14
/
zabbix_agentd.conf
14 lines (12 loc) · 1.3 KB
/
zabbix_agentd.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Windows smartctl monitor
UserParameter=storage.discovery[*],powershell -NoProfile -ExecutionPolicy Bypass -File "C:\service\smartctl-storage-discovery.ps1"
UserParameter=storage.get[*],powershell -NoProfile -ExecutionPolicy Bypass -Command "if (\"$1\") {& 'C:\Program Files\smartmontools\bin\smartctl.exe' -i -H -A -l error -l background $1}"
UserParameter=smartctl.version,powershell -NoProfile -ExecutionPolicy Bypass -Command "((& 'C:\Program Files\smartmontools\bin\smartctl.exe' --version | Where-Object {$_ -match '^smartctl\s\d'}) -ireplace 'smartctl\s' -ireplace '\s\[.+$').Trim()"
# Linux smartctl monitor
UserParameter=storage.discovery[*],sudo /opt/zabbix/smartctl-storage-discovery.sh
UserParameter=storage.get[*],if [ -n "$1" ]; then sudo /usr/sbin/smartctl -i -H -A -l error -l background $1; fi
UserParameter=smartctl.version,/usr/sbin/smartctl --version | grep -Eo "^smartctl\s[0-9\.[:space:]\r-]+" | sed -e 's/^smartctl.//'
# MacOS smartctl monitor
UserParameter=storage.discovery[*],sudo /usr/local/etc/zabbix/smartctl-storage-discovery.sh
UserParameter=storage.get[*],if [ -n "$1" ]; then sudo /usr/local/sbin/smartctl -i -H -A -l error -l background $1; fi
UserParameter=smartctl.version,/usr/local/sbin/smartctl --version | grep -Eo "^smartctl\s[0-9\.[:space:]\r-]+" | sed -e 's/^smartctl.//'