# check_smart

This plugin/program is used to check the health of all installed disks.

## Requirements

There are no special requirements needed to run this Plugin

## Monitoring States

There are four different monitoring states:

- CRITICAL
- WARNING
- UNKNOWN
- OK

### CRTITICAL

This state could occur when:

- One or more bits returned by ``smartctl`` equals 1:
    -> Bit 2: Some SMART or other ATA command to the disk failed, or there was a checksum error in a SMART data structure (see '-b' option above). Is the disk an NVMe SSD then ``smartctl`` was unable to read the SMART/Health information.
    -> Bit 3: SMART status check returned "DISK FAILING". --> except the disk is a SSD or NVMe. This bit will be checked with an extra conditional (see the second reason of this state)
    -> Bit 4: We found prefail Attributes <= threshold.
    -> Bit 5: SMART status check returned "DISK OK" but we found that some (usage or prefail) Attributes have been <= threshold at some time in the past.
    -> Bit 6: The device error log contains records of errors.
    -> Bit 7: The device self-test log contains records of errors.  [ATA only] Failed self-tests outdated by a newer successful extended self-test are ignored.
    > Source: Manual of ``smartctl``
- The value of ``Available Spare`` is less or equal to ``Available Spare Threshold`` -> if this is the case a disk replacement should immediately issued

### WARNING

This state could occur when the lifetime of one or more disks were reached.

### UNKNOWN

This state should rarely to never occur. But if so the reasons could be that ``smartctl`` was unable to open the disk for checking its health because of e.g. lacking permissions.
Another reason could be that there was no disk found on the target system.

### OK

All disks are healthy
