-
Type:
Problem report
-
Resolution: Unresolved
-
Priority:
Trivial
-
None
-
Affects Version/s: 7.0.30, 7.4.14
-
Component/s: Agent2 plugin (G)
-
None
Current logic
In the Agent2 SMART plugin, smartctl exit status is used during discovery to decide whether the disk should be accepted.
Current logic in:
src/go/plugins/smart/controller.go
is effectively:
switch e.ExitCode() { case 1, 2, 4, 8: return true, nil case 0, 16, 32, 64, 128: return false, nil default: ... }
When the SMART query returns an error, discovery may skip the device and return no LLD entry for it.
Real example
The operating system sees four disks:
lsblk -d NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdd 8:48 0 894.3G 0 disk sdb 8:16 0 1.8T 0 disk sdc 8:32 0 894.3G 0 disk sda 8:0 0 1.8T 0 disk
Exit status:
smartctl -a /dev/sdd >/dev/null 2>&1; echo $?
4
However, smartct can still correctly identify and report the disk:
smartctl -a /dev/sdd -j
Relevant output:
{
"smartctl": {
"exit_status": 4
},
"device": {
"name": "/dev/sdd",
"info_name": "/dev/sdd [SAT]",
"type": "sat",
"protocol": "ATA"
},
"model_name": "SSDSC2KB960G8R",
"serial_number": "BTYF94930B59960CGN",
"firmware_version": "XCV1DL69",
"smart_status": {
"passed": true
}
}
So the disk clearly exists and is readable by smartctl.
But the SMART discovery result contains only:
[
{
"{#NAME}": "sdc sat",
"{#PATH}": "/dev/sdc"
},
{
"{#NAME}": "sda sat",
"{#PATH}": "/dev/sda"
},
{
"{#NAME}": "sdb sat",
"{#PATH}": "/dev/sdb"
}
]
/dev/sdd is missing from LLD
Problem
This behavior is not logical for disk discovery.
A disk can physically exist, be visible by the operating system and be readable by smartctl, but still return a non-zero SMART exit status.
In such a case the disk may:
- disappear from zabbix after run LDD smart.disk.discovery, or
- never be discovered at all if the problem already exists during the first discovery run.
This means that a problematic disk can disappear from LLD instead of Zabbix reporting the problem.
disk exists | smartctl detects and reports the disk | smartctl returns problem exit status | Zabbix discovery rejects it | disk disappears from LLD | disk is no longer monitored
This is the opposite of expected monitoring behavior.
Expected behavior
The disk should still be discovered and remain present in LLD.
Its SMART exit status should be reported as a monitoring problem for that disk, instead of using the exit status to decide whether the disk exists.
Expected logic:
disk exists | disk is discovered | SMART query returns error | disk remains in LLD | Zabbix reports SMART / exit status problem
Discovery should determine whether the disk exists and discovery should work independently from the SMART exit status.
- duplicates
-
ZBX-26359 Zabbix agent2 smart.disk.discovery fails due to strict exit status check on smartctl, preventing parsing of valid SMART data
-
- Closed
-