Skip to content

Commit a513bf7

Browse files
committed
bump v1.4
1 parent 855f5b0 commit a513bf7

5 files changed

+14
-12
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ Defaults!SMARTCTL !logfile, !syslog, !pam_session
7070
Defaults!SMARTCTL_DISCOVERY !logfile, !syslog, !pam_session
7171
```
7272

73-
Add the following lines in zabbix_agentd.conf file:
73+
Copy zabbix_smartctl.conf to /etc/zabbix/zabbix_agentd.d/zabbix_smartctl.conf with the following contents:
7474

7575
```text
76-
#############SMARTMONTOOLS
76+
#############ZBX-SMARTCTL V1.4
7777
### DEPRECATED. USE for 2.x-3.2 templates
7878
UserParameter=uHDD[*],sudo smartctl -A $1 | awk '$$0 ~ /$2/ { print $$10 }'
7979
UserParameter=uHDD.value[*],sudo smartctl -A $1 | awk '$$0 ~ /$2/ { print $$4 }'
@@ -82,11 +82,11 @@ UserParameter=uHDD.model.[*],sudo smartctl -i $1 | awk -F ': +' '$$0 ~ /Device M
8282
UserParameter=uHDD.sn.[*],sudo smartctl -i $1 | awk -F ': +' '$$0 ~ /Serial Number/ { print $$2 }'
8383
UserParameter=uHDD.health.[*],sudo smartctl -H $1 | awk -F ': +' '$$0 ~ /test/ { print $$2 }'
8484
UserParameter=uHDD.errorlog.[*],sudo smartctl -l error $1 |grep -i "ATA Error Count"| cut -f2 -d: |tr -d " " || true
85-
### DEPRECATED. The following were used in the first version of template for 3.4
85+
### DEPRECATED. The following were used in the first version of the template for 3.4
8686
UserParameter=uHDD.A[*],sudo smartctl -A $1
8787
UserParameter=uHDD.i[*],sudo smartctl -i $1
8888
UserParameter=uHDD.health[*],sudo smartctl -H $1 || true
89-
### With the latest template you only need these:
89+
### With the latest 3.4 template you only need these:
9090
UserParameter=uHDD.get[*],sudo smartctl -i -H -A -l error -l background $1 || true
9191
UserParameter=uSSD.get[*],sudo smartctl -i -H -A -l error -l background $1 || true
9292
UserParameter=uHDD.discovery[*],sudo /etc/zabbix/scripts/smartctl-disks-discovery.pl $1
@@ -122,7 +122,7 @@ You should receive JSON object in the output.
122122
- Add the following lines in zabbix_agentd.conf file (note the path to smartctl.exe):
123123

124124
```text
125-
#############SMARTMON
125+
#############ZBX-SMARTCTL V1.4
126126
###DEPRECATED. USE for 2.x-3.2 templates
127127
UserParameter=uHDD[*], for /F "tokens=10 usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -A $1 | find "$2""`) do @echo %a
128128
UserParameter=uHDD.value[*], for /F "tokens=4 usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -A $1 | find "$2""`) do @echo %a
@@ -131,11 +131,11 @@ UserParameter=uHDD.health.[*], for /F "tokens=6 usebackq" %a in (`""%ProgramFile
131131
UserParameter=uHDD.model.[*],for /F "tokens=3* usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -i $1 | find "Device Model""`) do @echo %a %b
132132
UserParameter=uHDD.sn.[*],for /F "tokens=3 usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -i $1 | find "Serial Number""`) do @echo %a
133133
UserParameter=uHDD.errorlog.[*], for /F "tokens=4 usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -l error $1 | find "ATA Error Count""`) do @echo %a
134-
### DEPRECATED. The following were used in the first version of template for 3.4
134+
### DEPRECATED. The following were used in the first version of the template for 3.4
135135
UserParameter=uHDD.A[*], for /F "tokens=* usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -A $1"`) do @echo %a
136136
UserParameter=uHDD.i[*], for /F "tokens=* usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -i $1"`) do @echo %a
137137
UserParameter=uHDD.health[*], for /F "tokens=* usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -H $1"`) do @echo %a
138-
### With the latest template you only need these:
138+
### With the latest 3.4 template you only need these:
139139
UserParameter=uHDD.get[*], for /F "tokens=* usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -i -H -A -l error -l background $1"`) do @echo %a
140140
UserParameter=uHDD.discovery[*],powershell -NoProfile -ExecutionPolicy Bypass -File "C:\Program Files (x86)\Zabbix Agent\smartctl-disks-discovery.ps1"
141141
UserParameter=uSSD.get[*], for /F "tokens=* usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -i -H -A -l error -l background $1"`) do @echo %a

Template_3.4_HDD_SMARTMONTOOLS_2_WITH_LLD.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
<template>Template_HDD_SMARTMONTOOLS_2_WITH_LLD</template>
1313
<name>Template_HDD_SMARTMONTOOLS_2_WITH_LLD</name>
1414
<description>https://github.com/v-zhuravlev/zbx-smartctl&#13;
15-
3.4 version with dependent items. Please check your UserParameters.</description>
15+
3.4 version with dependent items. Please check your UserParameters.
16+
Template version: v1.4</description>
1617
<groups>
1718
<group>
1819
<name>Templates</name>

discovery-scripts/nix/smartctl-disks-discovery.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use strict;
44

55
#must be run as root
6-
my $VERSION = 1.0;
6+
my $VERSION = 1.4;
77

88
#add path if needed into $smartctl_cmd
99
my $smartctl_cmd = "/usr/sbin/smartctl";

discovery-scripts/windows/smartctl-disks-discovery.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# VERSION = 1.4
12
$smartctl = "C:\Program Files\smartmontools\bin\smartctl.exe"
23

34
if ((Get-Command $smartctl -ErrorAction SilentlyContinue) -eq $null)

zabbix_smartctl.conf

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#############SMARTMONTOOLS
1+
#############ZBX-SMARTCTL V1.4
22
### DEPRECATED. USE for 2.x-3.2 templates
33
UserParameter=uHDD[*],sudo smartctl -A $1 | awk '$$0 ~ /$2/ { print $$10 }'
44
UserParameter=uHDD.value[*],sudo smartctl -A $1 | awk '$$0 ~ /$2/ { print $$4 }'
@@ -7,11 +7,11 @@ UserParameter=uHDD.model.[*],sudo smartctl -i $1 | awk -F ': +' '$$0 ~ /Device M
77
UserParameter=uHDD.sn.[*],sudo smartctl -i $1 | awk -F ': +' '$$0 ~ /Serial Number/ { print $$2 }'
88
UserParameter=uHDD.health.[*],sudo smartctl -H $1 | awk -F ': +' '$$0 ~ /test/ { print $$2 }'
99
UserParameter=uHDD.errorlog.[*],sudo smartctl -l error $1 |grep -i "ATA Error Count"| cut -f2 -d: |tr -d " " || true
10-
### DEPRECATED. The following were used in the first version of template for 3.4
10+
### DEPRECATED. The following were used in the first version of the template for 3.4
1111
UserParameter=uHDD.A[*],sudo smartctl -A $1
1212
UserParameter=uHDD.i[*],sudo smartctl -i $1
1313
UserParameter=uHDD.health[*],sudo smartctl -H $1 || true
14-
### With the latest template you only need these:
14+
### With the latest 3.4 template you only need these:
1515
UserParameter=uHDD.get[*],sudo smartctl -i -H -A -l error -l background $1 || true
1616
UserParameter=uSSD.get[*],sudo smartctl -i -H -A -l error -l background $1 || true
1717
UserParameter=uHDD.discovery[*],sudo /etc/zabbix/scripts/smartctl-disks-discovery.pl $1

0 commit comments

Comments
 (0)