====== smartmontools ======
FIXME
Набор программ для мониторинга параментров [[s_m_a_r_t:s_m_a_r_t|S.M.A.R.T.]]
https://www.smartmontools.org/
====== Установка ======
apt install smartmontools
====== Использование ======
FIXME
===== Информация о диске =====
smartctl -i /dev/sda
===== Значения специфических атрибутов SMART =====
smartctl -A /dev/sda
===== Вывести информацию диске по БД smartmontools =====
smartctl -P show /dev/sda
====== Zabbix ======
Отслеживание состояния [[S_M_A_R_T:S_M_A_R_T|S.M.A.R.T.]] параметров дисков через ''smartmontools'' [[zabbix:server|Zabbix сервером]].
:!: Для работы скрипта необходим пакет [[sudo:sudo|sudo]]
[[https://share.zabbix.com/storage-devices/smart-monitoring-with-smartmontools-lld|Zabbix Share - SMART monitoring with smartmontools (LLD,DI)]]
https://github.com/v-zhuravlev/zbx-smartctl
Готовый пакет:
{{:smartmontools:zabbix-agent-extra-smartctl_0.1ubuntu3_all.deb|}}
===== Сборка DEB пакета =====
Для сборки DEB пакета нужно:
- установить необходимые пакеты:apt install build-essential debhelper
- выполнить сборку:dpkg-source -Zgzip --after-build zbx-smartctl-master
===== Установка пакета =====
dpkg -i zabbix-agent-extra-smartctl_0.1ubuntu3_all.deb
===== MS Windows =====
FIXME
Для работы нужно [[powershell:powershell|PowerShell]]
==== 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|источник]]
==== 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"
https://github.com/v-zhuravlev/zbx-smartctl#windows
====== Ссылки ======
https://en.wikipedia.org/wiki/Smartmontools
https://wiki.dieg.info/smartmontools
[[https://white55.ru/smart.html|Оценка технического состояния жестких дисков с использованием технологии S.M.A.R.T]]
{{tag>Debian Hardware Admin}}