Решил прикрутить smartmontools к Zabbix, для просмотра температуры и ошибок HDD.
Просмотр состояние жесткого диска sda:
Немного теории (взято с opennet.ru):
VALUE — одно байтовое значение показы данных «нормализованное» :).
RAW_VALUE — Каждый атрибут имеет raw value 6-ти байтовое значение
TYPE — существует 2 типа атрибутов:
Критичные атрибуты: (Pre-fail)
Некритичные атрибуты: (Old_age) (величина value отведенная вендором до наработки на отказ (ресурс)).
Если VALUE стало меньше THRESH в случае Pre-fail атрибута — существует большая вероятность, что диск вылетит в ближайшие 24 часа.
Если VALUE стало меньше THRESH в случае Old_age атрибута — существует большая вероятность, что диск вылетит т.к. выработан ресурс. Вот только когда — науке это неизвестно.
Критичные атрибуты:
* Raw Read Error Rate — частота ошибок при чтении данных с диска, происхождение которых обусловлено аппаратной частью диска.
* Spin Up Time — время раскрутки пакета дисков из состояния покоя до рабочей скорости. При расчете нормализованного значения (Value) практическое время сравнивается с некоторой эталонной величиной, установленной на заводе. Не ухудшающееся немаксимальное значение при Spin Up Retry Count Value = max (Raw равном 0) не говорит ни о чем плохом. Отличие времени от эталонного может быть вызвано рядом причин, например просадка по вольтажу блока питания.
* Spin Up Retry Count — число повторных попыток раскрутки дисков до рабочей скорости, в случае если первая попытка была неудачной. Ненулевое значение Raw (соответственно немаксимальное Value) свидетельствует о проблемах в механической части накопителя.
* Seek Error Rate — частота ошибок при позиционировании блока головок. Высокое значение Raw свидетельствует о наличии проблем, которыми могут являться повреждение сервометок, чрезмерное термическое расширение дисков, механические проблемы в блоке позиционирования и др. Постоянное высокое значение Value говорит о том, что все хорошо.
* Reallocated Sector Count — число операций переназначения секторов. SMART в современных дисках способен произвести анализ сектора на стабильность работы «на лету» и в случае признания его сбойным, произвести его переназначение.
Некритичные атрибуты:
* Start/Stop Count — полное число запусков/остановов шпинделя. Гарантировано мотор диска способен перенести лишь определенное число включений/выключений. Это значение выбирается в качестве Treshold. Первые модели дисков со скоростью вращения 7200 оборотов/мин имели ненадежный двигатель, могли перенести лишь небольшое их число и быстро выходили из строя.
* Power On Hours — число часов проведенных во включенном состоянии. В качестве порогового значения для него выбирается паспортное время наработки на отказ (MBTF). Обычно величина MBTF огромна, и маловероятно, что этот параметр достигнет критического порога. Но даже в этом случае выход из строя диска совершенно не обязателен. * Drive Power Cycle Count — количество полных циклов включения-выключения диска. По этому и предыдущему атрибуту можно оценить, например, сколько использовался диск до покупки.
* Temperatue — Здесь хранятся показания встроенного термодатчика. Температура имеет огромное влияние на срок службы диска (даже если она находится в допустимых пределах). Вернее имеет влияние не на срок службы диска а на частоту возникновения некоторых типов ошибок, которые влияют на срок службы.
* Current Pending Sector Count — Число секторов, являющихся кандидатами на замену. Они не были еще определенны как плохие, но считывание их отличается от чтения стабильного сектора, так называемые подозрительные или нестабильные сектора.
* Uncorrectable Sector Count — число ошибок при обращении к сектору, которые не были скорректированы. Возможными причинами возникновения могут быть сбои механики или порча поверхности.
* UDMA CRC Error Rate — число ошибок, возникающих при передаче данных по внешнему интерфейсу. Могут быть вызваны некачественными кабелями, нештатными режимами работы.
* Write Error Rate — показывает частоту ошибок происходящих при записи на диск. Может служить показателем качества поверхности и механики накопителя.
Дополнительные атрибуты смотрите в Википедиии.
Теперь к практике:
Редактируем и добавляем в конец файла Linux Zabbix agent /etc/zabbix/zabbix_agentd.conf:
разрешаем запускать smartctl с админскими правами, добавляем в конец файла /etc/sudoers:
Теперь самое интересное, проверяем получение информации с zabbix-agent-а:
smartd.value (см. конфигурационный файл агента) — какую команду мы хотим выполнить на агенте и получаем данные с поля Value.
Temperature_Celsius — получаем информацию о температуре, подставляем свое, список можно взять из атрибутов см. выше.
Остается прикрутить все в Web морде и создать оповещения.
Создаем шаблон в админке Zabbix для мониторинга температуры:
1. Заходим в Конфигурацию шаблонов:
2. Создаем новый шаблон Templates_SMARTOOLS в группе Templates:
3. Создаем группу элементов данных sda
4. Создаем элемент данных
Дальше добавляем шаблон Templates_SMARTOOLS к группе узла и мониторим.. В данном случае пока температуру. но все в Ваших руках..
Примечание:
Пытаясь получить информацию с жесткого диска программой smartmontools не выводит полную информацию:
С трудом, но заставил работать. Потребовалось сначала заставить его работать локально — проверял вводом команды на хосте с агентом: zabbix_agentd -t smartd.raw[/dev/sda,Temperature_Celsius] Когда стал получать данные локально, стал настраивать серверную компоненту — на время настройки тип данных присвоил не Numeric, а String — сразу словил пару ошибок работы sudo без консоли — исправил; последнее что сделал — изменил «Тип» элемента с «Zabbix agent» на «Zabbix agent (active)» — и всё заработало.
Да, забыл указать — оно не заработало, пока не был создан домашний каталог пользователя zabbix — /var/lib/zabbix Непонятно почему.
Ещё один нюанс — «Host name» в вэбке и в конфиге агента должны совпадать.
В случае несовпадения имён хостов в /var/log/zabbix/zabbix_agent.log будут сообщения типа: 19309:20141006:173002.010 no active checks on server [192.168.1.7:10051]: host [Zentyal-gateway] not found
zabbix_get не выдает результат, насроил все по инструкции, что может быть?
Источник
Zabbix smart hdd linux
So, мониторинг параметров SMART жёстких дисков на Zabbix для машин на Linux. Для машин на windows в этой зарисовке.
Для этого, на компьютере который мы будем мониторить, должен быть установлен Zabbix-agent и набор для работы со SMART параметрами жёсткого диска. Как установить zabbix-agent можно посмотреть в в этой статье или найти материалы интернете. Установка ПО для работы со SMART.
Переходим к редактированию конфигурации zabbix-agent. В конце файла конфигурации нужно добавить несколько сток:
Как можно понять это запуск того самого smartctl, который мы установили в самом начале. Работоспосбность проверяем на сервере Zabbix:
Если работает, то в ответ получаем числовое значение. Если ответ пусто или другого рода ошибка, вероятнее всего не хватает прав на выполнение команд zabbix-агентом. Для этого идём в sudoers и разрешаем выполнение smartctl без пароля root. Добавляем в конец файла:
Далее переходим к настройке Zabbix через web-интерфейс.
Идём в Настройка — Шаблоны — Template OS Linux — Группы элементов данных . Создаём группу элементов данных, на пример SMART. После создания группы заходим в раздел Элементы данных . И тут мы создаём элементы, необходимые для мониторинга.
Список всех доступных параметров можно посмотреть, выполнив
Я добавил только те параметры, которые говорят о здоровье диска. Получиться должно что-то вроде:
Самое время создать графики. В том же разделе заходим по ссылке Графики и создаём график с именем, на пример SMART.
После создания заходим в этот график на добавляем наши элементы данных. Должно получиться что-то вроде этого:
Источник
Zabbix + S.M.A.R.T.
S.M.A.R.T.
S.M.A.R.T. (Self-Monitoring, Analysis and Reporting Technology; often written as SMART) is a monitoring system included in computer hard disk drives (HDDs), solid-state drives (SSDs), and eMMC drives
Available solutions
Also available for: 5.0
SMART by Zabbix agent 2
Overview
For Zabbix version: 5.4 and higher The template for monitoring S.M.A.R.T. attributes of physical disk that works without any external scripts. It collects metrics by Zabbix agent 2 version 5.0 and later with Smartmontools version 7.1 and later. Disk discovery LLD rule finds all HDD, SSD, NVMe disks with S.M.A.R.T. enabled. Attribute discovery LLD rule finds all Vendor Specific Attributes for each disk. If you want to skip some attributes, please set regular expressions with disk names in <$SMART.DISK.NAME.MATCHES> and with attribute IDs in <$SMART.ATTRIBUTE.ID.MATCHES>macros on the host level.
This template was tested on:
Smartmontools, version 7.1 and later
Setup
Install the Zabbix agent 2 and Smartmontools 7.1.
Zabbix configuration
No specific Zabbix configuration is required.
Macros used
This macro is used in overrides of attribute discovery for filtering IDs. It can be overridden on the host or linked template level.
This macro is used in overrides of attribute discovery for filtering IDs. It can be overridden on the host or linked template level.
This macro is used for trigger expression. It can be overridden on the host or linked template level.
This macro is used for trigger expression. It can be overridden on the host or linked template level.
Template links
There are no template links in this template.
Discovery rules
Name
Description
Type
Key and additional info
Disk discovery
Discovery SMART disks.
ZABBIX_PASSIVE
smart.disk.discovery
Overrides:
Self-test — <#DISKTYPE>MATCHES_REGEX nvme — ITEM_PROTOTYPE LIKE Self-test — NO_DISCOVER
Discovery SMART Vendor Specific Attributes of disks.
ZABBIX_PASSIVE
smart.attribute.discovery
Overrides:
Items collected
Group
Name
Description
Type
Key and additional info
Zabbix_raw_items
SMART: Get attributes
ZABBIX_PASSIVE
smart.disk.get
Zabbix_raw_items
SMART [<#NAME>]: Device model
DEPENDENT
smart.disk.model[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Serial number
DEPENDENT
smart.disk.sn[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Self-test passed
The disk is passed the SMART self-test or not.
DEPENDENT
smart.disk.test[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Temperature
Current drive temperature.
DEPENDENT
smart.disk.temperature[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Power on hours
Count of hours in power-on state. The raw value of this attribute shows total count of hours (or minutes, or seconds, depending on manufacturer) in power-on state. «By default, the total expected lifetime of a hard disk in perfect condition is defined as 5 years (running every day and night on all days). This is equal to 1825 days in 24/7 mode or 43800 hours.» On some pre-2005 drives, this raw value may advance erratically and/or «wrap around» (reset to zero periodically). https://en.wikipedia.org/wiki/S.M.A.R.T.#Known_ATA_S.M.A.R.T._attributes
DEPENDENT
smart.disk.hours[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Percentage used
Contains a vendor specific estimate of the percentage of NVM subsystem life used based on the actual usage and the manufacturer’s prediction of NVM life. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. The value is allowed to exceed 100. Percentages greater than 254 shall be represented as 255. This value shall be updated once per power-on hour (when the controller is not in a sleep state).
DEPENDENT
smart.disk.percentage_used[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Critical warning
This field indicates critical warnings for the state of the controller.
DEPENDENT
smart.disk.critical_warning[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Media errors
Contains the number of occurrences where the controller detected an unrecovered data integrity error. Errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field.
DEPENDENT
smart.disk.media_errors[<#NAME>]
Preprocessing:
DEPENDENT
smart.disk.error[<#NAME>,<#ID>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: ID <#ID> <#ATTRNAME>raw value
DEPENDENT
smart.disk.attr.raw[<#NAME>,<#ID>]
Preprocessing:
Triggers
Name
Description
Expression
Severity
Dependencies and additional info
SMART [<#NAME>]: Disk has been replaced (new serial number received)
Device serial number has changed. Ack to close.
last(/SMART by Zabbix agent 2/smart.disk.sn[<#NAME>],#1)<>last(/SMART by Zabbix agent 2/smart.disk.sn[<#NAME>],#2) and length(last(/SMART by Zabbix agent 2/smart.disk.sn[<#NAME>]))>0
INFO
Manual close: YES
SMART [<#NAME>]: Disk self-test is not passed
last(/SMART by Zabbix agent 2/smart.disk.test[<#NAME>])=»false»
HIGH
SMART [<#NAME>]: Average disk temperature is too high (over <$SMART.TEMPERATURE.MAX.WARN>°C for 5m)
avg(/SMART by Zabbix agent 2/smart.disk.temperature[<#NAME>],5m)>
WARNING
Depends on:
— SMART [<#NAME>]: Average disk temperature is critical (over <$SMART.TEMPERATURE.MAX.CRIT>°C for 5m)
SMART [<#NAME>]: Average disk temperature is critical (over <$SMART.TEMPERATURE.MAX.CRIT>°C for 5m)
avg(/SMART by Zabbix agent 2/smart.disk.temperature[<#NAME>],5m)>
AVERAGE
SMART [<#NAME>]: NVMe disk percentage using is over 90% of estimated endurance
last(/SMART by Zabbix agent 2/smart.disk.percentage_used[<#NAME>])>90
last(/SMART by Zabbix agent 2/smart.disk.error[<#NAME>,<#ID>])
WARNING
Feedback
Please report any issues with the template at https://support.zabbix.com
You can also provide a feedback, discuss the template or ask for help with it at ZABBIX forums.
References
Also available for: 5.4
Template Module SMART by Zabbix agent 2
Overview
For Zabbix version: 5.0 and higher The template for monitoring S.M.A.R.T. attributes of physical disk that works without any external scripts. It collects metrics by Zabbix agent 2 version 5.0 and later with Smartmontools version 7.1 and later. Disk discovery LLD rule finds all HDD, SSD, NVMe disks with S.M.A.R.T. enabled. Attribute discovery LLD rule finds all Vendor Specific Attributes for each disk. If you want to skip some attributes, please set regular expressions with disk names in <$SMART.DISK.NAME.MATCHES> and with attribute IDs in <$SMART.ATTRIBUTE.ID.MATCHES>macros on the host level.
This template was tested on:
Smartmontools, version 7.1 and later
Setup
Install the Zabbix agent 2 and Smartmontools 7.1.
Zabbix configuration
No specific Zabbix configuration is required.
Macros used
This macro is used in overrides of attribute discovery for filtering IDs. It can be overridden on the host or linked template level.
This macro is used in overrides of attribute discovery for filtering IDs. It can be overridden on the host or linked template level.
This macro is used for trigger expression. It can be overridden on the host or linked template level.
This macro is used for trigger expression. It can be overridden on the host or linked template level.
Template links
There are no template links in this template.
Discovery rules
Name
Description
Type
Key and additional info
Disk discovery
Discovery SMART disks.
ZABBIX_PASSIVE
smart.disk.discovery
Overrides:
Self-test — <#DISKTYPE>MATCHES_REGEX nvme — ITEM_PROTOTYPE LIKE Self-test — NO_DISCOVER
Discovery SMART Vendor Specific Attributes of disks.
ZABBIX_PASSIVE
smart.attribute.discovery
Overrides:
Items collected
Group
Name
Description
Type
Key and additional info
Zabbix_raw_items
SMART: Get attributes
ZABBIX_PASSIVE
smart.disk.get
Zabbix_raw_items
SMART [<#NAME>]: Device model
DEPENDENT
smart.disk.model[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Serial number
DEPENDENT
smart.disk.sn[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Self-test passed
The disk is passed the SMART self-test or not.
DEPENDENT
smart.disk.test[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Temperature
Current drive temperature.
DEPENDENT
smart.disk.temperature[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Power on hours
Count of hours in power-on state. The raw value of this attribute shows total count of hours (or minutes, or seconds, depending on manufacturer) in power-on state. «By default, the total expected lifetime of a hard disk in perfect condition is defined as 5 years (running every day and night on all days). This is equal to 1825 days in 24/7 mode or 43800 hours.» On some pre-2005 drives, this raw value may advance erratically and/or «wrap around» (reset to zero periodically). https://en.wikipedia.org/wiki/S.M.A.R.T.#Known_ATA_S.M.A.R.T._attributes
DEPENDENT
smart.disk.hours[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Percentage used
Contains a vendor specific estimate of the percentage of NVM subsystem life used based on the actual usage and the manufacturer’s prediction of NVM life. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. The value is allowed to exceed 100. Percentages greater than 254 shall be represented as 255. This value shall be updated once per power-on hour (when the controller is not in a sleep state).
DEPENDENT
smart.disk.percentage_used[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Critical warning
This field indicates critical warnings for the state of the controller.
DEPENDENT
smart.disk.critical_warning[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Media errors
Contains the number of occurrences where the controller detected an unrecovered data integrity error. Errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field.
DEPENDENT
smart.disk.media_errors[<#NAME>]
Preprocessing:
DEPENDENT
smart.disk.error[<#NAME>,<#ID>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: ID <#ID> <#ATTRNAME>raw value
DEPENDENT
smart.disk.attr.raw[<#NAME>,<#ID>]
Preprocessing:
Triggers
Name
Description
Expression
Severity
Dependencies and additional info
SMART [<#NAME>]: Disk has been replaced (new serial number received)
Device serial number has changed. Ack to close.
Manual close: YES
SMART [<#NAME>]: Disk self-test is not passed
].last()>=»false»
HIGH
SMART [<#NAME>]: Average disk temperature is too high (over <$SMART.TEMPERATURE.MAX.WARN>°C for 5m)
Depends on:
— SMART [<#NAME>]: Average disk temperature is critical (over <$SMART.TEMPERATURE.MAX.CRIT>°C for 5m)
SMART [<#NAME>]: Average disk temperature is critical (over <$SMART.TEMPERATURE.MAX.CRIT>°C for 5m)
].avg(5m)>>
AVERAGE
SMART [<#NAME>]: NVMe disk percentage using is over 90% of estimated endurance
Please report any issues with the template at https://support.zabbix.com
You can also provide a feedback, discuss the template or ask for help with it at ZABBIX forums.
References
Also available for: 5.0
SMART by Zabbix agent 2
Overview
For Zabbix version: 5.4 and higher The template for monitoring S.M.A.R.T. attributes of physical disk that works without any external scripts. It collects metrics by Zabbix agent 2 version 5.0 and later with Smartmontools version 7.1 and later. Disk discovery LLD rule finds all HDD, SSD, NVMe disks with S.M.A.R.T. enabled. Attribute discovery LLD rule finds all Vendor Specific Attributes for each disk. If you want to skip some attributes, please set regular expressions with disk names in <$SMART.DISK.NAME.MATCHES> and with attribute IDs in <$SMART.ATTRIBUTE.ID.MATCHES>macros on the host level.
This template was tested on:
Smartmontools, version 7.1 and later
Setup
Install the Zabbix agent 2 and Smartmontools 7.1.
Zabbix configuration
No specific Zabbix configuration is required.
Macros used
This macro is used in overrides of attribute discovery for filtering IDs. It can be overridden on the host or linked template level.
This macro is used in overrides of attribute discovery for filtering IDs. It can be overridden on the host or linked template level.
This macro is used for trigger expression. It can be overridden on the host or linked template level.
This macro is used for trigger expression. It can be overridden on the host or linked template level.
Template links
There are no template links in this template.
Discovery rules
Name
Description
Type
Key and additional info
Disk discovery
Discovery SMART disks.
ZABBIX_PASSIVE
smart.disk.discovery
Overrides:
Self-test — <#DISKTYPE>MATCHES_REGEX nvme — ITEM_PROTOTYPE LIKE Self-test — NO_DISCOVER
Discovery SMART Vendor Specific Attributes of disks.
ZABBIX_PASSIVE
smart.attribute.discovery
Overrides:
Items collected
Group
Name
Description
Type
Key and additional info
Zabbix_raw_items
SMART: Get attributes
ZABBIX_PASSIVE
smart.disk.get
Zabbix_raw_items
SMART [<#NAME>]: Device model
DEPENDENT
smart.disk.model[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Serial number
DEPENDENT
smart.disk.sn[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Self-test passed
The disk is passed the SMART self-test or not.
DEPENDENT
smart.disk.test[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Temperature
Current drive temperature.
DEPENDENT
smart.disk.temperature[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Power on hours
Count of hours in power-on state. The raw value of this attribute shows total count of hours (or minutes, or seconds, depending on manufacturer) in power-on state. «By default, the total expected lifetime of a hard disk in perfect condition is defined as 5 years (running every day and night on all days). This is equal to 1825 days in 24/7 mode or 43800 hours.» On some pre-2005 drives, this raw value may advance erratically and/or «wrap around» (reset to zero periodically). https://en.wikipedia.org/wiki/S.M.A.R.T.#Known_ATA_S.M.A.R.T._attributes
DEPENDENT
smart.disk.hours[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Percentage used
Contains a vendor specific estimate of the percentage of NVM subsystem life used based on the actual usage and the manufacturer’s prediction of NVM life. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. The value is allowed to exceed 100. Percentages greater than 254 shall be represented as 255. This value shall be updated once per power-on hour (when the controller is not in a sleep state).
DEPENDENT
smart.disk.percentage_used[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Critical warning
This field indicates critical warnings for the state of the controller.
DEPENDENT
smart.disk.critical_warning[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Media errors
Contains the number of occurrences where the controller detected an unrecovered data integrity error. Errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field.
DEPENDENT
smart.disk.media_errors[<#NAME>]
Preprocessing:
DEPENDENT
smart.disk.error[<#NAME>,<#ID>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: ID <#ID> <#ATTRNAME>raw value
DEPENDENT
smart.disk.attr.raw[<#NAME>,<#ID>]
Preprocessing:
Triggers
Name
Description
Expression
Severity
Dependencies and additional info
SMART [<#NAME>]: Disk has been replaced (new serial number received)
Device serial number has changed. Ack to close.
last(/SMART by Zabbix agent 2/smart.disk.sn[<#NAME>],#1)<>last(/SMART by Zabbix agent 2/smart.disk.sn[<#NAME>],#2) and length(last(/SMART by Zabbix agent 2/smart.disk.sn[<#NAME>]))>0
INFO
Manual close: YES
SMART [<#NAME>]: Disk self-test is not passed
last(/SMART by Zabbix agent 2/smart.disk.test[<#NAME>])=»false»
HIGH
SMART [<#NAME>]: Average disk temperature is too high (over <$SMART.TEMPERATURE.MAX.WARN>°C for 5m)
avg(/SMART by Zabbix agent 2/smart.disk.temperature[<#NAME>],5m)>
WARNING
Depends on:
— SMART [<#NAME>]: Average disk temperature is critical (over <$SMART.TEMPERATURE.MAX.CRIT>°C for 5m)
SMART [<#NAME>]: Average disk temperature is critical (over <$SMART.TEMPERATURE.MAX.CRIT>°C for 5m)
avg(/SMART by Zabbix agent 2/smart.disk.temperature[<#NAME>],5m)>
AVERAGE
SMART [<#NAME>]: NVMe disk percentage using is over 90% of estimated endurance
last(/SMART by Zabbix agent 2/smart.disk.percentage_used[<#NAME>])>90
last(/SMART by Zabbix agent 2/smart.disk.error[<#NAME>,<#ID>])
WARNING
Feedback
Please report any issues with the template at https://support.zabbix.com
You can also provide a feedback, discuss the template or ask for help with it at ZABBIX forums.
References
Also available for: 5.4
Template Module SMART by Zabbix agent 2
Overview
For Zabbix version: 5.0 and higher The template for monitoring S.M.A.R.T. attributes of physical disk that works without any external scripts. It collects metrics by Zabbix agent 2 version 5.0 and later with Smartmontools version 7.1 and later. Disk discovery LLD rule finds all HDD, SSD, NVMe disks with S.M.A.R.T. enabled. Attribute discovery LLD rule finds all Vendor Specific Attributes for each disk. If you want to skip some attributes, please set regular expressions with disk names in <$SMART.DISK.NAME.MATCHES> and with attribute IDs in <$SMART.ATTRIBUTE.ID.MATCHES>macros on the host level.
This template was tested on:
Smartmontools, version 7.1 and later
Setup
Install the Zabbix agent 2 and Smartmontools 7.1.
Zabbix configuration
No specific Zabbix configuration is required.
Macros used
This macro is used in overrides of attribute discovery for filtering IDs. It can be overridden on the host or linked template level.
This macro is used in overrides of attribute discovery for filtering IDs. It can be overridden on the host or linked template level.
This macro is used for trigger expression. It can be overridden on the host or linked template level.
This macro is used for trigger expression. It can be overridden on the host or linked template level.
Template links
There are no template links in this template.
Discovery rules
Name
Description
Type
Key and additional info
Disk discovery
Discovery SMART disks.
ZABBIX_PASSIVE
smart.disk.discovery
Overrides:
Self-test — <#DISKTYPE>MATCHES_REGEX nvme — ITEM_PROTOTYPE LIKE Self-test — NO_DISCOVER
Discovery SMART Vendor Specific Attributes of disks.
ZABBIX_PASSIVE
smart.attribute.discovery
Overrides:
Items collected
Group
Name
Description
Type
Key and additional info
Zabbix_raw_items
SMART: Get attributes
ZABBIX_PASSIVE
smart.disk.get
Zabbix_raw_items
SMART [<#NAME>]: Device model
DEPENDENT
smart.disk.model[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Serial number
DEPENDENT
smart.disk.sn[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Self-test passed
The disk is passed the SMART self-test or not.
DEPENDENT
smart.disk.test[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Temperature
Current drive temperature.
DEPENDENT
smart.disk.temperature[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Power on hours
Count of hours in power-on state. The raw value of this attribute shows total count of hours (or minutes, or seconds, depending on manufacturer) in power-on state. «By default, the total expected lifetime of a hard disk in perfect condition is defined as 5 years (running every day and night on all days). This is equal to 1825 days in 24/7 mode or 43800 hours.» On some pre-2005 drives, this raw value may advance erratically and/or «wrap around» (reset to zero periodically). https://en.wikipedia.org/wiki/S.M.A.R.T.#Known_ATA_S.M.A.R.T._attributes
DEPENDENT
smart.disk.hours[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Percentage used
Contains a vendor specific estimate of the percentage of NVM subsystem life used based on the actual usage and the manufacturer’s prediction of NVM life. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. The value is allowed to exceed 100. Percentages greater than 254 shall be represented as 255. This value shall be updated once per power-on hour (when the controller is not in a sleep state).
DEPENDENT
smart.disk.percentage_used[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Critical warning
This field indicates critical warnings for the state of the controller.
DEPENDENT
smart.disk.critical_warning[<#NAME>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: Media errors
Contains the number of occurrences where the controller detected an unrecovered data integrity error. Errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field.
DEPENDENT
smart.disk.media_errors[<#NAME>]
Preprocessing:
DEPENDENT
smart.disk.error[<#NAME>,<#ID>]
Preprocessing:
Zabbix_raw_items
SMART [<#NAME>]: ID <#ID> <#ATTRNAME>raw value
DEPENDENT
smart.disk.attr.raw[<#NAME>,<#ID>]
Preprocessing:
Triggers
Name
Description
Expression
Severity
Dependencies and additional info
SMART [<#NAME>]: Disk has been replaced (new serial number received)
Device serial number has changed. Ack to close.
Manual close: YES
SMART [<#NAME>]: Disk self-test is not passed
].last()>=»false»
HIGH
SMART [<#NAME>]: Average disk temperature is too high (over <$SMART.TEMPERATURE.MAX.WARN>°C for 5m)
Depends on:
— SMART [<#NAME>]: Average disk temperature is critical (over <$SMART.TEMPERATURE.MAX.CRIT>°C for 5m)
SMART [<#NAME>]: Average disk temperature is critical (over <$SMART.TEMPERATURE.MAX.CRIT>°C for 5m)
].avg(5m)>>
AVERAGE
SMART [<#NAME>]: NVMe disk percentage using is over 90% of estimated endurance