Synology DiskStation 218+ monitoring via SNMP (new binding used)

Hello to everyone!
I would like to show how to configure Synology DS 218+ for SNMP monitoring and bind it to openHAB. First of all, I want to thank @MikeTheTux for his excellent explanation. I based my configuration on his post synology-diskstation-monitoring-via-snmp and made some changes.

Prerequisites:

  1. Enable SNMPv2c in DiskStation and set community to “public”.
  2. Install OpenHAB SNMP Binding ( NOT SNMP1 Binding).
  3. Install JavaScript and Map transformation service.

synology.things


Thing snmp:target:nas "Synology NAS (SNMP)"[ hostname="192.168.***.***", protocol="v2c", community="public"] {
    Channels:        
        Type number : systemStatus [oid=".1.3.6.1.4.1.6574.1.1.0", mode="READ"]
        Type number : systemTemperature [oid=".1.3.6.1.4.1.6574.1.2.0", mode="READ"]
        Type number : powerStatus [oid=".1.3.6.1.4.1.6574.1.3.0", mode="READ"]
        Type number : systemFanStatus [oid=".1.3.6.1.4.1.6574.1.4.1.0", mode="READ"]
        Type number : cpuFanStatus [oid=".1.3.6.1.4.1.6574.1.4.2.0", mode="READ"]
        Type string : modelName [oid=".1.3.6.1.4.1.6574.1.5.1.0", mode="READ"]
        Type string : serialNumber [oid=".1.3.6.1.4.1.6574.1.5.2.0", mode="READ"]
        Type string : version [oid=".1.3.6.1.4.1.6574.1.5.3.0", mode="READ"]
        Type number : upgradeAvailable [oid=".1.3.6.1.4.1.6574.1.5.4.0", mode="READ"]
        Type string : diskID1 [oid=".1.3.6.1.4.1.6574.2.1.1.2.0", mode="READ"]
        Type string : diskID2 [oid=".1.3.6.1.4.1.6574.2.1.1.2.1", mode="READ"]
        Type string : diskModel1 [oid=".1.3.6.1.4.1.6574.2.1.1.3.0", mode="READ"]
        Type string : diskModel2 [oid=".1.3.6.1.4.1.6574.2.1.1.3.1", mode="READ"]
        Type string : diskType1 [oid=".1.3.6.1.4.1.6574.2.1.1.4.0", mode="READ"]
        Type string : diskType2 [oid=".1.3.6.1.4.1.6574.2.1.1.4.1", mode="READ"]
        Type number : diskStatus1 [oid=".1.3.6.1.4.1.6574.2.1.1.5.0", mode="READ"]
        Type number : diskStatus2 [oid=".1.3.6.1.4.1.6574.2.1.1.5.1",mode="READ"]
        Type number : diskTemperature1 [oid=".1.3.6.1.4.1.6574.2.1.1.6.0", mode="READ"]
        Type number : diskTemperature2 [oid=".1.3.6.1.4.1.6574.2.1.1.6.1", mode="READ"]
        Type string : raidName [oid=".1.3.6.1.4.1.6574.3.1.1.2.0", mode="READ"]
        Type number : raidStatus [oid=".1.3.6.1.4.1.6574.3.1.1.3.0", mode="READ"]
        Type number : raidFreeSize [oid=".1.3.6.1.4.1.6574.3.1.1.4.0", mode="READ"]
        Type number : raidTotalSize [oid=".1.3.6.1.4.1.6574.3.1.1.5.0", mode="READ"]        
        Type string : rawReadErrorRate1 [oid=".1.3.6.1.4.1.6574.5.1.1.9.1", mode="READ"]
        Type string : spinUpTime1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.2", mode="READ"]
        Type string : startStopCount1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.3", mode="READ"]
        Type string : reallocatedSectorCt1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.4", mode="READ"]
        Type string : seekErrorRate1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.5", mode="READ"]
        Type string : powerOnHours1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.6", mode="READ"]
        Type string : spinRetryCount1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.7", mode="READ"]       
        Type string : calibrationRetryCount1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.8", mode="READ"]
        Type string : powerCycleCount1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.9", mode="READ"]        
        Type string : powerOffRetractCount1 [oid=".1.3.6.1.4.1.6574.5.1.1.9.10", mode="READ"]        
        Type string : loadCycleCount1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.11", mode="READ"]       
        Type string : temperatureCelsius1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.12", mode="READ"]        
        Type string : reallocatedEventCount1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.13", mode="READ"]        
        Type string : currentPendingSector1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.14", mode="READ"]        
        Type string : offlineUncorrectable1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.15", mode="READ"]
        Type string : uDMACRCErrorCount1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.16", mode="READ"]
        Type string : multiZoneErrorRate1  [oid=".1.3.6.1.4.1.6574.5.1.1.9.17", mode="READ"]        
        Type string : rawReadErrorRate2 [oid=".1.3.6.1.4.1.6574.5.1.1.9.18", mode="READ"]
        Type string : spinUpTime2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.19", mode="READ"]
        Type string : startStopCount2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.20", mode="READ"]
        Type string : reallocatedSectorCt2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.21", mode="READ"]
        Type string : seekErrorRate2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.22", mode="READ"]
        Type string : powerOnHours2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.23", mode="READ"]
        Type string : spinRetryCount2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.24", mode="READ"]        
        Type string : calibrationRetryCount2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.25", mode="READ"]
        Type string : powerCycleCount2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.26", mode="READ"]        
        Type string : powerOffRetractCount2 [oid=".1.3.6.1.4.1.6574.5.1.1.9.27", mode="READ"]        
        Type string : loadCycleCount2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.28", mode="READ"]        
        Type string : temperatureCelsius2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.29", mode="READ"]        
        Type string : reallocatedEventCount2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.30", mode="READ"]        
        Type string : currentPendingSector2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.31", mode="READ"]        
        Type string : offlineUncorrectable2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.32", mode="READ"]
        Type string : uDMACRCErrorCount2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.33", mode="READ"]
        Type string : multiZoneErrorRate2  [oid=".1.3.6.1.4.1.6574.5.1.1.9.34", mode="READ"]        
        Type string : serviceName1  [oid=".1.3.6.1.4.1.6574.6.1.1.2.1", mode="READ"]
        Type number : serviceUsers1  [oid=".1.3.6.1.4.1.6574.6.1.1.3.1", mode="READ"]
        Type string : serviceName2  [oid=".1.3.6.1.4.1.6574.6.1.1.2.2", mode="READ"]
        Type number : serviceUsers2  [oid=".1.3.6.1.4.1.6574.6.1.1.3.2", mode="READ"]
        Type string : serviceName3  [oid=".1.3.6.1.4.1.6574.6.1.1.2.3", mode="READ"]
        Type number : serviceUsers3  [oid=".1.3.6.1.4.1.6574.6.1.1.3.3", mode="READ"]
        Type string : serviceName4  [oid=".1.3.6.1.4.1.6574.6.1.1.2.4", mode="READ"]
        Type number : serviceUsers4  [oid=".1.3.6.1.4.1.6574.6.1.1.3.4", mode="READ"]
        Type string : serviceName5  [oid=".1.3.6.1.4.1.6574.6.1.1.2.5", mode="READ"]
        Type number : serviceUsers5  [oid=".1.3.6.1.4.1.6574.6.1.1.3.5", mode="READ"]
        Type string : serviceName6  [oid=".1.3.6.1.4.1.6574.6.1.1.2.6", mode="READ"]
        Type number : serviceUsers6  [oid=".1.3.6.1.4.1.6574.6.1.1.3.6", mode="READ"]
        Type string : serviceName7  [oid=".1.3.6.1.4.1.6574.6.1.1.2.7", mode="READ"]
        Type number : serviceUsers7  [oid=".1.3.6.1.4.1.6574.6.1.1.3.7", mode="READ"]
        Type string : serviceName8  [oid=".1.3.6.1.4.1.6574.6.1.1.2.8", mode="READ"]
        Type number : serviceUsers8  [oid=".1.3.6.1.4.1.6574.6.1.1.3.8", mode="READ"]
        Type string : serviceName9  [oid=".1.3.6.1.4.1.6574.6.1.1.2.9", mode="READ"]
        Type number : serviceUsers9  [oid=".1.3.6.1.4.1.6574.6.1.1.3.9", mode="READ"]
        Type string : storageIODevice1  [oid=".1.3.6.1.4.1.6574.101.1.1.2.1", mode="READ"]
        Type number : storageIOReads1  [oid=".1.3.6.1.4.1.6574.101.1.1.5.1", mode="READ"]
        Type number : storageIOWrites1  [oid=".1.3.6.1.4.1.6574.101.1.1.6.1", mode="READ"]
        Type number : storageIOLA1  [oid=".1.3.6.1.4.1.6574.101.1.1.8.1", mode="READ"]
        Type number : storageIOLA11  [oid=".1.3.6.1.4.1.6574.101.1.1.9.1", mode="READ"]
        Type number : storageIOLA15  [oid=".1.3.6.1.4.1.6574.101.1.1.10.1", mode="READ"]
        Type number : storageIOLA115  [oid=".1.3.6.1.4.1.6574.101.1.1.11.1", mode="READ"]
        Type number : storageIONReadX1  [oid=".1.3.6.1.4.1.6574.101.1.1.12.1", mode="READ"]
        Type number : storageIONWrittenX1  [oid=".1.3.6.1.4.1.6574.101.1.1.13.1", mode="READ"]
        Type string : storageIODevice2 [oid=".1.3.6.1.4.1.6574.101.1.1.2.2", mode="READ"]
        Type number : storageIOReads2  [oid=".1.3.6.1.4.1.6574.101.1.1.5.2", mode="READ"]
        Type number : storageIOWrites2  [oid=".1.3.6.1.4.1.6574.101.1.1.6.2", mode="READ"]
        Type number : storageIOLA2  [oid=".1.3.6.1.4.1.6574.101.1.1.8.2", mode="READ"]
        Type number : storageIOLA21  [oid=".1.3.6.1.4.1.6574.101.1.1.9.2", mode="READ"]
        Type number : storageIOLA25  [oid=".1.3.6.1.4.1.6574.101.1.1.10.2", mode="READ"]
        Type number : storageIOLA215  [oid=".1.3.6.1.4.1.6574.101.1.1.11.2", mode="READ"]
        Type number : storageIONReadX2  [oid=".1.3.6.1.4.1.6574.101.1.1.12.2", mode="READ"]
        Type number : storageIONWrittenX2  [oid=".1.3.6.1.4.1.6574.101.1.1.13.2", mode="READ"]
        Type string : spaceIODevice [oid=".1.3.6.1.4.1.6574.102.1.1.2.1", mode="READ"]
        Type number : spaceIOReads  [oid=".1.3.6.1.4.1.6574.102.1.1.5.1", mode="READ"]
        Type number : spaceIOWrites  [oid=".1.3.6.1.4.1.6574.102.1.1.6.1", mode="READ"]
        Type number : spaceIOLA  [oid=".1.3.6.1.4.1.6574.102.1.1.8.1", mode="READ"]
        Type number : spaceIOLA1  [oid=".1.3.6.1.4.1.6574.102.1.1.9.1", mode="READ"]
        Type number : spaceIOLA5  [oid=".1.3.6.1.4.1.6574.102.1.1.10.1", mode="READ"]
        Type number : spaceIOLA15  [oid=".1.3.6.1.4.1.6574.102.1.1.11.1", mode="READ"]
        Type number : spaceIONReadX  [oid=".1.3.6.1.4.1.6574.102.1.1.12.1", mode="READ"]
        Type number : spaceIONWrittenX  [oid=".1.3.6.1.4.1.6574.102.1.1.13.1", mode="READ"]
        Type string : cpu  [oid=".1.3.6.1.2.1.25.3.2.1.3.196608", mode="READ"]
        Type number : ssCpuUser  [oid=".1.3.6.1.4.1.2021.11.9.0", mode="READ"]
        Type number : ssCpuSystem  [oid=".1.3.6.1.4.1.2021.11.10.0", mode="READ"]
        Type number : ssCpuIdle  [oid=".1.3.6.1.4.1.2021.11.11.0", mode="READ"]
        Type number : load1min  [oid=".1.3.6.1.4.1.2021.10.1.5.1", mode="READ"]
        Type number : load5min  [oid=".1.3.6.1.4.1.2021.10.1.5.2", mode="READ"]
        Type number : load15min  [oid=".1.3.6.1.4.1.2021.10.1.5.3", mode="READ"]
        Type number : memTotalSwap  [oid=".1.3.6.1.4.1.2021.4.3.0", mode="READ" ]
        Type number : memAvailSwap  [oid=".1.3.6.1.4.1.2021.4.4.0", mode="READ"]
        Type number : memTotalReal  [oid=".1.3.6.1.4.1.2021.4.5.0", mode="READ"]
        Type number : memAvailReal  [oid=".1.3.6.1.4.1.2021.4.6.0", mode="READ"]
        Type number : memTotalFree  [oid=".1.3.6.1.4.1.2021.4.11.0", mode="READ"]
        Type number : memShared  [oid=".1.3.6.1.4.1.2021.4.13.0", mode="READ"]
        Type number : memBuffer  [oid=".1.3.6.1.4.1.2021.4.14.0", mode="READ"]
        Type number : memCached  [oid=".1.3.6.1.4.1.2021.4.15.0", mode="READ"]        
}

synology.items


Group gSynology             "Synology"                  <nas>

    Group:Number      gSynologySystem                   "Synology System [MAP(synosystemcommon.map):%s]"    <nas>
        String Synology_System_ModelName                "Model Name [%s]"                                   <none>                              { channel="snmp:target:nas:modelName" } // Model name of this NAS 
        String Synology_System_SerialNumber             "Serial Number [%s]"                                <none>                              { channel="snmp:target:nas:serialNumber" } // Model serial number 
        String Synology_System_Version                  "Version [%s]"                                      <none>                              { channel="snmp:target:nas:version" } // The version of DSM 
        Number Synology_System_Temperature              "Temperature [%s °C]"                               <temperature>                       { channel="snmp:target:nas:systemTemperature" } // Temperature of this NAS
        Number Synology_System_SystemStatus             "System Status [MAP(synosystemcommon.map):%s]"      <sysstatus>     (gSynologySystem)   { channel="snmp:target:nas:systemStatus" } // Normal(1) Failed(2) System partition status 
        Number Synology_System_PowerStatus              "Power Status [MAP(synosystemcommon.map):%s]"       <energy>        (gSynologySystem)   { channel="snmp:target:nas:powerStatus" } // Normal(1) Failed(2) Returns error if power supplies fail 
        Number Synology_System_SystemFanStatus          "System Fan Status [MAP(synosystemcommon.map):%s]"  <sysfan>        (gSynologySystem)   { channel="snmp:target:nas:systemFanStatus" } // Normal(1) Failed(2) Returns error if system fan fails 
        Number Synology_System_CpuFanStatus             "CPU Fan Status [MAP(synosystemcommon.map):%s]"     <cpufan>        (gSynologySystem)   { channel="snmp:target:nas:cpuFanStatus" } // Normal(1) Failed(2) Returns error if CPU fan fails 
        Number Synology_System_UpgradeAvailable         "Upgrade Available [MAP(synosystemupgrade.map):%s]" <update>                            { channel="snmp:target:nas:upgradeAvailable" } // Available(1) Unavailable(2) Connecting(3) Disconnected(4)Others(5) Checks whether a new version or update of DSM is available  

    Group:Number      gSynologyDisk                     "Synology Disk [MAP(synodiskstatus.map):%s]"        <nas>
        String Synology_Disk_DiskID1                    "Disk ID [%s]"                                      <hdd1>                              { channel="snmp:target:nas:diskID1" }   //Disk name in DSM
        String Synology_Disk_DiskID2                    "Disk ID [%s]"                                      <hdd1>                              { channel="snmp:target:nas:diskID2" }   //Disk name in DSM
        String Synology_Disk_DiskModel1                 "Disk Model [%s]"                                   <hdd2>                              { channel="snmp:target:nas:diskModel1" }   //Disk model 
        String Synology_Disk_DiskModel2                 "Disk Model [%s]"                                   <hdd2>                              { channel="snmp:target:nas:diskModel2" }   //Disk model 
        String Synology_Disk_DiskType1                  "Disk Type [%s]"                                    <sata>                              { channel="snmp:target:nas:diskType1" }   //Disk    type, e.g. SATA, SSD
        String Synology_Disk_DiskType2                  "Disk Type [%s]"                                    <sata>                              { channel="snmp:target:nas:diskType2" }   //Disk    type, e.g. SATA, SSD 
        Number Synology_Disk_Status1                    "Disk Status [MAP(synodiskstatus.map):%s]"          <hddstatus>     (gSynologyDisk)     { channel="snmp:target:nas:diskStatus1" }   //Current disk status 
        Number Synology_Disk_Status2                    "Disk Status [MAP(synodiskstatus.map):%s]"          <hddstatus>     (gSynologyDisk)     { channel="snmp:target:nas:diskStatus2" }   //Current disk status 
        Number Synology_Disk_Temperature1               "Disk Temperature [%s °C]"                          <temperature>                       { channel="snmp:target:nas:diskTemperature1" } //Disk temperature
        Number Synology_Disk_Temperature2               "Disk Temperature [%s °C]"                          <temperature>                       { channel="snmp:target:nas:diskTemperature2" }  //Disk temperature

    Group:Number    gSynologyRAID                       "Synology RAID [MAP(synoraidstatus.map):%s]"        <nas>
        String Synology_RAID_RaidName                   "RAID Name"                                         <none>                              { channel="snmp:target:nas:raidName" }   //The name of each RAID in DSM 
        Number Synology_RAID_RaidStatus                 "RAID Status [MAP(synoraidstatus.map):%s]"                          (gSynologyRAID)     { channel="snmp:target:nas:raidStatus" }   //It shows the RAID status right now Services
        Number Synology_RAID_RaidFreeSize               "RAID Free Size [JS(byte.js):%s]"                                                       { channel="snmp:target:nas:raidFreeSize"  }   //The free size of volume / disk group
        Number Synology_RAID_RaidTotalSize              "RAID Total Size [JS(byte.js):%s]"                                                      { channel="snmp:target:nas:raidTotalSize" }   //The total size of volume / disk group
        Number Synology_RAID_RaidUsedSize               "RAID Used Size [JS(byte.js):%s]"   
        Number Synology_RAID_RaidUsedPercent            "RAID Used Percent [%s %%]"  

    Group:String     gSynologySMART                     "Synology SMART [%s]"                               <nas>
        String Synology_SMART_Raw_Read_Error_Rate1      "Raw Read Error Rate"                               <test>      (gSynologySMART)        { channel="snmp:target:nas:rawReadErrorRate1" } 
        String Synology_SMART_Spin_Up_Time1             "Spin Up Time"                                      <test>      (gSynologySMART)        { channel="snmp:target:nas:spinUpTime1" }
        String Synology_SMART_Start_Stop_Count1         "Start Stop Count"                                  <test>      (gSynologySMART)        { channel="snmp:target:nas:startStopCount1" }
        String Synology_SMART_Reallocated_Sector_Ct1    "Reallocated Sector Ct"                             <test>      (gSynologySMART)        { channel="snmp:target:nas:reallocatedSectorCt1" }
        String Synology_SMART_Seek_Error_Rate1          "Seek Error Rate"                                   <test>      (gSynologySMART)        { channel="snmp:target:nas:seekErrorRate1" }
        String Synology_SMART_Power_On_Hours1           "Power On Hours"                                    <test>      (gSynologySMART)        { channel="snmp:target:nas:powerOnHours1" }
        String Synology_SMART_Spin_Retry_Count1         "Spin Retry Count"                                  <test>      (gSynologySMART)        { channel="snmp:target:nas:spinRetryCount1" }
        String Synology_SMART_Calibration_Retry_Count1  "Calibration Retry Count"                           <test>      (gSynologySMART)        { channel="snmp:target:nas:calibrationRetryCount1" }
        String Synology_SMART_Power_Cycle_Count1        "Power Cycle Count"                                 <test>      (gSynologySMART)        { channel="snmp:target:nas:powerCycleCount1" }
        String Synology_SMART_Power_Off_Retract_Count1  "Power-Off Retract Count"                           <test>      (gSynologySMART)        { channel="snmp:target:nas:powerOffRetractCount1" }
        String Synology_SMART_Load_Cycle_Count1         "Load Cycle Count"                                  <test>      (gSynologySMART)        { channel="snmp:target:nas:loadCycleCount1" }
        String Synology_SMART_Temperature_Celsius1      "Temperature Celsius"                               <test>      (gSynologySMART)        { channel="snmp:target:nas:temperatureCelsius1" }
        String Synology_SMART_Reallocated_Event_Ct1     "Reallocated Event Ct"                              <test>      (gSynologySMART)        { channel="snmp:target:nas:reallocatedEventCount1" }
        String Synology_SMART_Current_Pending_Sector1   "Current Pending Sector"                            <test>      (gSynologySMART)        { channel="snmp:target:nas:currentPendingSector1" }
        String Synology_SMART_Offline_Uncorrectable1    "Offline Uncorrectable"                             <test>      (gSynologySMART)        { channel="snmp:target:nas:offlineUncorrectable1" }
        String Synology_SMART_UDMA_CRC_Error_Count1     "UDMA CRC Error Count"                              <test>      (gSynologySMART)        { channel="snmp:target:nas:uDMACRCErrorCount1" }
        String Synology_SMART_Multi_Zone_Error_Rate1    "Multizone Error Rate"                              <test>      (gSynologySMART)        { channel="snmp:target:nas:multiZoneErrorRate1" }

        String Synology_SMART_Raw_Read_Error_Rate2      "Raw Read Error Rate"                               <test>      (gSynologySMART)        { channel="snmp:target:nas:rawReadErrorRate2" } 
        String Synology_SMART_Spin_Up_Time2             "Spin Up Time"                                      <test>      (gSynologySMART)        { channel="snmp:target:nas:spinUpTime2" }
        String Synology_SMART_Start_Stop_Count2         "Start Stop Count"                                  <test>      (gSynologySMART)        { channel="snmp:target:nas:startStopCount2" }
        String Synology_SMART_Reallocated_Sector_Ct2    "Reallocated Sector Ct"                             <test>      (gSynologySMART)        { channel="snmp:target:nas:reallocatedSectorCt2" }
        String Synology_SMART_Seek_Error_Rate2          "Seek Error Rate"                                   <test>      (gSynologySMART)        { channel="snmp:target:nas:seekErrorRate2" }
        String Synology_SMART_Power_On_Hours2           "Power On Hours"                                    <test>      (gSynologySMART)        { channel="snmp:target:nas:powerOnHours2" }
        String Synology_SMART_Spin_Retry_Count2         "Spin Retry Count"                                  <test>      (gSynologySMART)        { channel="snmp:target:nas:spinRetryCount2" }
        String Synology_SMART_Calibration_Retry_Count2  "Calibration Retry Count"                           <test>      (gSynologySMART)        { channel="snmp:target:nas:calibrationRetryCount2" }
        String Synology_SMART_Power_Cycle_Count2        "Power Cycle Count"                                 <test>      (gSynologySMART)        { channel="snmp:target:nas:powerCycleCount2" }
        String Synology_SMART_Power_Off_Retract_Count2  "Power-Off Retract Count"                           <test>      (gSynologySMART)        { channel="snmp:target:nas:powerOffRetractCount2" }
        String Synology_SMART_Load_Cycle_Count2         "Load Cycle Count"                                  <test>      (gSynologySMART)        { channel="snmp:target:nas:loadCycleCount2" }
        String Synology_SMART_Temperature_Celsius2      "Temperature Celsius"                               <test>      (gSynologySMART)        { channel="snmp:target:nas:temperatureCelsius2" }
        String Synology_SMART_Reallocated_Event_Ct2     "Reallocated Event Ct"                              <test>      (gSynologySMART)        { channel="snmp:target:nas:reallocatedEventCount2" }
        String Synology_SMART_Current_Pending_Sector2   "Current Pending Sector"                            <test>      (gSynologySMART)        { channel="snmp:target:nas:currentPendingSector2" }
        String Synology_SMART_Offline_Uncorrectable2    "Offline Uncorrectable"                             <test>      (gSynologySMART)        { channel="snmp:target:nas:offlineUncorrectable2" }
        String Synology_SMART_UDMA_CRC_Error_Count2     "UDMA CRC Error Count"                              <test>      (gSynologySMART)        { channel="snmp:target:nas:uDMACRCErrorCount2" }
        String Synology_SMART_Multi_Zone_Error_Rate2    "Multizone Error Rate"                              <test>      (gSynologySMART)        { channel="snmp:target:nas:multiZoneErrorRate2" }
   
    Group:Number:SUM      gSynologyServices             "Synology Services [%d]"                            <nas>
        String Synology_Services_ServiceName1           "Service Name [%s]"                                 <sysservice>                        { channel="snmp:target:nas:serviceName1" }   //The name of the service
        Number Synology_Services_ServiceUsers1          "Service Users [%s]"                                            (gSynologyServices)     { channel="snmp:target:nas:serviceUsers1" }   //The number of users using this service
        String Synology_Services_ServiceName2           "Service Name [%s]"                                 <sysservice>                        { channel="snmp:target:nas:serviceName2" }   //The name of the service
        Number Synology_Services_ServiceUsers2          "Service Users [%s]"                                            (gSynologyServices)     { channel="snmp:target:nas:serviceUsers2" }   //The number of users using this service
        String Synology_Services_ServiceName3           "Service Name [%s]"                                 <sysservice>                        { channel="snmp:target:nas:serviceName3" }   //The name of the service
        Number Synology_Services_ServiceUsers3          "Service Users [%s]"                                            (gSynologyServices)     { channel="snmp:target:nas:serviceUsers3" }   //The number of users using this service
        String Synology_Services_ServiceName4           "Service Name [%s]"                                 <sysservice>                        { channel="snmp:target:nas:serviceName4" }   //The name of the service
        Number Synology_Services_ServiceUsers4          "Service Users [%s]"                                            (gSynologyServices)     { channel="snmp:target:nas:serviceUsers4" }   //The number of users using this service
        String Synology_Services_ServiceName5           "Service Name [%s]"                                 <sysservice>                        { channel="snmp:target:nas:serviceName5" }   //The name of the service
        Number Synology_Services_ServiceUsers5          "Service Users [%s]"                                            (gSynologyServices)     { channel="snmp:target:nas:serviceUsers5" }   //The number of users using this service
        String Synology_Services_ServiceName6           "Service Name [%s]"                                 <sysservice>                        { channel="snmp:target:nas:serviceName6" }   //The name of the service
        Number Synology_Services_ServiceUsers6          "Service Users [%s]"                                            (gSynologyServices)     { channel="snmp:target:nas:serviceUsers6" }   //The number of users using this service
        String Synology_Services_ServiceName7           "Service Name [%s]"                                 <sysservice>                        { channel="snmp:target:nas:serviceName7" }   //The name of the service
        Number Synology_Services_ServiceUsers7          "Service Users [%s]"                                            (gSynologyServices)     { channel="snmp:target:nas:serviceUsers7" }   //The number of users using this service
        String Synology_Services_ServiceName8           "Service Name [%s]"                                 <sysservice>                        { channel="snmp:target:nas:serviceName8" }   //The name of the service
        Number Synology_Services_ServiceUsers8          "Service Users [%s]"                                            (gSynologyServices)     { channel="snmp:target:nas:serviceUsers8" }   //The number of users using this service
        String Synology_Services_ServiceName9           "Service Name [%s]"                                 <sysservice>                        { channel="snmp:target:nas:serviceName9" }   //The name of the service
        Number Synology_Services_ServiceUsers9          "Service Users [%s]"                                            (gSynologyServices)     { channel="snmp:target:nas:serviceUsers9" }   //The number of users using this service
    
    // I/O information of disks.
    Group      gSynologyStorageio                       "Synology Storage IO"                               <nas>
        String Synology_Storageio_StorageIODevice1      "Device Name [%s]"                                  <none>                              { channel="snmp:target:nas:storageIODevice1" }   //The name of the device we are counting/checking 
        Number Synology_Storageio_StorageIOReads1       "I/O Read Access [# %s]"                                                                { channel="snmp:target:nas:storageIOReads1" }   //The number of read accesses from this device since boot 
        Number Synology_Storageio_StorageIOWrites1      "I/O Write Access [# %s]"                                                               { channel="snmp:target:nas:storageIOWrites1" }   //The number of write accesses to this device since boot
        Number Synology_Storageio_StorageIOLA1          "Load [%s %%]"                                                                          { channel="snmp:target:nas:storageIOLA1" }   //The load of disk (%)
        Number Synology_Storageio_StorageIOLA11         "Load (1 min) [%s %%]"                                                                  { channel="snmp:target:nas:storageIOLA11" }   //The 1-minute average load of disk (%)
        Number Synology_Storageio_StorageIOLA51         "Load (5 min) [%s %%]"                                                                  { channel="snmp:target:nas:storageIOLA15" }   //The 5-minute average load of disk (%)
        Number Synology_Storageio_StorageIOLA151        "Load (15 min) [%s %%]"                                                                 { channel="snmp:target:nas:storageIOLA115" }   //The-   15 minute average load of disk (%) 
        Number Synology_Storageio_StorageIONReadX1      "I/O Read [JS(byte.js):%s]"                                                             { channel="snmp:target:nas:storageIONReadX1" }   //The number of bytes read from this device since boot (64 bit VER.)
        Number Synology_Storageio_StorageIONWrittenX1   "I/O Write [JS(byte.js):%s]"                                                            { channel="snmp:target:nas:storageIONWrittenX1" }   //The number of bytes written to this device since boot (64 bit VER.)
        String Synology_Storageio_StorageIODevice2      "Device Name [%s]"                                  <none>                              { channel="snmp:target:nas:storageIODevice2" }   //The name of the device we are counting/checking 
        Number Synology_Storageio_StorageIOReads2       "I/O Read Access [# %s]"                                                                { channel="snmp:target:nas:storageIOReads2" }   //The number of read accesses from this device since boot 
        Number Synology_Storageio_StorageIOWrites2      "I/O Write Access [# %s]"                                                               { channel="snmp:target:nas:storageIOWrites2" }   //The number of write accesses to this device since boot
        Number Synology_Storageio_StorageIOLA2          "Load [%s %%]"                                                                          { channel="snmp:target:nas:storageIOLA2" }   //The load of disk (%)
        Number Synology_Storageio_StorageIOLA12         "Load (1 min) [%s %%]"                                                                  { channel="snmp:target:nas:storageIOLA21" }   //The 1-minute average load of disk (%)
        Number Synology_Storageio_StorageIOLA52         "Load (5 min) [%s %%]"                                                                  { channel="snmp:target:nas:storageIOLA25" }   //The 5-minute average load of disk (%)
        Number Synology_Storageio_StorageIOLA152        "Load (15 min) [%s %%]"                                                                 { channel="snmp:target:nas:storageIOLA215" }   //The-   15 minute average load of disk (%) 
        Number Synology_Storageio_StorageIONReadX2      "I/O Read [JS(byte.js):%s]"                                                             { channel="snmp:target:nas:storageIONReadX2" }   //The number of bytes read from this device since boot (64 bit VER.)
        Number Synology_Storageio_StorageIONWrittenX2   "I/O Write [JS(byte.js):%s]"                                                            { channel="snmp:target:nas:storageIONWrittenX2" }   //The number of bytes written to this device since boot (64 bit VER.)
    
    // I/O information of volumes
    Group      gSynologySpaceio                         "Synology Space IO"                                 <nas>
        String Synology_Spaceio_SpaceIODevice           "Device Name [%s]"                                  <none>                              { channel="snmp:target:nas:spaceIODevice" }   //The name of the device this volume mounted on
        Number Synology_Spaceio_SpaceIOReads            "I/O Read Access [# %s]"                                                                { channel="snmp:target:nas:spaceIOReads" }   //The number of read accesses from this volume since boot
        Number Synology_Spaceio_SpaceIOWrites           "I/O Write Access [# %s]"                                                               { channel="snmp:target:nas:spaceIOWrites" }   //The number of write accesses to this volume since boot 
        Number Synology_Spaceio_SpaceIOLA               "Load [%s %%]"                                                                          { channel="snmp:target:nas:spaceIOLA" }   //The load of disk in the volume (%)
        Number Synology_Spaceio_SpaceIOLA1              "Load (1 min) [%s %%]"                                                                  { channel="snmp:target:nas:spaceIOLA1" }   //The 1 minute average load of disk in the volume (%) 
        Number Synology_Spaceio_SpaceIOLA5              "Load (5 min) [%s %%]"                                                                  { channel="snmp:target:nas:spaceIOLA5" }   //The 5 minute average load of disk in the volume (%) 
        Number Synology_Spaceio_SpaceIOLA15             "Load (15 min) [%s %%]"                                                                 { channel="snmp:target:nas:spaceIOLA15" }   //The 15 minute average load of disk in the volume (%)
        Number Synology_Spaceio_SpaceIONReadX           "I/O Read [JS(byte.js):%s]"                                                             { channel="snmp:target:nas:spaceIONReadX" }   //The number of bytes read from this volume since boot (64 bit VER.)
        Number Synology_Spaceio_SpaceIONWrittenX        "I/O Write [JS(byte.js):%s]"                                                            { channel="snmp:target:nas:spaceIONWrittenX" }   //The number of bytes written to this volume since boot (64 bit VER.)

    Group      gSynologyCPU                             "Synology CPU"                                      <nas>
        String Synology_CPU_Cpu                         "CPU [%s]"                                          <cpu>                               { channel="snmp:target:nas:cpu" }
        Number Synology_CPU_CpuUser                     "CPU User usage time [%s %%]"                       <timeuse1>                           { channel="snmp:target:nas:ssCpuUser" }   //The percentage of CPU time spent processing user-level code
        Number Synology_CPU_CpuSystem                   "CPU System usage time [%s %%]"                     <timeuse1>                           { channel="snmp:target:nas:ssCpuSystem" }   //The percentage of CPU time spent processing system-level code, calculated over the last minute 
        Number Synology_CPU_LaLoad                      "CPU Load [%s %%]"                                  <cpuload>
        Number Synology_CPU_CpuIdle                     "CPU Idle time [%s %%]"                             <timeuse>                                    { channel="snmp:target:nas:ssCpuIdle" }   //The percentage of processor time spent idle, calculated over the last minute 
        Number Synology_CPU_LaLoadInt1                  "Load (1 min) [%s %%]"                              <cpuload>                           { channel="snmp:target:nas:load1min" }   // 1 minute Load 
        Number Synology_CPU_LaLoadInt5                  "Load (5 min) [%s %%]"                              <cpuload>                           { channel="snmp:target:nas:load5min" }   // 5 minute Load
        Number Synology_CPU_LaLoadInt15                 "Load (15 min) [%s %%]"                             <cpuload>                           { channel="snmp:target:nas:load15min" }   // 15 minute Load

    Group      gSynologyMemory                          "Synology Memory"                                   <nas>
        Number Synology_CPU_MemTotalSwap                "Total Swap [JS(kbyte.js):%s]"                                                          { channel="snmp:target:nas:memTotalSwap" }   //The total amount of swap space configured for this host 
        Number Synology_CPU_MemAvailSwap                "Available Swap [JS(kbyte.js):%s]"                                                      { channel="snmp:target:nas:memAvailSwap" }   //The amount of swap space currently unused or available
        Number Synology_CPU_MemTotalReal                "Total Real [JS(kbyte.js):%s]"                                                          { channel="snmp:target:nas:memTotalReal" }   //The total amount of real/physical memory installed on this host 
        Number Synology_CPU_MemRealFree                 "Real Free [JS(kbyte.js):%s]"     
        Number Synology_CPU_MemRealUsed                 "Real Used [JS(kbyte.js):%s]"     
        Number Synology_CPU_MemRealUsedPercent          "Real Used Percent [%d %%]"     
        Number Synology_CPU_MemAvailReal                "Available Real [JS(kbyte.js):%s]"                                                      { channel="snmp:target:nas:memAvailReal" }   //The amount of real/physical memory currently unused or available 
        Number Synology_CPU_MemTotalFree                "Total Free [JS(kbyte.js):%s]"                                                          { channel="snmp:target:nas:memTotalFree" }   //The total amount of memory free or available for use on this host 
        Number Synology_CPU_MemShared                   "Shared [JS(kbyte.js):%s]"                                                              { channel="snmp:target:nas:memShared" }   //The total amount of real or virtual memory currently allocated for use as shared memory 
        Number Synology_CPU_MemBuffer                   "Buffer [JS(kbyte.js):%s]"                                                              { channel="snmp:target:nas:memBuffer" }   //The total amount of real or virtual memory currently allocated for use as memory buffers 
        Number Synology_CPU_MemCached                   "Cached [JS(kbyte.js):%s]"                                                              { channel="snmp:target:nas:memCached" }   //The total amount of real or virtual memory currently allocated for use as cached memor

config.map

Synology_RAID_RaidUsedPercent=80
Synology_CPU_MemRealUsedPercent=80
Synology_System_Temperature=45
Synology_Disk_Temperature1=35
Synology_Disk_Temperature2=35
Synology_System_SystemStatus=1
Synology_System_PowerStatus=1
Synology_System_SystemFanStatus=1
Synology_System_CpuFanStatus=1
Synology_Disk_Status1=1
Synology_Disk_Status2=1
Synology_RAID_RaidStatus=1
Synology_System_UpgradeAvailable=2
=UNDEF
6 Likes

synodiskstatus.map

// Synology HDD status

1=Normal
2=Initialized
3=NotInitialized
4=SystemPartitionFailed
5=Crashed

synoraidstatus.map

// Synology RAID status

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
14=RaidDeploying
15=RaidUnDeploying
16=RaidMountCache
17=RaidUnmountCache
18=RaidExpandingUnfinishedSHR
19=RaidConvertSHRToPool
20=RaidMigrateSHR1ToSHR2
21=RaidUnknownStatus

synosystemcommon.map


// Common Synology system status

1=Normal
2=Failed

synosystemupgrade.map

// Synology system upgrade status

1=Available
2=Unavailable
3=Connecting
4=Disconnected
5=Others

byte.js

(function(i) {
    if ( i=='NULL' || i=='UNDEF' )
    {
        return i;
    }
    else
    {
        j = parseInt(i);

        if ( j < 1024 )
        {
            return j + " B";
        }
        else if ( j < (1024 * 1024) )
        {
            return (j / 1024.0).toFixed(1) + " kB";
        }
        else if ( j < (1024 * 1024 * 1024) )
        {
            return (j / 1048576.0).toFixed(1) + " MB";
        }
        else if ( j < (1024 * 1024 * 1024 * 1024) )
        {
            return (j / 1073741824.0).toFixed(3) + " GB";
        }
        else
        {
            return (j / 1099511627776.0).toFixed(3) + " TB";
        }
    }
})(input)

kbyte.js

(function(i) {
    if ( i=='NULL' || i=='UNDEF' )
    {
        return i;
    }    
    else
    {
        j = parseInt(i) * 1024;
        
        if ( j < (1024 * 1024 * 1024) )
        {
            return (j / 1048576.0).toFixed(1) + " MB";
        }
        else if ( j < (1024 * 1024 * 1024 * 1024) )
        {
            return (j / 1073741824.0).toFixed(2) + " GB";
        }
        else
        {
            return (j / 1099511627776.0).toFixed(2) + " TB";
        }
    }
})(input)

synology.rules

 
import java.util.List

val List<String> NotifyLocked = newArrayList()

rule "Synology bigger"
when
    Item Synology_RAID_RaidUsedPercent changed or    
    Item Synology_CPU_MemRealUsedPercent changed or
    Item Synology_System_Temperature changed or
    Item Synology_Disk_Temperature1 changed or
    Item Synology_Disk_Temperature2 changed
then
    if ( triggeringItem.state == UNDEF )
    {
        var msg = triggeringItem.name + " changed to UNDEF"
        sendTelegram("YOUR_BOT", "Message, " + msg)
    }
    else if ( triggeringItem.state != NULL )
    {
        val Integer value = Integer::parseInt(triggeringItem.state.toString)
        val Integer limit = Integer::parseInt(transform("MAP", "config.map", triggeringItem.name))
        if ( (NotifyLocked.contains(triggeringItem.name) == false) &&
           (value > limit))
        {
            NotifyLocked.add(triggeringItem.name)
            var msg = triggeringItem.name + " changed to " + value
            sendTelegram("YOUR_BOT", "Message, " + msg)
        }
        else if ( value <= (limit-5) )
        {
            NotifyLocked.remove(triggeringItem.name)
        }
    }
end

rule "Synology unequal"
    when
        Item Synology_System_SystemStatus changed or
        Item Synology_System_PowerStatus changed or
        Item Synology_System_SystemFanStatus changed or
        Item Synology_System_CpuFanStatus changed or
        Item Synology_Disk_Status1 changed or
        Item Synology_Disk_Status2 changed or
        Item Synology_RAID_RaidStatus changed or
        Item Synology_System_UpgradeAvailable changed
    then
       
        if ( triggeringItem.state == UNDEF )
        {
            var msg = triggeringItem.name + " changed to UNDEF"
            sendTelegram("YOUR_BOT", "Message, " + msg)
        }
        else if ( triggeringItem.state != NULL )
        {
            val Integer value = Integer::parseInt(triggeringItem.state.toString)
            val Integer limit = Integer::parseInt(transform("MAP", "config.map", triggeringItem.name))
            if ( (NotifyLocked.contains(triggeringItem.name) == false) &&
                 (value != limit)
               )
            {
                NotifyLocked.add(triggeringItem.name)
                var msg = triggeringItem.name + " changed to " + value
                sendTelegram("YOUR_BOT", "Message, " + msg)                   
            }
            else if ( value == limit )
            {
                NotifyLocked.remove(triggeringItem.name)
            }
        }
end

rule "Synology_RAID_RaidFreeSizeGB or Synology_RAID_RaidTotalSize changed"
when
    Item Synology_RAID_RaidFreeSize changed or
    Item Synology_RAID_RaidTotalSize changed
then
    if ( (Synology_RAID_RaidFreeSize.state != NULL)  && (Synology_RAID_RaidFreeSize.state != UNDEF) &&
         (Synology_RAID_RaidTotalSize.state != NULL) && (Synology_RAID_RaidTotalSize.state != UNDEF))
    {
        val Long TotalSize = Long::parseLong(Synology_RAID_RaidTotalSize.state.toString)
        val Long UsedSize = TotalSize - Long::parseLong(Synology_RAID_RaidFreeSize.state.toString)
        Synology_RAID_RaidUsedSize.postUpdate(UsedSize)
        Synology_RAID_RaidUsedPercent.postUpdate( (UsedSize*100) / TotalSize )
    }
end

rule "Synology_CPU_CpuIdle changed"
when
    Item Synology_CPU_CpuIdle changed
then
    if ( (Synology_CPU_CpuIdle.state == NULL) || (Synology_CPU_CpuIdle.state == UNDEF) )
    {
       Synology_CPU_LaLoad.postUpdate(Synology_CPU_CpuIdle.state)
    }
    else
    {
       Synology_CPU_LaLoad.postUpdate(100 - Integer::parseInt(Synology_CPU_CpuIdle.state.toString))
    }
end

rule "Synology_CPU_MemAvailReal, Synology_CPU_MemBuffer, Synology_CPU_MemCached changed"
    when
        Item Synology_CPU_MemAvailReal changed or
        Item Synology_CPU_MemBuffer changed or
        Item Synology_CPU_MemCached changed or
        Item Synology_CPU_MemTotalReal changed
    then
        if ( (Synology_CPU_MemAvailReal.state != NULL) && (Synology_CPU_MemAvailReal.state != UNDEF) &&
             (Synology_CPU_MemBuffer.state != NULL) && (Synology_CPU_MemBuffer.state != UNDEF) &&
             (Synology_CPU_MemCached.state != NULL) && (Synology_CPU_MemCached.state != UNDEF) &&
             (Synology_CPU_MemTotalReal.state != NULL) && (Synology_CPU_MemTotalReal.state != UNDEF)
           )
        {
            val Long memTotalReal = Long::parseLong(Synology_CPU_MemTotalReal.state.toString)
            val Long realFree = Long::parseLong(Synology_CPU_MemAvailReal.state.toString) + Long::parseLong(Synology_CPU_MemBuffer.state.toString) + Long::parseLong(Synology_CPU_MemCached.state.toString)
            val Long realUsed = Long::parseLong(Synology_CPU_MemTotalReal.state.toString) - realFree
            Synology_CPU_MemRealFree.postUpdate( realFree )
            Synology_CPU_MemRealUsed.postUpdate( realUsed )
            Synology_CPU_MemRealUsedPercent.postUpdate( (realUsed*100) / memTotalReal )
        }
end 

synology.sitemap

Frame label="Synology NAS Info" {

        Group item=gSynology label="NAS System Info" {            
            Group item=gSynologySystem valuecolor=[=="1"="green", =="2"="red"] {
                Frame {
                    Default item=Synology_System_ModelName          
                    Default item=Synology_System_SerialNumber    
                    Default item=Synology_System_Version
                }
                Frame {
                    Default item=Synology_System_Temperature
                    Default item=Synology_System_SystemStatus valuecolor=[=="1"="green", =="2"="red"]  //mappings=[1="Normal", 2="Failed"]
                    Default item=Synology_System_PowerStatus valuecolor=[=="1"="green", =="2"="red"]     //mappings=[1="Normal", 2="Failed"]
                    Default item=Synology_System_SystemFanStatus valuecolor=[=="1"="green", =="2"="red"]  //mappings=[1="Normal", 2="Failed"]
                    Default item=Synology_System_CpuFanStatus  valuecolor=[=="1"="green", =="2"="red"]   //mappings=[1="Normal", 2="Failed"] 
                }
                Frame {
                    Default item=Synology_System_UpgradeAvailable valuecolor=[=="1"="green", =="2"="white", =="3"="blue", =="4"="yellow", =="5"="orange"]//mappings=[1="Available", 2="Unavailable", 3="Connecting", 4="Disconnected", 5="Others"]
                }
            }
            Group item=gSynologyDisk valuecolor=[=="1"="green", =="2"="yellow", =="3"="blue", =="4"="orange", =="5"="red"]{
                    
                Frame label="Disk 1" {
                    Default item=Synology_Disk_DiskID1
                    Default item=Synology_Disk_DiskModel1
                    Default item=Synology_Disk_DiskType1
                    Default item=Synology_Disk_Temperature1
                    Default item=Synology_Disk_Status1 valuecolor=[=="1"="green", =="2"="yellow", =="3"="blue", =="4"="orange", =="5"="red"]//mappings=[1="Normal", 2="Initialized", 3="NotInitialized", 4="SystemPartitionFailed", 5="Crashed"]
                }

                Frame label="Disk 2" {
                    Default item=Synology_Disk_DiskID2
                    Default item=Synology_Disk_DiskModel2
                    Default item=Synology_Disk_DiskType2
                    Default item=Synology_Disk_Temperature2
                    Default item=Synology_Disk_Status2 valuecolor=[=="1"="green", =="2"="yellow", =="3"="blue", =="4"="orange", =="5"="red"]//mappings=[1="Normal", 2="Initialized", 3="NotInitialized", 4="SystemPartitionFailed", 5="Crashed"]
                }                 
            }
            Group item=gSynologyRAID valuecolor=[=="1"="green", =="2"="yellow", =="3"="blue", =="4"="orange", =="5"="white", =="6"="gold", =="7"="gold", =="12"="red"] {
                Default item=Synology_RAID_RaidName
                Default item=Synology_RAID_RaidStatus valuecolor=[=="1"="green", =="2"="yellow", =="3"="blue", =="4"="orange", =="5"="white", =="6"="gold", =="7"="gold", =="12"="red"]//mappings=[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", 14="RaidDeploying", 15="RaidUnDeploying ", 16="RaidMountCache", 17="RaidUnmountCache", 18="RaidExpandingUnfinishedSHR", 19="RaidConvertSHRToPool", 20="RaidMigrateSHR1ToSHR2", 21="RaidUnknownStatus"]
                Default item=Synology_RAID_RaidFreeSize
                Default item=Synology_RAID_RaidTotalSize
                Default item=Synology_RAID_RaidUsedSize
                Default item=Synology_RAID_RaidUsedPercent
            }
            Group item=gSynologySMART valuecolor=[!="OK"="red", =="OK"="green"] {
                Frame label="Disk 1" {
                    Default item=Synology_SMART_Raw_Read_Error_Rate1 valuecolor=[!="OK"="red", =="OK"="green"]                    
                    Default item=Synology_SMART_Spin_Up_Time1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Start_Stop_Count1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Reallocated_Sector_Ct1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Seek_Error_Rate1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Power_On_Hours1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Spin_Retry_Count1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Calibration_Retry_Count1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Power_Cycle_Count1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Power_Off_Retract_Count1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Load_Cycle_Count1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Temperature_Celsius1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Reallocated_Event_Ct1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Current_Pending_Sector1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Offline_Uncorrectable1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_UDMA_CRC_Error_Count1 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Multi_Zone_Error_Rate1 valuecolor=[!="OK"="red", =="OK"="green"]
                }
                Frame label="Disk 2" {
                    Default item=Synology_SMART_Raw_Read_Error_Rate2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Spin_Up_Time2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Start_Stop_Count2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Reallocated_Sector_Ct2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Seek_Error_Rate2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Power_On_Hours2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Spin_Retry_Count2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Calibration_Retry_Count2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Power_Cycle_Count2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Power_Off_Retract_Count2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Load_Cycle_Count2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Temperature_Celsius2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Reallocated_Event_Ct2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Current_Pending_Sector2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Offline_Uncorrectable2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_UDMA_CRC_Error_Count2 valuecolor=[!="OK"="red", =="OK"="green"]
                    Default item=Synology_SMART_Multi_Zone_Error_Rate2 valuecolor=[!="OK"="red", =="OK"="green"]
                }
            } 
            Group item=gSynologyServices {
                Frame {
                    Default item=Synology_Services_ServiceName1 
                    Default item=Synology_Services_ServiceUsers1
                }
                Frame {
                    Default item=Synology_Services_ServiceName2
                    Default item=Synology_Services_ServiceUsers2
                }
                Frame {
                    Default item=Synology_Services_ServiceName3
                    Default item=Synology_Services_ServiceUsers3
                }
                Frame {
                    Default item=Synology_Services_ServiceName4
                    Default item=Synology_Services_ServiceUsers4
                }  
                Frame {
                    Default item=Synology_Services_ServiceName5
                    Default item=Synology_Services_ServiceUsers5
                }  
                Frame {
                    Default item=Synology_Services_ServiceName6
                    Default item=Synology_Services_ServiceUsers6
                } 
                Frame {
                    Default item=Synology_Services_ServiceName7
                    Default item=Synology_Services_ServiceUsers7
                }  
                Frame {
                    Default item=Synology_Services_ServiceName8
                    Default item=Synology_Services_ServiceUsers8
                }
                Frame {
                    Default item=Synology_Services_ServiceName9
                    Default item=Synology_Services_ServiceUsers9
                }
            }
            Group item=gSynologyStorageio {
                Frame label="Storage 1" {
                    Default item=Synology_Storageio_StorageIODevice1
                    Default item=Synology_Storageio_StorageIOReads1
                    Default item=Synology_Storageio_StorageIOWrites1
                    Default item=Synology_Storageio_StorageIOLA1
                    Default item=Synology_Storageio_StorageIOLA11
                    Default item=Synology_Storageio_StorageIOLA51
                    Default item=Synology_Storageio_StorageIOLA151
                    Default item=Synology_Storageio_StorageIONReadX1
                    Default item=Synology_Storageio_StorageIONWrittenX1
                }
                Frame label="Storage 2" {
                    Default item=Synology_Storageio_StorageIODevice2                
                    Default item=Synology_Storageio_StorageIOReads2                
                    Default item=Synology_Storageio_StorageIOWrites2                
                    Default item=Synology_Storageio_StorageIOLA2                
                    Default item=Synology_Storageio_StorageIOLA12                
                    Default item=Synology_Storageio_StorageIOLA52                
                    Default item=Synology_Storageio_StorageIOLA152                
                    Default item=Synology_Storageio_StorageIONReadX2                
                    Default item=Synology_Storageio_StorageIONWrittenX2
                }               
            }
            Group item=gSynologySpaceio {
                Frame {
                    Default item=Synology_Spaceio_SpaceIODevice
                }
                Frame {
                    Default item=Synology_Spaceio_SpaceIOReads
                    Default item=Synology_Spaceio_SpaceIOWrites
                    Default item=Synology_Spaceio_SpaceIONReadX
                    Default item=Synology_Spaceio_SpaceIONWrittenX
                }
                Frame {
                    Default item=Synology_Spaceio_SpaceIOLA
                    Default item=Synology_Spaceio_SpaceIOLA1
                    Default item=Synology_Spaceio_SpaceIOLA5
                    Default item=Synology_Spaceio_SpaceIOLA15
                }                
            }
            Group item=gSynologyCPU {
                Frame {
                    Default item=Synology_CPU_Cpu
                }
                Frame {
                    Default item=Synology_CPU_CpuUser
                    Default item=Synology_CPU_CpuSystem
                }
                Frame {
                    Default item=Synology_CPU_CpuIdle
                    Default item=Synology_CPU_LaLoad                    
                    Default item=Synology_CPU_LaLoadInt1
                    Default item=Synology_CPU_LaLoadInt5
                    Default item=Synology_CPU_LaLoadInt15
                }               
            }
            Group item=gSynologyMemory {
                Frame label="Total available real and swap memory" {
                    Default item=Synology_CPU_MemTotalFree                    
                }
                Frame label="Physical memory" {
                    Default item=Synology_CPU_MemRealFree
                    Default item=Synology_CPU_MemTotalReal
                    Default item=Synology_CPU_MemAvailReal
                    Default item=Synology_CPU_MemRealUsed
                    Default item=Synology_CPU_MemRealUsedPercent  
                }
                Frame label="Swap memory" {
                    Default item=Synology_CPU_MemTotalSwap                
                    Default item=Synology_CPU_MemAvailSwap
                }               
                Frame {
                    Default item=Synology_CPU_MemCached
                    Default item=Synology_CPU_MemShared
                    Default item=Synology_CPU_MemBuffer
                }                
            }          
       }
    }

I’m not used all Synology OIDs, only what I need. So, if you want to add something else you are welcome. This is a link to Synology MIB Guide.

Cheers! :wink:

7 Likes

Wauw :grinning:

Thanks for the credits :crazy_face:
Unfortunatly I migrated mine almost the same time in parallel :nerd_face:

In addition to the post above, I came to the following different solution:

In order to reduce the load of the system I made 3 different SNMP things with different cycle times. Thereby I grouped the Channels according to their update frequency:

Thing snmp:target:snmpNAS10 [ retries="2", hostname="w.x.y.z", protocol="v2c", port="161", refresh="10", community="public", timeout="1500" ] {
    Channels:
...
}

Thing snmp:target:snmpNAS60 [ retries="2", hostname="w.x.y.z", protocol="v2c", port="161", refresh="60", community="public", timeout="1500" ] {
    Channels:
...
}

Thing snmp:target:snmpNAS1800 [ retries="2", hostname="w.x.y.z", protocol="v2c", port="161", refresh="1800", community="public", timeout="1500" ] {
    Channels:
...
}

The SMART attributes I modeled as switch as follows:

Type switch : Synology_SMART_Raw_Read_Error_Rate1        [ oid=".1.3.6.1.4.1.6574.5.1.1.9.1", mode="READ", datatype="STRING", onvalue="OK", doNotLogException="true", exceptionValue="OFF" ]

Reporting of Synology_System_upgradeAvailable I also needed to change, because it was also reporting Connecting(3), Disconnected(4) & Others(5)

rule "Synology smaller"
when
    Item Synology_System_upgradeAvailable changed
then
    if ( triggeringItem.state == UNDEF )
    {
        Admin_Notify.sendCommand(triggeringItem.name + " changed to UNDEF")
    }
    else if ( triggeringItem.state != NULL )
    {
        val Integer value = Float::parseFloat(triggeringItem.state.toString).intValue
        val Integer limit = Integer::parseInt(transform("MAP", "config.map", triggeringItem.name))                  
        if ( (NotifyLocked.contains(triggeringItem.name) == false) &&
             (value < limit)
           )
        {
            NotifyLocked.add(triggeringItem.name)
            Admin_Notify.sendCommand(triggeringItem.name + ": " + value)
        }
        else if ( value >= limit )
        {
            NotifyLocked.remove(triggeringItem.name)
        }
    }
end

Thanks Form Your Great implementation, This is exactly what i am loooking for. Before i Start Working on that, one quick question.
When i try to install the snmp Binding i find only one

SNMP Binding
binding-snmp1 - 1.13.0

Is this the right one?

Hello. This binding is an old one… You must use the new version binding-snmp. If you cannot see it on your list maybe it is a time for upgrading your openhabian version? :slight_smile: For the old binding, you can use the tutorial of @MikeTheTux.

Thanks, after some trouble while updating I managed to update to OH2.5 now and got the correct binding now:

SNMP Binding
binding-snmp - 2.5.3

Now digging into the SNMP implementation :slight_smile:

Regards

I implemented all the .items, .things, .map etc. IT works pretty fine for me. Thanks for sharing that!

Nevertheless I have 2 issues which i was not able to fix so far:

  1. some of the transformations seem not to work, so for example Synology_System_SystemStatus shows me “1” instead of “Normal”.

  2. The calculation for Synology_RAID_RaidUsedSize seems not to work, it gives me no value back.

Any ideas? Thanks for any hints.

  1. Maybe you forget to add an appropriate mapping file for transformations. In my case, I used synosystemcommon.map with the values of 1 for Normal and 2 for Failed.
  2. It works, but it takes some time to calculate the value if there is no change in the RAID volume. Try to add some files to your NAS and take a look if the value changed.
    Hope it helps :slight_smile:
1 Like

Hi all, Just a quick question - I/m getting a number of telegrams to upgrade but once logged into my NAS there is nothing to upgrade. Any advice.

[30.09.20 23:44]
Message, Synology_System_UpgradeAvailable changed to 3

[30.09.20 23:47]
Message, Synology_System_UpgradeAvailable changed to 3

[01.10.20 15:06]
Message, Synology_System_UpgradeAvailable changed to 3

I do have the same behaviour with my DS214play and disabled the message. I am ok with that.

Hello. Sorry for the late reply. Here is my implementation of this rule. It only sends a message when an update is available

  rule "Synology upgrade available"
  when
    Item Synology_System_UpgradeAvailable changed
  then
    if ( triggeringItem.state != NULL )
    {
        val Integer value = Integer::parseInt(triggeringItem.state.toString)
        if (value == 1)  telegramAction.sendTelegram("Synology System upgrade available")
    }    
 end

Hi MikeTheTux,
thanks for your work on the SNMP / Synology solution.
I assume that this version will also work with openHAB 3.1. - right?!
Is there a repo with the complete solution, especially your Thing definitions
(“3 SNMP things with different cycle times… grouped the Channels according to their update frequency”)?

Thanks in advance!
Joachim