Announcement

Collapse
No announcement yet.

Retrieve Hard Disk Temperature from Synology DS218+ NAS?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Retrieve Hard Disk Temperature from Synology DS218+ NAS?

    In the realm of want, not need, I would like to retrieve the hard drive temperatures from a Synology DS218+ NAS and historize them in my HS4 HomeTroller.

    There are a few hints on the 'net that this can be done, at least in the Linux world, but no clear instructions on how to accomplish this from via an API.

    Any thoughts would be appreciated. TIA



    Click image for larger version

Name:	image.png
Views:	244
Size:	27.9 KB
ID:	1614688

    #2
    You can enable SNMP and then use my SNMP plugin to read the respective MIB's.

    https://global.download.synology.com..._MIB_Guide.pdf

    For drive 1, the MIB should be 1.3.6.1.4.1.6574.2.1.1.6.0
    For drive 2, the MIB should be 1.3.6.1.4.1.6574.2.1.1.6.1
    Jon

    Comment


      #3
      100% 😁👍

      Only hiccup was Windows Defender intercepting the hs.Launch at restart on the Windows 10 HomeTroller. I didn't see it since I usually dial-in (so to speak) remotely to the HomeTroller; figured something was amiss and went to the console screen.

      Question: Can I change the name 'SNMP n' to something else from the setup screen, or do I have to delete and rebuild with a new name? TIA

      Click image for larger version  Name:	image.png Views:	0 Size:	29.9 KB ID:	1614709

      Comment


        #4
        👍 The name entry in the setup is used initially for the device name when being created. If this is not defined then defaults to the names in your screenshot. If you want to change the name, just add the correct name to the setup page. It should change on the next update.

        Remember, you can add a suffix such as °C to show it as 29°C
        Jon

        Comment


          #5
          Seeing some anomolous results here. I have 3 SNMP sensors defined, Disk 1 temperature, disk 2 temperature, and the CPU temperature. All 3 are on a 5 minute scan with the Offline Device Value set to -1.

          The disk 1 temperature is normally about 28-30 DegC as shown in the debug log below

          Click image for larger version  Name:	image.png Views:	0 Size:	85.3 KB ID:	1614840

          But, occasionally it is being reported as exactly 0 DegC as seen here

          Click image for larger version  Name:	image.png Views:	0 Size:	96.6 KB ID:	1614841

          The Disk 2 temperature is doing the same thing, reporting as 0 then returning to normal on the next scan

          Interestingly, the CPU temperature reports normally as 40 DegC, but when the anomoly occurs, the CPU temperature goes to a very large integer value like 22423.

          All 3 sensors appear to report anomolously at the same time, and then return to normal on the next scan.

          The Offline Device Value of -1 is not in the data; does that mean that the DS218+ is not 'offline' and that the values recorded are actually being returned by the NAS?

          Best Regards

          A screen capture from yesterday

          Click image for larger version

Name:	image.png
Views:	169
Size:	35.0 KB
ID:	1614842

          Comment


            #6
            You would only get -1 returned if the specified OID cannot be read so yes, the values returned are being provided by the NAS.

            I did find something about Synology NAS SNMP occasionally giving false readings: https://kb.paessler.com/en/topic/469...alse-positives

            Not sure what to suggest as I have no control over this behavior.



            Jon

            Comment


              #7
              Interesting link, don't think loading is the issue in my case. The 2 Dell systems which use the NAS are shutdown at night and the Hometroller does not read/write to the NAS.

              I will try to gather some data from the NAS when the anomoly next occurs.

              Best Regards

              Comment


                #8
                I added the DS218+ Serial Number since it is a String type and might behave differently than an Integer.

                In the image below, the HS4 String serial number is fine, but I noticed the HS4 value is being set to 40114. Flash back to my days in industrial automation, that looks suspiciously like the current seconds in the day, 40114/3600 = 11.14 hrs or 11:08am and a little change.

                Click image for larger version

Name:	image.png
Views:	172
Size:	69.6 KB
ID:	1614869

                That got me back to the CPU temperature when it 'spiked', in this case 22423 or 06:13am and some change.

                Click image for larger version

Name:	image.png
Views:	171
Size:	41.7 KB
ID:	1614870
                Is the DS218+ SNMP returning these time values or is there some logic path where these values are being inserted? TIA

                Note that this still doesn't explain the disk temperatures reporting as 0.

                And of course as soon as I turned on the debug logging, the anomolies disappeared (for now...)

                Best Regards

                Comment


                  #9
                  To allow device triggering change on an OID which returns a string, I set the device value to the number of seconds passed in the day. If the string does not change, then this should only happen when configured and the device created.

                  If the serial number did change, then the device value would be set again to the current number of seconds passed in the day. You can use this change of value to trigger an event.

                  So looking at the temperature device, you have ??? for the sensor value. This means it could not read the OID value. I can see a bug in my code where it can set the device to the total number of seconds passed when there is no reading. I don't have time today but I'll post an update tomorrow.



                  Jon

                  Comment


                    #10
                    It looks like the String value parameter is being unconditionally updated to the current seconds in the day, regardless of the value of the string


                    Click image for larger version

Name:	image.png
Views:	148
Size:	279.2 KB
ID:	1614898

                    I will continue to gather data. Thanks for your assistance!

                    Best Regards

                    Comment


                      #11
                      The first 2 images show the CPU temperature (Integer) and NAS Serial Number (string) both with ??? indicating a comms issue. Both of these parameters are in the same MIB

                      Click image for larger version

Name:	image.png
Views:	163
Size:	76.2 KB
ID:	1614920
                      Click image for larger version

Name:	image.png
Views:	160
Size:	41.7 KB
ID:	1614921

                      In this image we have both disk temperatures (integer) and both disk model numbers (string); all of these parameters are in the same MIB (not the same as above). The 2 string model numbers are showing ??? indicating a comms issue, but the the integers are simply showing current value of 0.

                      It seems that there is a general comms issue based on the ??? for the strings, the fact that the two disk temperatures don't have ??? seems like an outlier.

                      Click image for larger version

Name:	image.png
Views:	141
Size:	278.1 KB
ID:	1614922

                      Comment


                        #12
                        SNMP uses UDP so if you are losing packets/data, it could be due to network congestion. I can add a retry to see if that helps.

                        As I said, there are also bugs relating to device updates which I will look at tomorrow.

                        Jon

                        Comment

                        Working...
                        X