Synology DiskStation monitoring via SNMP

I wanted to share my Synology DiskStation monitoring via SNMP.

Prerequisites

  • Enable SNMPv2c in DiskStation
  • Install OpenHAB SNMP1 Binding
  • Install JavaScript and Map transformation service

snmp.cfg

    # Listening Port (optional, defaults to '162')
    # Dummy Port > 1024. Not used as DiskStation does not trigger traps
    port=3126
    # The SNMP community to listen to (optional, defaults to 'public')
    community=public
    # The SNMP retry timeout (in milliseconds). Defaults to 1500.
    # Sets the number of milliseconds between retries.
    timeout=1500
    # The SNMP number of retries. Defaults to 0.
    # Sets the number of retries before aborting the request.
    retries=0

Synology.items

    Group gSynology             "Synology" <nas>

    Group gSynologySystem "Synology System" <nas>
        Number Synology_System_systemStatus     "systemStatus"       { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.1.1.0:60000]" } // Normal(1) Failed(2) System partition status 
        Number Synology_System_temperature      "temperature [%s °C]"    (gPersist5M)    { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.1.2.0:60000]" } // Temperature of this NAS 
        Number Synology_System_powerStatus      "powerStatus"        { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.1.3.0:60000]" } // Normal(1) Failed(2) Returns error if power supplies fail 
        Number Synology_System_systemFanStatus  "systemFanStatus"    { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.1.4.1.0:60000]" } // Normal(1) Failed(2) Returns error if system fan fails 
        Number Synology_System_cpuFanStatus     "cpuFanStatus"       { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.1.4.2.0:60000]" } // Normal(1) Failed(2) Returns error if CPU fan fails 
        String Synology_System_modelName        "modelName [%s]"          { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.1.5.1.0:1800000]" } // Model name of this NAS 
        String Synology_System_serialNumber     "serialNumber [%s]"       { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.1.5.2.0:1800000]" } // Model serial number 
        String Synology_System_version          "version [%s]"            { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.1.5.3.0:1800000]" } // The version of DSM 
        Number Synology_System_upgradeAvailable "upgradeAvailable"   { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.1.5.4.0:60000]" } // Available(1) Unavailable(2) Connecting(3) Disconnected(4)Others(5) Checks whether a new version or update of DSM is available 

    Group gSynologyDisk "Synology Disk" <nas>
        String Synology_Disk_diskID1  "diskID1 [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.2.1.1.2.0:1800000]" }   //Disk name in DSM
        String Synology_Disk_diskID2  "diskID2 [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.2.1.1.2.1:1800000]" }   //Disk name in DSM
        String Synology_Disk_diskModel1  "diskModel1 [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.2.1.1.3.0:1800000]" }   //Disk model 
        String Synology_Disk_diskModel2  "diskModel2 [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.2.1.1.3.1:1800000]" }   //Disk model 
        String Synology_Disk_diskType1  "diskType1 [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.2.1.1.4.0:1800000]" }   //Disk    type, e.g. SATA, SSD
        String Synology_Disk_diskType2  "diskType2 [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.2.1.1.4.1:1800000]" }   //Disk    type, e.g. SATA, SSD 
        Number Synology_Disk_Status1  "Status1"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.2.1.1.5.0:60000]" }   //Current disk status 
        Number Synology_Disk_Status2  "Status2"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.2.1.1.5.1:60000]" }   //Current disk status 
        Number Synology_Disk_Temperature1  "Temperature1 [%s °C]"        (gPersist5M)     { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.2.1.1.6.0:60000]" } //Disk temperature
        Number Synology_Disk_Temperature2  "Temperature2 [%s °C]"        (gPersist5M)     { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.2.1.1.6.1:60000]" }  //Disk temperature

    Group gSynologyRAID "Synology RAID" <nas>
        String Synology_RAID_raidName   "raidName [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.3.1.1.2.0:1800000]" }   //The name of each RAID in DSM 
        Number Synology_RAID_raidStatus   "raidStatus"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.3.1.1.3.0:60000]" }   //It shows the RAID status right now Services
        Number Synology_RAID_raidFreeSize   "raidFreeSize [JS(byte.js):%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.3.1.1.4.0:60000]" }   //The free size of volume / disk group 
        Number Synology_RAID_raidTotalSize   "raidTotalSize [JS(byte.js):%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.3.1.1.5.0:60000]" }   //The total size of volume / disk group
        Number Synology_RAID_raidUsedSize   "raidUsedSize [JS(byte.js):%s]"   
        Number Synology_RAID_raidUsedPercent   "raidUsedPercent [%s %%]"   (gPersist5M)

    Group gSynologySMART "Synology SMART" <nas>
        Switch Synology_SMART_Raw_Read_Error_Rate1 "Raw_Read_Error_Rate" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.1:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Spin_Up_Time1 "Spin_Up_Time" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.2:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Start_Stop_Count1 "Start_Stop_Count" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.3:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Reallocated_Sector_Ct1 "Reallocated_Sector_Ct" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.4:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Seek_Error_Rate1 "Seek_Error_Rate" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.5:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Power_On_Hours1 "Power_On_Hours" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.6:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Spin_Retry_Count1 "Spin_Retry_Count" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.7:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Power_Cycle_Count1 "Power_Cycle_Count" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.8:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_End_to_End_Error1 "End-to-End_Error" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.9:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Reported_Uncorrect1 "Reported_Uncorrect" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.10:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Command_Timeout1 "Command_Timeout" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.11:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_High_Fly_Writes1 "High_Fly_Writes" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.12:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Airflow_Temperature_Cel1 "Airflow_Temperature_Cel" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.13:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_G_Sense_Error_Rate1 "G-Sense_Error_Rate" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.14:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Power_Off_Retract_Count1 "Power-Off_Retract_Count" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.15:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Load_Cycle_Count1 "Load_Cycle_Count" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.16:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Temperature_Celsius1 "Temperature_Celsius" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.17:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Hardware_ECC_Recovered1 "Hardware_ECC_Recovered" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.18:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Current_Pending_Sector1 "Current_Pending_Sector" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.19:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Offline_Uncorrectable1 "Offline_Uncorrectable" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.20:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_UDMA_CRC_Error_Count1 "UDMA_CRC_Error_Count" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.21:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Multi_Zone_Error_Rate1 "Multi_Zone_Error_Rate" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.22:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Head_Flying_Hours1 "Head_Flying_Hours" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.23:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Total_LBAs_Written1 "Total_LBAs_Written" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.24:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Total_LBAs_Read1 "Total_LBAs_Read" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.25:1800000:MAP(ok.map)]" }

        Switch Synology_SMART_Raw_Read_Error_Rate2 "Raw_Read_Error_Rate" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.26:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Spin_Up_Time2 "Spin_Up_Time" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.27:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Start_Stop_Count2 "Start_Stop_Count" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.28:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Reallocated_Sector_Ct2 "Reallocated_Sector_Ct" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.29:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Seek_Error_Rate2 "Seek_Error_Rate" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.30:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Power_On_Hours2 "Power_On_Hours" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.31:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Spin_Retry_Count2 "Spin_Retry_Count" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.32:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Power_Cycle_Count2 "Power_Cycle_Count" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.33:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_End_to_End_Error2 "End-to-End_Error" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.34:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Reported_Uncorrect2 "Reported_Uncorrect" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.35:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Command_Timeout2 "Command_Timeout" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.36:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_High_Fly_Writes2 "High_Fly_Writes" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.37:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Airflow_Temperature_Cel2 "Airflow_Temperature_Cel" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.38:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_G_Sense_Error_Rate2 "G-Sense_Error_Rate" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.39:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Power_Off_Retract_Count2 "Power-Off_Retract_Count" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.40:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Load_Cycle_Count2 "Load_Cycle_Count" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.41:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Temperature_Celsius2 "Temperature_Celsius" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.42:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Hardware_ECC_Recovered2 "Hardware_ECC_Recovered" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.43:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Current_Pending_Sector2 "Current_Pending_Sector" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.44:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Offline_Uncorrectable2 "Offline_Uncorrectable" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.45:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_UDMA_CRC_Error_Count2 "UDMA_CRC_Error_Count" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.46:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Multi_Zone_Error_Rate2 "Multi_Zone_Error_Rate" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.47:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Head_Flying_Hours2 "Head_Flying_Hours" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.48:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Total_LBAs_Written2 "Total_LBAs_Written" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.49:1800000:MAP(ok.map)]" }
        Switch Synology_SMART_Total_LBAs_Read2 "Total_LBAs_Read" <alarm>           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.5.1.1.9.50:1800000:MAP(ok.map)]" }

    Group gSynologyServices "Synology Services" <nas>
        String Synology_Services_serviceName1   "serviceName [%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.2.1:1800000]" }   //The name of the service
        Number Synology_Services_serviceUsers1   "serviceUsers [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.3.1:60000]" }   //The number of users using this service
        String Synology_Services_serviceName2   "serviceName [%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.2.2:1800000]" }   //The name of the service
        Number Synology_Services_serviceUsers2   "serviceUsers [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.3.2:60000]" }   //The number of users using this service
        String Synology_Services_serviceName3   "serviceName [%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.2.3:1800000]" }   //The name of the service
        Number Synology_Services_serviceUsers3   "serviceUsers [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.3.3:60000]" }   //The number of users using this service
        String Synology_Services_serviceName4   "serviceName [%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.2.4:1800000]" }   //The name of the service
        Number Synology_Services_serviceUsers4   "serviceUsers [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.3.4:60000]" }   //The number of users using this service
        String Synology_Services_serviceName5   "serviceName [%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.2.5:1800000]" }   //The name of the service
        Number Synology_Services_serviceUsers5   "serviceUsers [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.3.5:60000]" }   //The number of users using this service
        String Synology_Services_serviceName6   "serviceName [%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.2.6:1800000]" }   //The name of the service
        Number Synology_Services_serviceUsers6   "serviceUsers [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.3.6:60000]" }   //The number of users using this service
        String Synology_Services_serviceName7   "serviceName [%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.2.7:1800000]" }   //The name of the service
        Number Synology_Services_serviceUsers7   "serviceUsers [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.3.7:60000]" }   //The number of users using this service
        String Synology_Services_serviceName8   "serviceName [%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.2.8:1800000]" }   //The name of the service
        Number Synology_Services_serviceUsers8   "serviceUsers [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.3.8:60000]" }   //The number of users using this service
        String Synology_Services_serviceName9   "serviceName [%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.2.9:1800000]" }   //The name of the service
        Number Synology_Services_serviceUsers9   "serviceUsers [%s]"             { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.6.1.1.3.9:60000]" }   //The number of users using this service

    Group gSynologyStorageio "Synology Storageio" <nas>
        String Synology_Storageio_storageIODevice1   "storageIODevice [%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.2.1:1800000]" }   //The name of the device we are counting/checking 
        Number Synology_Storageio_storageIOReads1   "storageIOReads [%s #]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.5.1:60000]" }   //The number of read accesses from this device since boot 
        Number Synology_Storageio_storageIOWrites1  "storageIOWrites [%s #]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.6.1:60000]" }   //The number of write accesses to this device since boot
        Number Synology_Storageio_storageIOLA1   "storageIOLA [%s %%]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.8.1:10000]" }   //The load of disk (%)
        Number Synology_Storageio_storageIOLA11   "storageIOLA1 [%s %%]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.9.1:60000]" }   //The 1-minute average load of disk (%)
        Number Synology_Storageio_storageIOLA51   "storageIOLA5 [%s %%]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.10.1:60000]" }   //The 5-minute average load of disk (%)
        Number Synology_Storageio_storageIOLA151    "storageIOLA15 [%s %%]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.11.1:60000]" }   //The-   15 minute average load of disk (%) 
        Number Synology_Storageio_storageIONReadX1   "storageIONReadX [JS(byte.js):%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.12.1:60000]" }   //The number of bytes read from this device since boot (64 bit VER.)
        Number Synology_Storageio_storageIONWrittenX1   "storageIONWrittenX [JS(byte.js):%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.13.1:60000]" }   //The number of bytes written to this device since boot (64 bit VER.)

        String Synology_Storageio_storageIODevice2   "storageIODevice [%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.2.2:1800000]" }   //The name of the device we are counting/checking 
        Number Synology_Storageio_storageIOReads2   "storageIOReads [%s #]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.5.2:60000]" }   //The number of read accesses from this device since boot 
        Number Synology_Storageio_storageIOWrites2  "storageIOWrites [%s #]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.6.2:60000]" }   //The number of write accesses to this device since boot
        Number Synology_Storageio_storageIOLA2   "storageIOLA [%s %%]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.8.2:10000]" }   //The load of disk (%)
        Number Synology_Storageio_storageIOLA12   "storageIOLA1 [%s %%]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.9.2:60000]" }   //The 1-minute average load of disk (%)
        Number Synology_Storageio_storageIOLA52   "storageIOLA5 [%s %%]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.10.2:60000]" }   //The 5-minute average load of disk (%)
        Number Synology_Storageio_storageIOLA152    "storageIOLA15 [%s %%]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.11.2:60000]" }   //The-   15 minute average load of disk (%) 
        Number Synology_Storageio_storageIONReadX2   "storageIONReadX [JS(byte.js):%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.12.2:60000]" }   //The number of bytes read from this device since boot (64 bit VER.)
        Number Synology_Storageio_storageIONWrittenX2   "storageIONWrittenX [JS(byte.js):%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.101.1.1.13.2:60000]" }   //The number of bytes written to this device since boot (64 bit VER.)

    Group gSynologySpaceio "Synology Spaceio" <nas>
        String Synology_Spaceio_spaceIODevice   "spaceIODevice [%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.102.1.1.2.1:1800000]" }   //The name of the device this volume mounted on
        Number Synology_Spaceio_spaceIOReads   "spaceIOReads [%s #]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.102.1.1.5.1:60000]" }   //The number of read accesses from this volume since boot
        Number Synology_Spaceio_spaceIOWrites   "spaceIOWrites [%s #]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.102.1.1.6.1:60000]" }   //The number of write accesses to this volume since boot 
        Number Synology_Spaceio_spaceIOLA   "spaceIOLA [%s %%]"        (gPersist5M)       { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.102.1.1.8.1:10000]" }   //The load of disk in the volume (%)
        Number Synology_Spaceio_spaceIOLA1   "spaceIOLA1 [%s %%]"      (gPersist5M)         { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.102.1.1.9.1:60000]" }   //The 1 minute average load of disk in the volume (%) 
        Number Synology_Spaceio_spaceIOLA5   "spaceIOLA5 [%s %%]"      (gPersist5M)         { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.102.1.1.10.1:60000]" }   //The 5 minute average load of disk in the volume (%) 
        Number Synology_Spaceio_spaceIOLA15   "spaceIOLA15 [%s %%]"    (gPersist5M)           { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.102.1.1.11.1:60000]" }   //The 15 minute average load of disk in the volume (%)
        Number Synology_Spaceio_spaceIONReadX   "spaceIONReadX [JS(byte.js):%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.102.1.1.12.1:60000]" }   //The number of bytes read from this volume since boot (64 bit VER.)
        Number Synology_Spaceio_spaceIONWrittenX   "spaceIONReadX [JS(byte.js):%s]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.6574.102.1.1.13.1:60000]" }   //The number of bytes written to this volume since boot (64 bit VER.)

    Group gSynologyCPU "Synology CPU" <nas>
        String Synology_CPU_Cpu          "CPU [%s]"                       { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.2.1.25.3.2.1.3.196608:1800000]" }
        Number Synology_CPU_ssCpuUser   "ssCpuUser [%s %%]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.2021.11.9.0:60000]" }   //The percentage of CPU time spent processing user-level code
        Number Synology_CPU_ssCpuSystem   "ssCpuSystem [%s %%]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.2021.11.10.0:60000]" }   //The percentage of CPU time spent processing system-level code, calculated over the last minute 
        Number Synology_CPU_laLoad      "laLoad [%s %%]"     (gPersist5M)
        Number Synology_CPU_ssCpuIdle   "ssCpuIdle [%s %%]"               { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.2021.11.11.0:10000]" }   //The percentage of processor time spent idle, calculated over the last minute 
        Number Synology_CPU_laLoadInt1   "laLoadInt1 [%s %%]"     (gPersist5M)          { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.2021.10.1.5.1:60000]" }   // 1 minute Load 
        Number Synology_CPU_laLoadInt5   "laLoadInt5 [%s %%]"     (gPersist5M)          { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.2021.10.1.5.2:60000]" }   // 5 minute Load
        Number Synology_CPU_laLoadInt15   "laLoadInt15 [%s %%]"   (gPersist5M)            { snmp="<[192.168.69.68:v2c:public:.1.3.6.1.4.1.2021.10.1.5.3:60000]" }   // 15 minute Load

    Group gSynologyMemory "Synology Memory" <nas>
        Number Synology_CPU_memTotalSwap   "memTotalSwap [JS(byte.js):%s]"               { snmp="<[192.168.69.68:public:.1.3.6.1.4.1.2021.4.3.0:1800000:JS(kbyte.js)]" }   //The total amount of swap space configured for this host 
        Number Synology_CPU_memAvailSwap   "memAvailSwap [JS(byte.js):%s]"               { snmp="<[192.168.69.68:public:.1.3.6.1.4.1.2021.4.4.0:60000:JS(kbyte.js)]" }   //The amount of swap space currently unused or available
        Number Synology_CPU_memTotalReal   "memTotalReal [JS(byte.js):%s]"               { snmp="<[192.168.69.68:public:.1.3.6.1.4.1.2021.4.5.0:1800000:JS(kbyte.js)]" }   //The total amount of real/physical memory installed on this host 
        Number Synology_CPU_memRealFree    "memRealFree [JS(byte.js):%s]"     
        Number Synology_CPU_memRealUsed    "memRealUsed [JS(byte.js):%s]"     
        Number Synology_CPU_memRealUsedPercent    "memRealUsedPercent [%d %%]"     (gPersist5M)
        Number Synology_CPU_memAvailReal   "memAvailReal [JS(byte.js):%s]"               { snmp="<[192.168.69.68:public:.1.3.6.1.4.1.2021.4.6.0:60000:JS(kbyte.js)]" }   //The amount of real/physical memory currently unused or available 
        Number Synology_CPU_memTotalFree   "memTotalFree [JS(byte.js):%s]"               { snmp="<[192.168.69.68:public:.1.3.6.1.4.1.2021.4.11.0:60000:JS(kbyte.js)]" }   //The total amount of memory free or available for use on this host 
        Number Synology_CPU_memShared   "memShared [JS(byte.js):%s]"               { snmp="<[192.168.69.68:public:.1.3.6.1.4.1.2021.4.13.0:60000:JS(kbyte.js)]" }   //The total amount of real or virtual memory currently allocated for use as shared memory 
        Number Synology_CPU_memBuffer   "memBuffer [JS(byte.js):%s]"               { snmp="<[192.168.69.68:public:.1.3.6.1.4.1.2021.4.14.0:60000:JS(kbyte.js)]" }   //The total amount of real or virtual memory currently allocated for use as memory buffers 
        Number Synology_CPU_memCached   "memCached [JS(byte.js):%s]"               { snmp="<[192.168.69.68:public:.1.3.6.1.4.1.2021.4.15.0:60000:JS(kbyte.js)]" }   //The total amount of real or virtual memory currently allocated for use as cached memory

Sitemap

      Group item=gSynology {
          Group item=gSynologySystem {
            Selection item=Synology_System_systemStatus   mappings=[1="Normal", 2="Failed"]
            Default item=Synology_System_temperature
            Selection item=Synology_System_powerStatus      mappings=[1="Normal", 2="Failed"]
            Selection item=Synology_System_systemFanStatus  mappings=[1="Normal", 2="Failed"]
            Selection item=Synology_System_cpuFanStatus     mappings=[1="Normal", 2="Failed"]
            Default item=Synology_System_modelName          
            Default item=Synology_System_serialNumber    
            Default item=Synology_System_version        
            Selection item=Synology_System_upgradeAvailable mappings=[1="Available", 2="Unavailable", 3="Connecting", 4="Disconnected", 5="Others"]
          }
          Group item=gSynologyDisk {
            Default item=Synology_Disk_diskID1
            Default item=Synology_Disk_diskID2
            Default item=Synology_Disk_diskModel1
            Default item=Synology_Disk_diskModel2
            Default item=Synology_Disk_diskType1
            Default item=Synology_Disk_diskType2
            Selection item=Synology_Disk_Status1 mappings=[1="Normal", 2="Initialized", 3="NotInitialized", 4="SystemPartitionFailed", 5="Crashed"]
            Selection item=Synology_Disk_Status2 mappings=[1="Normal", 2="Initialized", 3="NotInitialized", 4="SystemPartitionFailed", 5="Crashed"]
            Default item=Synology_Disk_Temperature1
            Default item=Synology_Disk_Temperature2
          }
          Group item=gSynologyRAID {
            Default item=Synology_RAID_raidName
            Selection item=Synology_RAID_raidStatus 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 {
            Default item=Synology_SMART_Raw_Read_Error_Rate1
            Default item=Synology_SMART_Raw_Read_Error_Rate2
            Default item=Synology_SMART_Spin_Up_Time1
            Default item=Synology_SMART_Spin_Up_Time2
            Default item=Synology_SMART_Start_Stop_Count1
            Default item=Synology_SMART_Start_Stop_Count2
            Default item=Synology_SMART_Reallocated_Sector_Ct1
            Default item=Synology_SMART_Reallocated_Sector_Ct2
            Default item=Synology_SMART_Seek_Error_Rate1
            Default item=Synology_SMART_Seek_Error_Rate2
            Default item=Synology_SMART_Power_On_Hours1
            Default item=Synology_SMART_Power_On_Hours2
            Default item=Synology_SMART_Spin_Retry_Count1
            Default item=Synology_SMART_Spin_Retry_Count2
            Default item=Synology_SMART_Power_Cycle_Count1
            Default item=Synology_SMART_Power_Cycle_Count2
            Default item=Synology_SMART_End_to_End_Error1
            Default item=Synology_SMART_End_to_End_Error2
            Default item=Synology_SMART_Reported_Uncorrect1
            Default item=Synology_SMART_Reported_Uncorrect2
            Default item=Synology_SMART_Command_Timeout1
            Default item=Synology_SMART_Command_Timeout2
            Default item=Synology_SMART_High_Fly_Writes1 
            Default item=Synology_SMART_High_Fly_Writes2
            Default item=Synology_SMART_Airflow_Temperature_Cel1
            Default item=Synology_SMART_Airflow_Temperature_Cel2
            Default item=Synology_SMART_G_Sense_Error_Rate1 
            Default item=Synology_SMART_G_Sense_Error_Rate2
            Default item=Synology_SMART_Power_Off_Retract_Count1
            Default item=Synology_SMART_Power_Off_Retract_Count2
            Default item=Synology_SMART_Load_Cycle_Count1 
            Default item=Synology_SMART_Load_Cycle_Count2
            Default item=Synology_SMART_Temperature_Celsius1
            Default item=Synology_SMART_Temperature_Celsius2
            Default item=Synology_SMART_Hardware_ECC_Recovered1 
            Default item=Synology_SMART_Hardware_ECC_Recovered2
            Default item=Synology_SMART_Current_Pending_Sector1 
            Default item=Synology_SMART_Current_Pending_Sector2
            Default item=Synology_SMART_Offline_Uncorrectable1 
            Default item=Synology_SMART_Offline_Uncorrectable2
            Default item=Synology_SMART_UDMA_CRC_Error_Count1 
            Default item=Synology_SMART_UDMA_CRC_Error_Count2
            Default item=Synology_SMART_Multi_Zone_Error_Rate1 
            Default item=Synology_SMART_Multi_Zone_Error_Rate2
            Default item=Synology_SMART_Head_Flying_Hours1 
            Default item=Synology_SMART_Head_Flying_Hours2
            Default item=Synology_SMART_Total_LBAs_Written1 
            Default item=Synology_SMART_Total_LBAs_Written2
            Default item=Synology_SMART_Total_LBAs_Read1
            Default item=Synology_SMART_Total_LBAs_Read2
          }

          Group item=gSynologyServices {
            Default item=Synology_Services_serviceName1
            Default item=Synology_Services_serviceUsers1
            Default item=Synology_Services_serviceName2
            Default item=Synology_Services_serviceUsers2
            Default item=Synology_Services_serviceName3
            Default item=Synology_Services_serviceUsers3
            Default item=Synology_Services_serviceName4
            Default item=Synology_Services_serviceUsers4
            Default item=Synology_Services_serviceName5
            Default item=Synology_Services_serviceUsers5
            Default item=Synology_Services_serviceName6
            Default item=Synology_Services_serviceUsers6
            Default item=Synology_Services_serviceName7
            Default item=Synology_Services_serviceUsers7
            Default item=Synology_Services_serviceName8
            Default item=Synology_Services_serviceUsers8
            Default item=Synology_Services_serviceName9
            Default item=Synology_Services_serviceUsers9
          }

          Group item=gSynologyStorageio {
            Default item=Synology_Storageio_storageIODevice1
            Default item=Synology_Storageio_storageIODevice2
            Default item=Synology_Storageio_storageIOReads1
            Default item=Synology_Storageio_storageIOReads2
            Default item=Synology_Storageio_storageIOWrites1
            Default item=Synology_Storageio_storageIOWrites2
            Default item=Synology_Storageio_storageIOLA1
            Default item=Synology_Storageio_storageIOLA2
            Default item=Synology_Storageio_storageIOLA11
            Default item=Synology_Storageio_storageIOLA12
            Default item=Synology_Storageio_storageIOLA51
            Default item=Synology_Storageio_storageIOLA52
            Default item=Synology_Storageio_storageIOLA151
            Default item=Synology_Storageio_storageIOLA152
            Default item=Synology_Storageio_storageIONReadX1
            Default item=Synology_Storageio_storageIONReadX2
            Default item=Synology_Storageio_storageIONWrittenX1
            Default item=Synology_Storageio_storageIONWrittenX2
          }

          Group item=gSynologyServices {
            Default item=Synology_Services_serviceName1
            Default item=Synology_Services_serviceUsers1
            Default item=Synology_Services_serviceName2
            Default item=Synology_Services_serviceUsers2
            Default item=Synology_Services_serviceName3
            Default item=Synology_Services_serviceUsers3
            Default item=Synology_Services_serviceName4
            Default item=Synology_Services_serviceUsers4
            Default item=Synology_Services_serviceName5
            Default item=Synology_Services_serviceUsers5
            Default item=Synology_Services_serviceName6
            Default item=Synology_Services_serviceUsers6
            Default item=Synology_Services_serviceName7
            Default item=Synology_Services_serviceUsers7
            Default item=Synology_Services_serviceName8
            Default item=Synology_Services_serviceUsers8
            Default item=Synology_Services_serviceName9
            Default item=Synology_Services_serviceUsers9
          }

          Group item=gSynologySpaceio {
            Default item=Synology_Spaceio_spaceIODevice
            Default item=Synology_Spaceio_spaceIOReads
            Default item=Synology_Spaceio_spaceIOWrites
            Default item=Synology_Spaceio_spaceIOLA
            Default item=Synology_Spaceio_spaceIOLA1
            Default item=Synology_Spaceio_spaceIOLA5
            Default item=Synology_Spaceio_spaceIOLA15
            Default item=Synology_Spaceio_spaceIONReadX
            Default item=Synology_Spaceio_spaceIONWrittenX
          }

          Group item=gSynologyCPU {
            Default item=Synology_CPU_Cpu
            Default item=Synology_CPU_ssCpuUser
            Default item=Synology_CPU_ssCpuSystem
            Default item=Synology_CPU_laLoad
            Default item=Synology_CPU_ssCpuIdle
            Default item=Synology_CPU_laLoadInt1
            Default item=Synology_CPU_laLoadInt5
            Default item=Synology_CPU_laLoadInt15
          }

          Group item=gSynologyMemory {
            Default item=Synology_CPU_memTotalReal
            Default item=Synology_CPU_memTotalSwap
            Default item=Synology_CPU_memAvailReal
            Default item=Synology_CPU_memAvailSwap
            Default item=Synology_CPU_memRealUsedPercent       
            Default item=Synology_CPU_memTotalFree
            Default item=Synology_CPU_memRealUsed
            Default item=Synology_CPU_memCached
            Default item=Synology_CPU_memRealFree
            Default item=Synology_CPU_memShared
            Default item=Synology_CPU_memBuffer
          }
          
          Group item=gSynologyNetwork {
            Default item=Synology_Network_ifName
            Default item=Synology_Network_ifHCInOctets
            Default item=Synology_Network_ifHCOutOctets        
          } 
      }

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_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 )
        {
            Admin_Notify.sendCommand(triggeringItem.name + " changed to UNDEF")
        }
        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)
                Admin_Notify.sendCommand(triggeringItem.name + ": " + value)
            }
            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 )
        {
            Admin_Notify.sendCommand(triggeringItem.name + " changed to UNDEF")
        }
        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)
                Admin_Notify.sendCommand(triggeringItem.name + ": " + value)
            }
            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_ssCpuIdle changed"
    when
        Item Synology_CPU_ssCpuIdle changed
    then
        if ( (Synology_CPU_ssCpuIdle.state == NULL) || (Synology_CPU_ssCpuIdle.state == UNDEF) )
        {
            Synology_CPU_laLoad.postUpdate(Synology_CPU_ssCpuIdle.state)
        }
        else
        {
            Synology_CPU_laLoad.postUpdate(100 - Integer::parseInt(Synology_CPU_ssCpuIdle.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

config.map

    Synology_RAID_raidUsedPercent=80
    Synology_CPU_memRealUsedPercent=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

ok.map

OK=OFF
=ON

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
        {
            return parseInt(i) * 1024;
        }
    })(input)

Screenshot

I hope that helps to safe some typing effort.

19 Likes

a bit thank you! it saved me huge amount of time! Really appreciated!

Hi,

Thanks for all this, much hard work has been saved…thanks!

One question, I’m getting an error in the logs and my numbers are being transformed into MB and GB:

2019-11-05 20:51:56.046 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - couldn't transform value in label because transformationService of type 'JS' is unavailable
2019-11-05 20:51:58.981 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.Group
2019-11-05 20:51:58.986 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'gSynologyNetwork' for widget org.eclipse.smarthome.model.sitemap.Group

I’m guessing that it’s down to it not being able to transform the numbers using the byte.js and kbyte.js…I’ve created them in the transform folder is that correct or have I missed a step???

Hi,

you need to install the Java Script transformation service:

The *.js files from above you add to the transform folder. The *.items files to the items folder.

1 Like

Of course, my bad I assumed that I had it installed already…turns out I must have uninstalled it by accident…

Thanks :+1:

All-

I tried this and am unable to get it to work on my DSM218+. The fields are showing up on my sitemap, but no data is appearing. Nothing appears in the logs.

I activated SNMPv2c and verified that it is working on port 161 using SNMP tester on my PC. I installed the binding - set it equal to port 3126 as suggested (which does not work on SNMP tester, but port 161 does). I ensured community = public in the conf file, the SNMP community on the Synology. The items file was copied exactly, except I changed the IP address to that of my Synology machine (192.168.1.84) in each of the item lines. Can someone suggest where to look next?

Many thanks,

-Mark

All-

Nevermind. I forgot to list the snmp1 binding in the addons.cfg and it kept deleting the binding upon rebooting Openhab. All set now - some data is now populating. Will try to work out the bugs for those fields that are not populating.

-Mark

here is the version using the latest openhab 2 binding: