Add data scrubbing state to Synology RAID status (#9661)

* Add data scrubbing state to Synology RAID status

Adds a new state translation to Synology DSM RAID status sensor, so it displays "DataScrubbing" while the operation is running. Previously it would just show "# 13".

* Update Synology RAID MIB

Downloaded from
https://global.download.synology.com/download/Document/MIBGuide/Synology_MIB_File.zip
This commit is contained in:
Florian Beer
2019-03-04 23:06:12 +01:00
committed by Tony Murray
parent 7f104d4fd9
commit 80d0a23e8f
2 changed files with 36 additions and 2 deletions

View File

@@ -111,7 +111,7 @@ if (is_numeric($state)) {
create_sensor_to_state_index($device, $state_name, $index);
}
// RAID Status OID (Value : 1 Normal, 2 Repairing, 3 Migrating, 4 Expanding, 5 Deleting, 6 Creating, 7 RaidSyncing, 8 RaidParityChecking, 9 RaidAssembling, 10 Canceling, 11 Degrade, 12 Crashed)
// RAID Status OID (Value : 1 Normal, 2 Repairing, 3 Migrating, 4 Expanding, 5 Deleting, 6 Creating, 7 RaidSyncing, 8 RaidParityChecking, 9 RaidAssembling, 10 Canceling, 11 Degrade, 12 Crashed, 13 DataScrubbing)
$oids = snmpwalk_cache_multi_oid($device, 'raidTable', [], 'SYNOLOGY-RAID-MIB');
$cur_oid = '.1.3.6.1.4.1.6574.3.1.1.3.';
@@ -131,6 +131,7 @@ if (is_array($oids)) {
['value' => 10, 'generic' => 1, 'graph' => 0, 'descr' => 'Canceling'],
['value' => 11, 'generic' => 2, 'graph' => 0, 'descr' => 'Degrade'],
['value' => 12, 'generic' => 2, 'graph' => 0, 'descr' => 'Crashed'],
['value' => 13, 'generic' => 1, 'graph' => 0, 'descr' => 'DataScrubbing'],
];
create_state_index($state_name, $states);

View File

@@ -42,7 +42,9 @@ raidEntry OBJECT-TYPE
RaidEntry ::= SEQUENCE {
raidIndex Integer32,
raidName OCTET STRING,
raidStatus Integer32
raidStatus Integer32,
raidFreeSize Counter64,
raidTotalSize Counter64
}
raidIndex OBJECT-TYPE
@@ -73,12 +75,43 @@ raidStatus OBJECT-TYPE
Normal(1): The raid functions normally.
Degrade(11): Degrade happens when a tolerable failure of disk(s) occurs.
Crashed(12): Raid has crashed and just uses for read-only operation.
** 2018/6/15 add **
DataScrubbing(13): Raid status is DATASCRUBBING
RaidDeploying(14) : Deploying Single volume on pool
RaidUnDeploying(15): Undeploying Single volume on pool
RaidMountCache(16): Mounting SSD cache
RaidUnmountCache(17): Unmounting SSD cache
RaidExpandingUnfinishedSHR(18): Continue expand SHR if interrupted
RaidConvertSHRToPool(19): Converting Single volume on SHR to mutiple volume on SHR
RaidMigrateSHR1ToSHR2(20): Migrating SHR1 to SHR2
RaidUnknownStatus(21): Unknown raid status
** END **
Note:
Other status will be showed when creating or deleting raids, including below status, Repairing(2), Migrating(3), Expanding(4), Deleting(5), Creating(6), RaidSyncing(7), RaidParityChecking(8), RaidAssembling(9) and Canceling(10).
"
::= { raidEntry 3 }
raidFreeSize OBJECT-TYPE
SYNTAX Counter64
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Synology raid freesize
Free space in bytes.
"
::= { raidEntry 4 }
raidTotalSize OBJECT-TYPE
SYNTAX Counter64
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Synology raid totalsize
Total space in bytes.
"
::= { raidEntry 5 }
raidConformance OBJECT IDENTIFIER ::= { synoRaid 2 }
raidCompliances OBJECT IDENTIFIER ::= { raidConformance 1 }