v-zhuravlev / zbx-smartctl

Templates and scripts for monitoring disks health with Zabbix and smartmontools
https://share.zabbix.com/storage-devices/smartmontools/smart-monitoring-with-smartmontools-lld
GNU General Public License v3.0
245 stars 127 forks source link

Identify disk by ID, not system name #73

Open cluelessperson opened 5 years ago

cluelessperson commented 5 years ago

Example

/dev/disk/by-id/ata-HGST_<MODEL>_<SERIAL>

instead of

/dev/sda

which changes on reboots and such.

rkarlsba commented 5 years ago

I would like this change very much. I've seen spurious false positives after device names change. This is possibly a linux issue, so it should be checked if the machine is running linux first. I'll try to fix it myself, perhaps…

rkarlsba commented 5 years ago

I just posted a pull request for this

bbrendon commented 5 years ago

Great idea.

rkarlsba commented 5 years ago

See pull request #106

gabviv73 commented 5 years ago

I suggest by-path, not by-id, because one can change sata hot swap disk daily to take backups. Same disk path, but different disk id. Path never changes.

cluelessperson commented 5 years ago

Agreed

On Thu, Jul 11, 2019, 9:04 AM GabrieleV notifications@github.com wrote:

I suggest by-path, not by-id, because one can change sata hot swap disk daily to take backups. Same disk path, but different disk id. Path never changes.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/v-zhuravlev/zbx-smartctl/issues/73?email_source=notifications&email_token=ABK7ZNIUE6ERP4M6DLXCVQLP65K2DA5CNFSM4GHNF3F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZXFZRI#issuecomment-510549189, or mute the thread https://github.com/notifications/unsubscribe-auth/ABK7ZNLTFCG6O5ZTYHCIGB3P65K2DANCNFSM4GHNF3FQ .

rkarlsba commented 5 years ago

I still like by-id better, since if you were to accidentially reorder the disks, they stay the same. Also, I would never use hotplugging disks for backup. Backups go over the net.

gabviv73 commented 5 years ago

I would be nice to have a config entry to choose from by-id, by-path. We use hotplugging to take backup media offsite manually.

Phlogi commented 4 years ago

I fully agree that this pull request is important, as the disk enumeration changes too often between reboots. Also, if there is historic data, e.g. temperature, it's difficult to track a specific device when the identifier changes.

cluelessperson commented 4 years ago

I noticed this is marked as an "enhancement" I suggest it's more of a bug.

rkarlsba commented 4 years ago

I don't know why this hasn't been pulled. The code is rather straight-forward.