From 2d51257f30025fe9011bad0e1b5fdc5898e142dd Mon Sep 17 00:00:00 2001 From: niki Date: Fri, 13 Mar 2020 10:52:39 +0500 Subject: [PATCH] Add files via upload --- Template smartmonitor.xml | 27 ++++++++++++++++++++++++--- zabbix_agentd.conf | 4 +++- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/Template smartmonitor.xml b/Template smartmonitor.xml index 7dcb266..d4576d2 100644 --- a/Template smartmonitor.xml +++ b/Template smartmonitor.xml @@ -1,7 +1,7 @@ 4.4 - 2020-03-02T12:56:26Z + 2020-03-13T05:49:23Z Templates Users @@ -21,9 +21,30 @@ SMART monitoring (smartctl) + + + Smartctl version + smartctl.version + 1h + 0 + CHAR + + + SMART monitoring (smartctl) + + + + + {change()}=1 + Version of smartctl was changed on {HOST.NAME} + INFO + + + + - smartctl-storage-discovery + Smartctl storage discovery storage.discovery 1d;1h/1-7,08:00-21:00 @@ -37,7 +58,7 @@ - {#STORAGE.NAME}: smartctl + {#STORAGE.NAME}: Smartctl storage.get["{#STORAGE.CMD}"] 1h;10m/1-7,08:00-21:00 30d diff --git a/zabbix_agentd.conf b/zabbix_agentd.conf index bf64f6f..da91b85 100644 --- a/zabbix_agentd.conf +++ b/zabbix_agentd.conf @@ -1,7 +1,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\zabbix_agent\smartctl-storage-discovery.ps1" +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//'