forked from nikimaxim/zbx-smartmonitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzabbix_agentd.conf
9 lines (8 loc) · 891 Bytes
/
zabbix_agentd.conf
1
2
3
4
5
6
7
8
9
# Windows smartctl monitor
UserParameter=storage.get[*],for /F "tokens=* usebackq" %a in (`""C:\Program Files\smartmontools\bin\smartctl.exe" -i -H -A -l error -l background $1"`) do @echo %a
UserParameter=storage.discovery[*],powershell -NoProfile -ExecutionPolicy Bypass -File "C:\service\smartctl-storage-discovery.ps1"
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.get[*],sudo smartctl -i -H -A -l error -l background $1
UserParameter=storage.discovery[*],sudo /opt/zabbix_s/smartctl-storage-discovery.sh
UserParameter=smartctl.version,smartctl --version | grep -Eo "^smartctl\s[0-9\.[:space:]\r-]+" | sed -e 's/^smartctl\s//'