Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Sep 2010 08:05:33 -0700 (PDT)
From:      Jeremy Chadwick <freebsd@jdc.parodius.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        mav@FreeBSD.org, philip@paeps.cx, harti@FreeBSD.org
Subject:   bin/150723: bsnmpd(1): add knowledge of "ada" disks (ATA via SCSI CAM)
Message-ID:  <20100919150533.873439B427@icarus.home.lan>
Resent-Message-ID: <201009191520.o8JFK0oM052106@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         150723
>Category:       bin
>Synopsis:       bsnmpd(1): add knowledge of "ada" disks (ATA via SCSI CAM)
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 19 15:20:00 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Jeremy Chadwick
>Release:        FreeBSD 8.1-STABLE amd64
>Organization:
>Environment:
System: FreeBSD icarus.home.lan 8.1-STABLE FreeBSD 8.1-STABLE #0: Wed Sep 15 14:59:46 PDT 2010 root@icarus.home.lan:/usr/obj/usr/src/sys/X7SBA_RELENG_8_amd64 amd64
>Description:
	bsnmpd(1) does not properly handle disks attached to the ada(4)
	subsystem.  The daemon outputs the following syslog errors when
	starting:

snmpd[2964]: disk_OS_get_disks: device 'ada3' not in device list
snmpd[2964]: disk_OS_get_disks: device 'ada2' not in device list
snmpd[2964]: disk_OS_get_disks: device 'ada1' not in device list
snmpd[2964]: disk_OS_get_disks: device 'ada0' not in device list

	This is for a system with the following in sysctl kern.disks:

kern.disks: ada3 ada2 ada1 ada0

	These disks are:

ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <WDC WD3000HLFS-01G6U0 04.04V01> ATA-8 SATA 2.x device
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 286168MB (586072368 512 byte sectors: 16H 63S/T 16383C)
ada1 at ahcich1 bus 0 scbus1 target 0 lun 0
ada1: <WDC WD1001FALS-00U9B0 05.00K05> ATA-8 SATA 2.x device
ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada1: Command Queueing enabled
ada1: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C)
ada2 at ahcich2 bus 0 scbus2 target 0 lun 0
ada2: <WDC WD1001FALS-00U9B0 05.00K05> ATA-8 SATA 2.x device
ada2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada2: Command Queueing enabled
ada2: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C)
ada3 at ahcich3 bus 0 scbus3 target 0 lun 0
ada3: <WDC WD1001FALS-00U9B0 05.00K05> ATA-8 SATA 2.x device
ada3: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada3: Command Queueing enabled
ada3: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C)

	Walking the appropriate OID branches is interesting:

	- hrDeviceType is correct
	- hrDeviceDescr doesn't show the hard disk model/firmware version
	- hrDeviceStatus is incorrect
	- hrDiskStorageMedia is incorrect
	- hrDiskStorageCapacity is correct
	- (Unrelated) hrDiskStorageRemoveble appears to have a typo in its
	  MIB name (should be hrDiskStorageRemovable -- "a", not "e"!)

hrDeviceTable =
HOST-RESOURCES-MIB::hrDeviceIndex.158 = INTEGER: 158
HOST-RESOURCES-MIB::hrDeviceIndex.159 = INTEGER: 159
HOST-RESOURCES-MIB::hrDeviceIndex.160 = INTEGER: 160
HOST-RESOURCES-MIB::hrDeviceIndex.161 = INTEGER: 161
HOST-RESOURCES-MIB::hrDeviceType.158 = OID: HOST-RESOURCES-TYPES::hrDeviceDiskStorage
HOST-RESOURCES-MIB::hrDeviceType.159 = OID: HOST-RESOURCES-TYPES::hrDeviceDiskStorage
HOST-RESOURCES-MIB::hrDeviceType.160 = OID: HOST-RESOURCES-TYPES::hrDeviceDiskStorage
HOST-RESOURCES-MIB::hrDeviceType.161 = OID: HOST-RESOURCES-TYPES::hrDeviceDiskStorage
HOST-RESOURCES-MIB::hrDeviceDescr.158 = STRING: ada3:
HOST-RESOURCES-MIB::hrDeviceDescr.159 = STRING: ada2:
HOST-RESOURCES-MIB::hrDeviceDescr.160 = STRING: ada1:
HOST-RESOURCES-MIB::hrDeviceDescr.161 = STRING: ada0:
HOST-RESOURCES-MIB::hrDeviceID.158 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.159 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.160 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.161 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceStatus.158 = INTEGER: unknown(1)
HOST-RESOURCES-MIB::hrDeviceStatus.159 = INTEGER: unknown(1)
HOST-RESOURCES-MIB::hrDeviceStatus.160 = INTEGER: unknown(1)
HOST-RESOURCES-MIB::hrDeviceStatus.161 = INTEGER: unknown(1)
HOST-RESOURCES-MIB::hrDeviceErrors.158 = Counter32: 0
HOST-RESOURCES-MIB::hrDeviceErrors.159 = Counter32: 0
HOST-RESOURCES-MIB::hrDeviceErrors.160 = Counter32: 0
HOST-RESOURCES-MIB::hrDeviceErrors.161 = Counter32: 0

hrDiskStorageTable =
HOST-RESOURCES-MIB::hrDiskStorageAccess.158 = INTEGER: readWrite(1)
HOST-RESOURCES-MIB::hrDiskStorageAccess.159 = INTEGER: readWrite(1)
HOST-RESOURCES-MIB::hrDiskStorageAccess.160 = INTEGER: readWrite(1)
HOST-RESOURCES-MIB::hrDiskStorageAccess.161 = INTEGER: readWrite(1)
HOST-RESOURCES-MIB::hrDiskStorageMedia.158 = INTEGER: unknown(2)
HOST-RESOURCES-MIB::hrDiskStorageMedia.159 = INTEGER: unknown(2)
HOST-RESOURCES-MIB::hrDiskStorageMedia.160 = INTEGER: unknown(2)
HOST-RESOURCES-MIB::hrDiskStorageMedia.161 = INTEGER: unknown(2)
HOST-RESOURCES-MIB::hrDiskStorageRemoveble.158 = INTEGER: false(2)
HOST-RESOURCES-MIB::hrDiskStorageRemoveble.159 = INTEGER: false(2)
HOST-RESOURCES-MIB::hrDiskStorageRemoveble.160 = INTEGER: false(2)
HOST-RESOURCES-MIB::hrDiskStorageRemoveble.161 = INTEGER: false(2)
HOST-RESOURCES-MIB::hrDiskStorageCapacity.158 = INTEGER: 976762584 KBytes
HOST-RESOURCES-MIB::hrDiskStorageCapacity.159 = INTEGER: 976762584 KBytes
HOST-RESOURCES-MIB::hrDiskStorageCapacity.160 = INTEGER: 976762584 KBytes
HOST-RESOURCES-MIB::hrDiskStorageCapacity.161 = INTEGER: 293036184 KBytes
>How-To-Repeat:
	Run bsnmpd on a machine with ada(4) disks.
>Fix:
	Things I've tried:

	- Modifying modules/snmp_hostres/hostres_diskstorage_tbl.c, around
	  line 476, to include a strncmp() for "ada".  This does improve
	  things slightly, but not enough to get disk_OS_get_disks() to
	  stop complaining
	- Modifying modules/snmp_hostres/hostres_diskstorage_tbl.c, around
	  line 260, adding "ada" to the lookup[] structure.  This may have
	  had an effect, but again, not enough to get disk_OS_get_disks()
	  to stop complaining

	I'm marking this as high priority because lots of server admins
	at this point are using ada(4) instead of ad(4).

	I can provide patches for the hrDiskStorageRemoveble typo if need
	be, but the other stuff will need some who's a bit more familiar
	with the device_find_by_name() framework and why it's returning
	NULL for ada(4) devices.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100919150533.873439B427>