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

Script doesn't show sg devices in Zabbix #166

Open lllDez opened 3 years ago

lllDez commented 3 years ago

Hello!

Help me to understand this problem please. When i'm executing discovery script throught terminal i'm seeing this:

{ "data":[ { "{#DISKMODEL}":"TS120GSSD220S", "{#DISKSN}":"022591D5D95103110394", "{#DISKNAME}":"/dev/sda", "{#DISKCMD}":"/dev/sda -d sat", "{#SMART_ENABLED}":"1", "{#DISKTYPE}":"2" }, { "{#DISKMODEL}":"INTEL SSDSA2CW120G3", "{#DISKSN}":"CVPR1270037R120LGN", "{#DISKNAME}":"/dev/sdb", "{#DISKCMD}":"/dev/sdb -d sat", "{#SMART_ENABLED}":"1", "{#DISKTYPE}":"1" }, { "{#DISKMODEL}":"LSI Logical Volume ", "{#DISKSN}":"", "{#DISKNAME}":"/dev/sdc", "{#DISKCMD}":"/dev/sdc -d scsi", "{#SMART_ENABLED}":"0", "{#DISKTYPE}":"2" }, { "{#DISKMODEL}":"LSI Logical Volume ", "{#DISKSN}":"", "{#DISKNAME}":"/dev/sg2", "{#DISKCMD}":"/dev/sg2", "{#SMART_ENABLED}":"0", "{#DISKTYPE}":"2" }, { "{#DISKMODEL}":"HITACHI HUS153014VLS300 ", "{#DISKSN}":"JNVMDBPC", "{#DISKNAME}":"/dev/sg3", "{#DISKCMD}":"/dev/sg3", "{#SMART_ENABLED}":"1", "{#DISKTYPE}":"2" }, { "{#DISKMODEL}":"HITACHI HUS153014VLS300 ", "{#DISKSN}":"JNVLS3ZC", "{#DISKNAME}":"/dev/sg4", "{#DISKCMD}":"/dev/sg4", "{#SMART_ENABLED}":"1", "{#DISKTYPE}":"2" }, { "{#DISKMODEL}":"HITACHI HUS153014VLS300 ", "{#DISKSN}":"JNVMEDNC", "{#DISKNAME}":"/dev/sg5", "{#DISKCMD}":"/dev/sg5", "{#SMART_ENABLED}":"1", "{#DISKTYPE}":"2" }, { "{#DISKMODEL}":"HITACHI HUS153014VLS300 ", "{#DISKSN}":"JNVM4LBC", "{#DISKNAME}":"/dev/sg6", "{#DISKCMD}":"/dev/sg6", "{#SMART_ENABLED}":"1", "{#DISKTYPE}":"2" } ] }

And this is example from one of the sg devices:

smartctl -d scsi -a /dev/sg3

smartctl 5.41 2011-06-09 r3365 [x86_64-linux-2.6.32-48-pve] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

Vendor: HITACHI Product: HUS153014VLS300 Revision: A410 User Capacity: 147,015,821,824 bytes [147 GB] Logical block size: 512 bytes Logical Unit id: 0x5000cca01123460c Serial number: JNVMDBPC Device type: disk Transport protocol: SAS Local Time is: Tue Aug 17 11:50:27 2021 MSK Device supports SMART and is Enabled Temperature Warning Enabled SMART Health Status: OK

Current Drive Temperature: 36 C Drive Trip Temperature: 85 C Manufactured in week 51 of year 2009 Specified cycle count over device lifetime: 50000 Accumulated start-stop cycles: 72 Elements in grown defect list: 0 Vendor (Seagate) cache information Blocks sent to initiator = 47743968707870720

Error counter log: Errors Corrected by Total Correction Gigabytes Total ECC rereads/ errors algorithm processed uncorrected fast | delayed rewrites corrected invocations [10^9 bytes] errors read: 0 48 0 48 51 143.155 0 write: 0 7647768 0 7647768 7663929 45216.993 0 verify: 0 169163 0 169163 178327 6804.528 0

Non-medium error count: 0 No self-tests have been logged Long (extended) Self Test duration: 1807 seconds [30.1 minutes]

Problem is that these sg devices doesn't appear in Zabbix and i can't see them. How can i fix this?