HowTo: monitor Synology NAS

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

User avatar
mbliek
Posts: 194
Joined: Friday 12 July 2013 14:08
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: the Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by mbliek »

Is the power consumption available by SNMP?
User avatar
bierlaagh
Posts: 42
Joined: Friday 14 March 2014 16:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9984
Contact:

Re: HowTo: monitor Synology NAS

Post by bierlaagh »

sorry mbliek i thougt there was, as far as i know now there is only one power status in Synology SNMP: good or fail (well i know when it fails :D )

i still have one other issue.

free space giving me the good status on the utility page
free space on utility.jpg
free space on utility.jpg (33.06 KiB) Viewed 7616 times
but on my room page it gives me a 0 or 1 or 2.
free space on dashboard.jpg
free space on dashboard.jpg (20.41 KiB) Viewed 7616 times
and i cannot figure out why.

here is my script (free space has IDX 45 and 46)

Code: Select all

#!/bin/bash

# Settings
# 1.3.6.1.4.1.6574.1.2.0
NASIP="192.168.5.2" # NAS IP Address
PASSWORD="public" # SNMP Password
DOMO_IP="192.168.5.3" # Domoticz IP Address
DOMO_PORT="8080" # Domoticz Port

#NAS_HD1_TEMP_IDX="37" # NAS HD1 Temp IDX
#NAS_HD2_TEMP_IDX="38" # NAS HD2 Temp IDX

#NAS_HD1_SPACE_IDX="42" # NAS HD1 Temp IDX
#NAS_HD2_SPACE_IDX="43" # NAS HD2 Temp IDX


NAS_IDX="40" # NAS Switch IDX
NAS_SYS_TEMP_IDX="44" #NAS SYSTEM Temp IDX
NAS_HD1_TEMP_IDX="37" # NAS HD1 Temp IDX
NAS_HD2_TEMP_IDX="38" # NAS HD2 Temp IDX
NAS_HD3_TEMP_IDX="16" # NAS HD3 Temp IDX
NAS_HD4_TEMP_IDX="17" # NAS HD4 Temp IDX
NAS_HD1_SPACE_IDX="45" # NAS HD1 space IDX
NAS_HD2_SPACE_IDX="46" # NAS HD2 space IDX
NAS_HD3_SPACE_IDX="19" # NAS HD3 Temp IDX
NAS_HD4_SPACE_IDX="20" # NAS HD4 Temp IDX


# Check if NAS in online

PINGTIME=`ping -c 1 -q $NASIP | awk -F"/" '{print $5}' | xargs`

echo $PINGTIME
if expr "$PINGTIME" '>' 0
then
 curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$NAS_IDX" | grep "Status" | grep "On" > /dev/null

 if [ $? -eq 0 ] ; then
 echo "NAS already ON"

 # Temperature HD1
 HDtemp1=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.4.1.6574.2.1.1.6.0`
 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD1_TEMP_IDX&nvalue=0&svalue=$HDtemp1"

 # Temperature HD2
 HDtemp2=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.4.1.6574.2.1.1.6.1`
 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD2_TEMP_IDX&nvalue=0&svalue=$HDtemp2"

 # Temperature HD3
# HDtemp3=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.4.1.6574.2.1.1.6.2`
 # Send data
 #curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD3_TEMP_IDX&nvalue=0&svalue=$HDtemp3"

 # Temperature HD4
 #HDtemp4=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.4.1.6574.2.1.1.6.3`
 # Send data
 #curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD4_TEMP_IDX&nvalue=0&svalue=$HDtemp4"
 
 
 # Temperature SYSTEM								.1.3.6.1.4.1.6574.1.2.0
 SYStemp=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.4.1.6574.1.2.0`
 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_SYS_TEMP_IDX&nvalue=0&svalue=$SYStemp"

 
 # Free space Volym1
 HDUnit=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.4.36`
 HDTotal=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.5.36`
 HDUsed=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.6.36`
 HDFree=$((($HDTotal - $HDUsed) * $HDUnit / 1024 / 1024 / 1024))

 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD1_SPACE_IDX&nvalue=0&svalue=$HDFree"

 # Free space Volym 2
 HDUnit=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.4.37`
 HDTotal=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.5.37`
 HDUsed=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.6.37`
 HDFree=$((($HDTotal - $HDUsed) * $HDUnit / 1024 / 1024 / 1024))

# Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD2_SPACE_IDX&nvalue=0&svalue=$HDFree"

 # Free space Volym 3
 #HDUnit=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.4.38`
 #HDTotal=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.5.38`
 #HDUsed=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.6.38`
 #HDFree=$((($HDTotal - $HDUsed) * $HDUnit / 1024 / 1024 / 1024))

 # Send data
 #curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD3_SPACE_IDX&nvalue=0&svalue=$HDFree"

 # Free space volymusb1
 #HDUnit=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.4.39`
 #HDTotal=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.5.39`
 #HDUsed=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.6.39`
 #HDFree=$((($HDTotal - $HDUsed) * $HDUnit / 1024 / 1024 / 1024))

 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD4_SPACE_IDX&nvalue=0&svalue=$HDFree"

 else
 echo "NAS ON"
 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$NAS_IDX&switchcmd=On"

 # Temperature HD1
 HDtemp1=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.4.1.6574.2.1.1.6.0`
 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD1_TEMP_IDX&nvalue=0&svalue=$HDtemp1"

 # Temperature HD2
 HDtemp2=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.4.1.6574.2.1.1.6.1`
 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD2_TEMP_IDX&nvalue=0&svalue=$HDtemp2"

 # Temperature HD3
 #HDtemp3=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.4.1.6574.2.1.1.6.2`
 # Send data
 #curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD3_TEMP_IDX&nvalue=0&svalue=$HDtemp3"

 # Temperature HD4
 #HDtemp4=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.4.1.6574.2.1.1.6.3`
 # Send data
 #curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD4_TEMP_IDX&nvalue=0&svalue=$HDtemp4"

 
 
  # Temperature SYSTEM								.1.3.6.1.4.1.6574.1.2.0
 SYStemp=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.4.1.6574.1.2.0`
 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_SYS_TEMP_IDX&nvalue=0&svalue=$SYStemp"

 
 # Free space Volym 1
 HDUnit=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.4.36`
 HDTotal=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.5.36`
 HDUsed=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.6.36`
 HDFree=$((($HDTotal - $HDUsed) * $HDUnit / 1024 / 1024 / 1024))

 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD1_SPACE_IDX&nvalue=0&svalue=$HDFree"

 # Free space Volym 2
 HDUnit=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.4.37`
 HDTotal=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.5.37`
 HDUsed=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.6.37`
 HDFree=$((($HDTotal - $HDUsed) * $HDUnit / 1024 / 1024 / 1024))

 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD2_SPACE_IDX&nvalue=0&svalue=$HDFree"
 # Free space Volym 3
 HDUnit=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.4.38`
 HDTotal=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.5.38`
 HDUsed=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.6.38`
 HDFree=$((($HDTotal - $HDUsed) * $HDUnit / 1024 / 1024 / 1024))

 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD3_SPACE_IDX&nvalue=0&svalue=$HDFree"

# Free space volymusb1
 HDUnit=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.4.39`
 HDTotal=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.5.39`
 HDUsed=`snmpget -v 2c -c $PASSWORD -O qv $NASIP .1.3.6.1.2.1.25.2.3.1.6.39`
 HDFree=$((($HDTotal - $HDUsed) * $HDUnit / 1024 / 1024 / 1024))

 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_HD4_SPACE_IDX&nvalue=0&svalue=$HDFree"

 fi

else
 curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$NAS_IDX" | grep "Status" | grep "Off" > /dev/null
 if [ $? -eq 0 ] ; then
 echo "NAS already OFF"
 exit
 else
 echo "NAS OFF"
 # Send data
 curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$NAS_IDX&switchcmd=Off"
 fi

fi
if someone know why, please tell me i'm a little stuck here...
1x Raspberry PI 3 With Domoticz V.3.7318
1X RFXtrx433 USB 433.92MHz
1X Synology DS213j Nas
Toon by Eneco including Toon Zon
several KAKU switches and dimmers
Mysensors WIFI Gateway including meters, switches en humidity sensors
Wifi Dimmers (home made)
theezeefje
Posts: 5
Joined: Wednesday 11 December 2013 22:56
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: HowTo: monitor Synology NAS

Post by theezeefje »

any ideas ?

I have turned on SNMP on my DS213+,

when I try to snmpget data from the device, I receive the following error:

Code: Select all

root@archimedes:~# snmpget -c public -v2c -O qv 192.168.0.15 .1.3.6.1.4.1.6574.1.2.0
No Such Object available on this agent at this OID
root@archimedes:~#
are there any recent oid changes ?
User avatar
mbliek
Posts: 194
Joined: Friday 12 July 2013 14:08
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: the Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by mbliek »

Could be, but it can also be possible that your system don't provide that OID....
I'm using a QNAP NAS so I don't know if they changed the OID's
User avatar
bierlaagh
Posts: 42
Joined: Friday 14 March 2014 16:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9984
Contact:

Re: HowTo: monitor Synology NAS

Post by bierlaagh »

@theezeefje could it be you forgot space between -v and 2c ? The oid is for system temperature and shoul work on a Sinology
1x Raspberry PI 3 With Domoticz V.3.7318
1X RFXtrx433 USB 433.92MHz
1X Synology DS213j Nas
Toon by Eneco including Toon Zon
several KAKU switches and dimmers
Mysensors WIFI Gateway including meters, switches en humidity sensors
Wifi Dimmers (home made)
theezeefje
Posts: 5
Joined: Wednesday 11 December 2013 22:56
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: HowTo: monitor Synology NAS

Post by theezeefje »

Code: Select all

root@archimedes:~# snmpget -c public -v 2c -O qv 192.168.0.15 .1.3.6.1.4.1.6574.1.2.0
No Such Object available on this agent at this OID
root@archimedes:~#
no diff.

-v2c should work.
User avatar
bierlaagh
Posts: 42
Joined: Friday 14 March 2014 16:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9984
Contact:

Re: HowTo: monitor Synology NAS

Post by bierlaagh »

strange...
this is my output on my PI when i contact my nas

Code: Select all

pi@raspberrypi ~ $ snmpget -c public -v 2c -O qv 192.168.5.2 .1.3.6.1.4.1.6574.1.2.0
57
could it be that the 213+ does not support system temperature?

and is this oid the only one that does not work?
1x Raspberry PI 3 With Domoticz V.3.7318
1X RFXtrx433 USB 433.92MHz
1X Synology DS213j Nas
Toon by Eneco including Toon Zon
several KAKU switches and dimmers
Mysensors WIFI Gateway including meters, switches en humidity sensors
Wifi Dimmers (home made)
roblom
Posts: 402
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by roblom »

Create 1 virtual switch and 3 virtual temperature sensors.
I think it needs to be
Create 1 virtual switch and 2 virtual temperature sensors and 1 virtual counter.
Also

Code: Select all

NAS_HD_SPACE_IDX="4"        # NAS HD1 Temp IDX
Needs to be

Code: Select all

NAS_HD_SPACE_IDX="4"        # NAS HD Space IDX
roblom
Posts: 402
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by roblom »

bierlaagh wrote:strange...
this is my output on my PI when i contact my nas

Code: Select all

pi@raspberrypi ~ $ snmpget -c public -v 2c -O qv 192.168.5.2 .1.3.6.1.4.1.6574.1.2.0
57
could it be that the 213+ does not support system temperature?

and is this oid the only one that does not work?
I have a DS213+ and can confirm the given script works also on a DS213+.
stappel
Posts: 1
Joined: Sunday 27 April 2014 15:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: HowTo: monitor Synology NAS

Post by stappel »

For DSM 5.1beta the disk has moved in snmp iod
It's now .39 instead of ,36
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: HowTo: monitor Synology NAS

Post by sincze »

stappel wrote:For DSM 5.1beta the disk has moved in snmp iod
It's now .39 instead of ,36
Any suggestions to get this working with DS412+?

snmpget -v 2c -c <community> -O qv <IPOFNAS> 1.3.6.1.4.1.6574.2.1.1.2

No results for a disk temperature

This does work:

snmpget -v 2c -c <community> -O qv <IPOFNAS> 1.3.6.1.4.1.6574.1.2.0

It will result the system temperature
Attachments
SNMP2.PNG
SNMP2.PNG (74.73 KiB) Viewed 7375 times
SNMP DSM5
SNMP DSM5
SNMP.PNG (74.52 KiB) Viewed 7375 times
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
BigDog
Posts: 82
Joined: Tuesday 17 September 2013 13:59
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.9269
Location: The Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by BigDog »

have updated to DSM 5.1 :) and yep the code has changed..

have anybody changed the script in the wiki? :)

or the changes that must be made?

becose HD1 isnt showing temp and space :)

36 change to 39 dont work wil look Further @ home..


Greetz BigDog
1X Raspberry4B : Domoticz Version 2023.1 [Linux 5.10.63-v7l+ armv7l]
1X Conbee II : 2.25.3 - 26720700
1X RFXtrx433 USB Firmware:183
1X Mysensors Gateway 1.5 -3
6X ESP8266: Tosmota firmware
Zigbee : 6 Operators, 13 Sensors
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: HowTo: monitor Synology NAS

Post by sincze »

BigDog wrote:have updated to DSM 5.1 :) and yep the code has changed..

have anybody changed the script in the wiki? :)

or the changes that must be made?

becose HD1 isnt showing temp and space :)

36 change to 39 dont work wil look Further @ home..


Greetz BigDog
Ok, just updated to 5.1. as well.
Will wait.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
roblom
Posts: 402
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by roblom »

My DS213+ is running DSM 5.1. The temperature is still given in Domoticz but the diskspace isn't logged anymore.
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: HowTo: monitor Synology NAS

Post by sincze »

decrxgarage wrote:My DS213+ is running DSM 5.1. The temperature is still given in Domoticz but the diskspace isn't logged anymore.

I can confirm the temperature is still working indeed DSM 5.1.
Just installed the script.

I do get some values for the HD usage however those are not in my script.

Code: Select all

snmpget -c public-domoticz -v2c -O qv 192.168.2.12 .1.3.6.1.2.1.25.2.3.1.4.36
snmpget -c public-domoticz -v2c -O qv 192.168.2.12 .1.3.6.1.2.1.25.2.3.1.5.36
snmpget -c public-domoticz -v2c -O qv 192.168.2.12 1.3.6.1.2.1.25.2.3.1.6.36
Attachments
syno-SNMP.PNG
syno-SNMP.PNG (65.95 KiB) Viewed 7241 times
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
MAidEN
Posts: 17
Joined: Sunday 07 December 2014 15:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: HowTo: monitor Synology NAS

Post by MAidEN »

Hi all,

I had add a monitor of CPU and Memory of my Synology with DSM 5.1.

Image

I had this code on my nas.sh :

Code: Select all

#Variables
 NAS_MEM_IDX="55"        # NAS MEM IDX
 NAS_CPU_IDX="56"        # NAS CPU IDX
 
# Free Memory Available in %
	MemAvailable=`snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.4.1.2021.4.6.0`
        MemAvailableinMo=$(($MemAvailable / 1024))
	MemUsepercent=$((($MemAvailableinMo * 100) / 1024))
        # Send data
        curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_MEM_IDX&nvalue=0&svalue=$MemUsepercent"
 
	# CPU utilisation
        CpuUser=`snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.4.1.2021.11.9.0`
	CpuSystem=`snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.4.1.2021.11.10.0`
	CpuUse=$(($CpuUser + $CpuSystem))
        # Send data
        curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_CPU_IDX&nvalue=0&svalue=$CpuUse"
Change Variable with your IDX virtual device (type General and Pourcentage)

And is ok :mrgreen:
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: HowTo: monitor Synology NAS

Post by sincze »

MAidEN wrote:Hi all,

I had add a monitor of CPU and Memory of my Synology with DSM 5.1.

Image

:mrgreen:
Works great. Updated my nas.sh.
Thank you. :D
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
MAidEN
Posts: 17
Joined: Sunday 07 December 2014 15:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: HowTo: monitor Synology NAS

Post by MAidEN »

I don't know no why but my storage counter doesn't work :?

Image

When I browse with snmp reader, I see the OID 1.3.6.1.2.1.25.2.3.1.6.36 who was egal HD Used is egal to 0 :

Image

OID 36 is a good volume of my SHM group disk :

Image

My synology is on DSM 5.1

Have you any ideas of my problem?
zaadstra
Posts: 23
Joined: Saturday 06 September 2014 15:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: HowTo: monitor Synology NAS

Post by zaadstra »

I was wondering, does the querying the temp's and diskspace prevent the Syno disks from sleeping?
roblom
Posts: 402
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by roblom »

MAidEN wrote:Hi all,

I had add a monitor of CPU and Memory of my Synology with DSM 5.1.

Image

I had this code on my nas.sh :

Code: Select all

#Variables
 NAS_MEM_IDX="55"        # NAS MEM IDX
 NAS_CPU_IDX="56"        # NAS CPU IDX
 
# Free Memory Available in %
	MemAvailable=`snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.4.1.2021.4.6.0`
        MemAvailableinMo=$(($MemAvailable / 1024))
	MemUsepercent=$((($MemAvailableinMo * 100) / 1024))
        # Send data
        curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_MEM_IDX&nvalue=0&svalue=$MemUsepercent"
 
	# CPU utilisation
        CpuUser=`snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.4.1.2021.11.9.0`
	CpuSystem=`snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.4.1.2021.11.10.0`
	CpuUse=$(($CpuUser + $CpuSystem))
        # Send data
        curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$NAS_CPU_IDX&nvalue=0&svalue=$CpuUse"
Change Variable with your IDX virtual device (type General and Pourcentage)

And is ok :mrgreen:
Maybe you can add it to the NAS wiki.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests