Здесь показаны различия между двумя версиями данной страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
smartmontools:smartmontools [2018-08-06 11:10] GreyWolf [Zabbix] |
smartmontools:smartmontools [2019-05-10 23:26] (текущий) GreyWolf [Zabbix] |
||
---|---|---|---|
Строка 30: | Строка 30: | ||
====== Zabbix ====== | ====== Zabbix ====== | ||
- | FIXME | ||
- | |||
Отслеживание состояния [[S_M_A_R_T:S_M_A_R_T|S.M.A.R.T.]] параметров дисков через ''smartmontools'' [[zabbix:server|Zabbix сервером]]. | Отслеживание состояния [[S_M_A_R_T:S_M_A_R_T|S.M.A.R.T.]] параметров дисков через ''smartmontools'' [[zabbix:server|Zabbix сервером]]. | ||
+ | :!: Для работы скрипта необходим пакет [[sudo:sudo|sudo]] | ||
- | <code> | + | [[https://share.zabbix.com/storage-devices/smart-monitoring-with-smartmontools-lld|Zabbix Share - SMART monitoring with smartmontools (LLD,DI)]] |
- | zbx-smartctl-master.zip | + | |
+ | https://github.com/v-zhuravlev/zbx-smartctl | ||
+ | |||
+ | Готовый пакет: | ||
+ | |||
+ | {{:smartmontools:zabbix-agent-extra-smartctl_0.1ubuntu3_all.deb|}} | ||
+ | |||
+ | |||
+ | ===== Сборка DEB пакета ===== | ||
- | apt install build-essential debhelper | + | Для сборки DEB пакета нужно: |
- | dpkg-source -Zgzip --after-build zbx-smartctl-master | + | - установить необходимые пакеты:<code bash>apt install build-essential debhelper</code> |
+ | - выполнить сборку:<code bash>dpkg-source -Zgzip --after-build zbx-smartctl-master</code> | ||
+ | ===== Установка пакета ===== | ||
+ | <code bash> | ||
+ | dpkg -i zabbix-agent-extra-smartctl_0.1ubuntu3_all.deb | ||
</code> | </code> | ||
- | На выходе: | + | ===== MS Windows ===== |
- | zabbix-agent-extra-smartctl_0.1ubuntu3_all.deb | + | FIXME |
- | Готовый пакет: {{:smartmontools:zabbix-agent-extra-smartctl_0.1ubuntu3_all.deb|}} | + | Для работы нужно [[powershell:powershell|PowerShell]] |
- | [[https://share.zabbix.com/storage-devices/smart-monitoring-with-smartmontools-lld|Zabbix Share - SMART monitoring with smartmontools (LLD,DI)]] | + | ==== smartctl-disks-discovery.ps1 ==== |
+ | Путь: ''C:\Zabbix\smartctl-disks-discovery.ps1'', [[https://github.com/v-zhuravlev/zbx-smartctl/blob/master/discovery-scripts/windows/smartctl-disks-discovery.ps1|источник]] | ||
- | https://github.com/v-zhuravlev/zbx-smartctl | + | ==== userparameter_smartmontools.conf ==== |
+ | |||
+ | <code cmd C:\Zabbix\conf\userparameter_smartmontools.conf> | ||
+ | #############SMARTMON | ||
+ | ###DEPRECATED. USE for 2.x-3.2 templates | ||
+ | UserParameter=uHDD[*], for /F "tokens=10 usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -A $1 | find "$2""`) do @echo %a | ||
+ | UserParameter=uHDD.value[*], for /F "tokens=4 usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -A $1 | find "$2""`) do @echo %a | ||
+ | UserParameter=uHDD.raw_value[*], for /F "tokens=10 usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -A $1 | find "$2""`) do @echo %a | ||
+ | UserParameter=uHDD.health.[*], for /F "tokens=6 usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -H $1 | find "test""`) do @echo %a | ||
+ | UserParameter=uHDD.model.[*],for /F "tokens=3* usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -i $1 | find "Device Model""`) do @echo %a %b | ||
+ | UserParameter=uHDD.sn.[*],for /F "tokens=3 usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -i $1 | find "Serial Number""`) do @echo %a | ||
+ | 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 | ||
+ | #### 3.4 | ||
+ | UserParameter=uHDD.A[*], for /F "tokens=* usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -A $1"`) do @echo %a | ||
+ | UserParameter=uHDD.i[*], for /F "tokens=* usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -i $1"`) do @echo %a | ||
+ | UserParameter=uHDD.health[*], for /F "tokens=* usebackq" %a in (`""%ProgramFiles%\smartmontools\bin\smartctl.exe" -H $1"`) do @echo %a | ||
+ | ### Discovery | ||
+ | UserParameter=uHDD.discovery,powershell -NoProfile -ExecutionPolicy Bypass -File "c:\zabbix\smartctl-disks-discovery.ps1" | ||
+ | |||
+ | </code> | ||
+ | https://github.com/v-zhuravlev/zbx-smartctl#windows | ||
====== Ссылки ====== | ====== Ссылки ====== | ||
https://en.wikipedia.org/wiki/Smartmontools | https://en.wikipedia.org/wiki/Smartmontools |