mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-03 00:11:49 +02:00
Merge pull request #986 from laf/issue-867
Added disk temp for Synology DSM
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if ($device['os'] == 'dsm') {
|
||||||
|
echo "DSM ";
|
||||||
|
$oid = '2';
|
||||||
|
$temp_oid = '.1.3.6.1.4.1.6574.1.2';
|
||||||
|
$current = snmp_get($device,$temp_oid,"-Oqv");
|
||||||
|
discover_sensor($valid['sensor'], 'temperature', $device, $temp_oid, $oid, 'snmp', 'System Temperature', '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||||
|
|
||||||
|
$disks = snmpwalk_cache_multi_oid($device, "diskTable", array(), "SYNOLOGY-DISK-MIB");
|
||||||
|
if (is_array($disks)) {
|
||||||
|
$cur_oid = '.1.3.6.1.4.1.6574.2.1.1.6.';
|
||||||
|
foreach ($disks as $index => $entry) {
|
||||||
|
$oid = $index;
|
||||||
|
$disk_oid = $cur_oid.$index;
|
||||||
|
$current = $entry['diskTemperature'];
|
||||||
|
$descr = $entry['diskID'] . ' ' . $entry['diskModel'];
|
||||||
|
discover_sensor($valid['sensor'], 'temperature', $device, $disk_oid, $oid, 'snmp', $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Executable
+141
@@ -0,0 +1,141 @@
|
|||||||
|
SYNOLOGY-DISK-MIB DEFINITIONS ::= BEGIN
|
||||||
|
|
||||||
|
IMPORTS
|
||||||
|
OBJECT-GROUP, MODULE-COMPLIANCE
|
||||||
|
FROM SNMPv2-CONF
|
||||||
|
enterprises, MODULE-IDENTITY, OBJECT-TYPE, Integer32
|
||||||
|
FROM SNMPv2-SMI;
|
||||||
|
|
||||||
|
synoDisk MODULE-IDENTITY
|
||||||
|
LAST-UPDATED "201309110000Z"
|
||||||
|
ORGANIZATION "www.synology.com"
|
||||||
|
CONTACT-INFO
|
||||||
|
"postal: Jay Pan
|
||||||
|
email: jaypan@synology.com"
|
||||||
|
DESCRIPTION
|
||||||
|
"Characteristics of the disk information"
|
||||||
|
REVISION "201309110000Z"
|
||||||
|
DESCRIPTION
|
||||||
|
"Second draft."
|
||||||
|
::= { synology 2 }
|
||||||
|
|
||||||
|
synology OBJECT IDENTIFIER
|
||||||
|
::= { enterprises 6574 }
|
||||||
|
|
||||||
|
diskTable OBJECT-TYPE
|
||||||
|
SYNTAX SEQUENCE OF DiskEntry
|
||||||
|
MAX-ACCESS not-accessible
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Synology disk table"
|
||||||
|
::= { synoDisk 1 }
|
||||||
|
|
||||||
|
diskEntry OBJECT-TYPE
|
||||||
|
SYNTAX DiskEntry
|
||||||
|
MAX-ACCESS not-accessible
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"For all disk entry"
|
||||||
|
INDEX { diskIndex }
|
||||||
|
::= { diskTable 1 }
|
||||||
|
|
||||||
|
DiskEntry ::= SEQUENCE {
|
||||||
|
diskIndex Integer32,
|
||||||
|
diskID OCTET STRING,
|
||||||
|
diskModel OCTET STRING,
|
||||||
|
diskType OCTET STRING,
|
||||||
|
diskStatus Integer32,
|
||||||
|
diskTemperature Integer32
|
||||||
|
}
|
||||||
|
|
||||||
|
diskIndex OBJECT-TYPE
|
||||||
|
SYNTAX Integer32(0..2147483647)
|
||||||
|
MAX-ACCESS not-accessible
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"The index of disk table"
|
||||||
|
::= { diskEntry 1 }
|
||||||
|
|
||||||
|
diskID OBJECT-TYPE
|
||||||
|
SYNTAX OCTET STRING
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Synology disk ID
|
||||||
|
The ID of disk is assigned by disk Station.
|
||||||
|
"
|
||||||
|
::= { diskEntry 2 }
|
||||||
|
|
||||||
|
diskModel OBJECT-TYPE
|
||||||
|
SYNTAX OCTET STRING
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Synology disk model name
|
||||||
|
The disk model name will be showed here.
|
||||||
|
"
|
||||||
|
::= { diskEntry 3 }
|
||||||
|
|
||||||
|
diskType OBJECT-TYPE
|
||||||
|
SYNTAX OCTET STRING
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Synology disk type
|
||||||
|
The type of disk will be showed here, including SATA, SSD and so on.
|
||||||
|
"
|
||||||
|
::= { diskEntry 4 }
|
||||||
|
|
||||||
|
diskStatus OBJECT-TYPE
|
||||||
|
SYNTAX Integer32(1..5)
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Synology disk status
|
||||||
|
Each meanings of status represented describe below.
|
||||||
|
|
||||||
|
Normal(1): The hard disk functions normally.
|
||||||
|
Initialized(2): The hard disk has system partition but no data.
|
||||||
|
NotInitialized(3): The hard disk does not have system in system partition.
|
||||||
|
SystemPartitionFailed(4): The system partitions on the hard disks are damaged.
|
||||||
|
Crashed(5): The hard disk has damaged.
|
||||||
|
"
|
||||||
|
::= { diskEntry 5 }
|
||||||
|
|
||||||
|
diskTemperature OBJECT-TYPE
|
||||||
|
SYNTAX Integer32
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Synology disk temperature
|
||||||
|
The temperature of each disk uses Celsius degree.
|
||||||
|
"
|
||||||
|
::= { diskEntry 6 }
|
||||||
|
|
||||||
|
diskConformance OBJECT IDENTIFIER ::= { synoDisk 2 }
|
||||||
|
diskCompliances OBJECT IDENTIFIER ::= { diskConformance 1 }
|
||||||
|
diskGroups OBJECT IDENTIFIER ::= { diskConformance 2 }
|
||||||
|
|
||||||
|
diskCompliance MODULE-COMPLIANCE
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"The compliance statement for synoDisk entities which
|
||||||
|
implement the SYNOLOGY DISK MIB."
|
||||||
|
MODULE -- this module
|
||||||
|
MANDATORY-GROUPS { diskGroup }
|
||||||
|
|
||||||
|
::= { diskCompliances 1 }
|
||||||
|
|
||||||
|
diskGroup OBJECT-GROUP
|
||||||
|
OBJECTS { diskID,
|
||||||
|
diskModel,
|
||||||
|
diskType,
|
||||||
|
diskStatus,
|
||||||
|
diskTemperature}
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"A collection of objects providing basic information
|
||||||
|
of an synology disk entity."
|
||||||
|
::= { diskGroups 1 }
|
||||||
|
|
||||||
|
END
|
||||||
Executable
+156
@@ -0,0 +1,156 @@
|
|||||||
|
SYNOLOGY-SYSTEM-MIB DEFINITIONS ::= BEGIN
|
||||||
|
|
||||||
|
IMPORTS
|
||||||
|
OBJECT-GROUP, MODULE-COMPLIANCE
|
||||||
|
FROM SNMPv2-CONF
|
||||||
|
enterprises, MODULE-IDENTITY, OBJECT-TYPE, Integer32
|
||||||
|
FROM SNMPv2-SMI;
|
||||||
|
|
||||||
|
synoSystem MODULE-IDENTITY
|
||||||
|
LAST-UPDATED "201309110000Z"
|
||||||
|
ORGANIZATION "www.synology.com"
|
||||||
|
CONTACT-INFO
|
||||||
|
"postal: Jay Pan
|
||||||
|
email: jaypan@synology.com"
|
||||||
|
DESCRIPTION
|
||||||
|
"Characteristics of the system information"
|
||||||
|
REVISION "201309110000Z"
|
||||||
|
DESCRIPTION
|
||||||
|
"Second draft."
|
||||||
|
::= { synology 1 }
|
||||||
|
|
||||||
|
synology OBJECT IDENTIFIER
|
||||||
|
::= { enterprises 6574 }
|
||||||
|
|
||||||
|
systemStatus OBJECT-TYPE
|
||||||
|
SYNTAX Integer32(1..2)
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Synology system status
|
||||||
|
Each meanings of status represented describe below.
|
||||||
|
Normal(1): System functionals normally.
|
||||||
|
Failed(2): Volume has crashed.
|
||||||
|
"
|
||||||
|
::= { synoSystem 1 }
|
||||||
|
|
||||||
|
temperature OBJECT-TYPE
|
||||||
|
SYNTAX Integer32
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Synology system temperature
|
||||||
|
The temperature of Disk Station uses Celsius degree.
|
||||||
|
"
|
||||||
|
::= { synoSystem 2 }
|
||||||
|
|
||||||
|
powerStatus OBJECT-TYPE
|
||||||
|
SYNTAX Integer32(1..2)
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Synology power status
|
||||||
|
Each meanings of status represented describe below.
|
||||||
|
Normal(1): All power supplies functional normally.
|
||||||
|
Failed(2): One of power supply has failed.
|
||||||
|
"
|
||||||
|
::= { synoSystem 3 }
|
||||||
|
|
||||||
|
fan OBJECT IDENTIFIER ::= { synoSystem 4 }
|
||||||
|
|
||||||
|
systemFanStatus OBJECT-TYPE
|
||||||
|
SYNTAX Integer32(1..2)
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Synology system fan status
|
||||||
|
Each meanings of status represented describe below.
|
||||||
|
Normal(1): All Internal fans functional normally.
|
||||||
|
Failed(2): One of internal fan stopped.
|
||||||
|
"
|
||||||
|
::= { fan 1 }
|
||||||
|
|
||||||
|
|
||||||
|
cpuFanStatus OBJECT-TYPE
|
||||||
|
SYNTAX Integer32(1..2)
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Synology cpu fan status
|
||||||
|
Each meanings of status represented describe below.
|
||||||
|
Normal(1): All CPU fans functional normally.
|
||||||
|
Failed(2): One of CPU fan stopped.
|
||||||
|
"
|
||||||
|
::= { fan 2 }
|
||||||
|
|
||||||
|
dsmInfo OBJECT IDENTIFIER ::= { synoSystem 5 }
|
||||||
|
|
||||||
|
modelName OBJECT-TYPE
|
||||||
|
SYNTAX OCTET STRING
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"The Model name of this NAS"
|
||||||
|
::= { dsmInfo 1 }
|
||||||
|
|
||||||
|
serialNumber OBJECT-TYPE
|
||||||
|
SYNTAX OCTET STRING
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"The serial number of this NAS"
|
||||||
|
::= { dsmInfo 2 }
|
||||||
|
|
||||||
|
version OBJECT-TYPE
|
||||||
|
SYNTAX OCTET STRING
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"The version of this DSM"
|
||||||
|
::= { dsmInfo 3 }
|
||||||
|
|
||||||
|
upgradeAvailable OBJECT-TYPE
|
||||||
|
SYNTAX Integer32(1..5)
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"This oid is for checking whether there is a latest DSM can be upgraded.
|
||||||
|
Available(1): There is version ready for download.
|
||||||
|
Unavailable(2): The DSM is latest version.
|
||||||
|
Connecting(3): Checking for the latest DSM.
|
||||||
|
Disconnected(4): Failed to connect to server.
|
||||||
|
Others(5): If DSM is upgrading or downloading, the status will show others."
|
||||||
|
::= { dsmInfo 4 }
|
||||||
|
|
||||||
|
|
||||||
|
systemConformance OBJECT IDENTIFIER ::= { synoSystem 6 }
|
||||||
|
systemCompliances OBJECT IDENTIFIER ::= { systemConformance 1 }
|
||||||
|
systemGroups OBJECT IDENTIFIER ::= { systemConformance 2 }
|
||||||
|
|
||||||
|
systemCompliance MODULE-COMPLIANCE
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"The compliance statement for synoSystem entities which
|
||||||
|
implement the SYNOLOGY SYSTEM MIB."
|
||||||
|
MODULE -- this module
|
||||||
|
MANDATORY-GROUPS { systemGroup }
|
||||||
|
|
||||||
|
::= { systemCompliances 1 }
|
||||||
|
|
||||||
|
systemGroup OBJECT-GROUP
|
||||||
|
OBJECTS { systemStatus,
|
||||||
|
temperature,
|
||||||
|
powerStatus,
|
||||||
|
systemFanStatus,
|
||||||
|
cpuFanStatus,
|
||||||
|
modelName,
|
||||||
|
serialNumber,
|
||||||
|
version,
|
||||||
|
upgradeAvailable }
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"A collection of objects providing basic information
|
||||||
|
of an synology system entity."
|
||||||
|
::= { systemGroups 1 }
|
||||||
|
|
||||||
|
END
|
||||||
Reference in New Issue
Block a user