HowTo: monitor Synology NAS

Compatibility (hardware, devices and OS)
User avatar
mbliek
Posts: 805
Joined: Friday 12 July 2013 14:08
Target OS: Raspberry Pi
Domoticz version: beta
Location: the Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by mbliek » Sunday 16 March 2014 11:25

Is the power consumption available by SNMP?
Op zoek naar een Domoticz Start Set?
Like ons op Facebook en krijg een cadeaubon van €5,00

User avatar
bierlaagh
Posts: 40
Joined: Friday 14 March 2014 17:15
Target OS: Raspberry Pi
Domoticz version: 2.2760
Contact:

Re: HowTo: monitor Synology NAS

Post by bierlaagh » Sunday 16 March 2014 13:37

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 4332 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 4332 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: 14
Joined: Wednesday 11 December 2013 23:56
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: HowTo: monitor Synology NAS

Post by theezeefje » Tuesday 25 March 2014 11:30

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

[email protected]:~# 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
[email protected]:~#
are there any recent oid changes ?

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

Re: HowTo: monitor Synology NAS

Post by mbliek » Tuesday 25 March 2014 18:08

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
Op zoek naar een Domoticz Start Set?
Like ons op Facebook en krijg een cadeaubon van €5,00

User avatar
bierlaagh
Posts: 40
Joined: Friday 14 March 2014 17:15
Target OS: Raspberry Pi
Domoticz version: 2.2760
Contact:

Re: HowTo: monitor Synology NAS

Post by bierlaagh » Tuesday 25 March 2014 20:06

@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: 14
Joined: Wednesday 11 December 2013 23:56
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: HowTo: monitor Synology NAS

Post by theezeefje » Wednesday 26 March 2014 11:52

Code: Select all

[email protected]:~# 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
[email protected]:~#
no diff.

-v2c should work.

User avatar
bierlaagh
Posts: 40
Joined: Friday 14 March 2014 17:15
Target OS: Raspberry Pi
Domoticz version: 2.2760
Contact:

Re: HowTo: monitor Synology NAS

Post by bierlaagh » Wednesday 26 March 2014 12:37

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

Code: Select all

[email protected] ~ $ 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: 554
Joined: Wednesday 26 February 2014 16:28
Target OS: Raspberry Pi
Domoticz version:
Location: the Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by roblom » Sunday 06 April 2014 15:36

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: 554
Joined: Wednesday 26 February 2014 16:28
Target OS: Raspberry Pi
Domoticz version:
Location: the Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by roblom » Sunday 06 April 2014 15:38

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

Code: Select all

[email protected] ~ $ 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: 5
Joined: Sunday 27 April 2014 15:37
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: HowTo: monitor Synology NAS

Post by stappel » Tuesday 23 September 2014 22:08

For DSM 5.1beta the disk has moved in snmp iod
It's now .39 instead of ,36

User avatar
sincze
Posts: 686
Joined: Monday 02 June 2014 22:46
Target OS: Linux
Domoticz version: 3.7546
Location: Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by sincze » Friday 24 October 2014 22:42

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 4091 times
SNMP.PNG
SNMP DSM5
SNMP.PNG (74.52 KiB) Viewed 4091 times
Running Domoticz since 2013 with Cubietruck
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave
WIFI: Mi-light Wifi-Bridge, Sonoff, ESP8266
Solar: Omnik Inverter, PVOutput
Video: Kodi clients with Harmony HUB
Sensors: You name it I probably got 1.

User avatar
BigDog
Posts: 288
Joined: Tuesday 17 September 2013 13:59
Target OS: Raspberry Pi
Domoticz version: V2.3530
Location: The Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by BigDog » Tuesday 11 November 2014 13:21

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 Raspberry With Domoticz V2.3530 [Linux version 4.1.6+]
PiRack With
-1X PiFace Digital(headache device)
-1X RaZberry - OpenZWave USB
1X RFXtrx433 USB Firmware: 183
5X Arduno: mysensors V1.5(Testing)
6x ESP8266: easy firmware(Testing)
1X Synology Nas

User avatar
sincze
Posts: 686
Joined: Monday 02 June 2014 22:46
Target OS: Linux
Domoticz version: 3.7546
Location: Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by sincze » Thursday 13 November 2014 23:19

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.
Running Domoticz since 2013 with Cubietruck
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave
WIFI: Mi-light Wifi-Bridge, Sonoff, ESP8266
Solar: Omnik Inverter, PVOutput
Video: Kodi clients with Harmony HUB
Sensors: You name it I probably got 1.

roblom
Posts: 554
Joined: Wednesday 26 February 2014 16:28
Target OS: Raspberry Pi
Domoticz version:
Location: the Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by roblom » Sunday 16 November 2014 0:59

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: 686
Joined: Monday 02 June 2014 22:46
Target OS: Linux
Domoticz version: 3.7546
Location: Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by sincze » Sunday 16 November 2014 15:20

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 3957 times
Running Domoticz since 2013 with Cubietruck
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave
WIFI: Mi-light Wifi-Bridge, Sonoff, ESP8266
Solar: Omnik Inverter, PVOutput
Video: Kodi clients with Harmony HUB
Sensors: You name it I probably got 1.

MAidEN
Posts: 48
Joined: Sunday 07 December 2014 16:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: HowTo: monitor Synology NAS

Post by MAidEN » Sunday 07 December 2014 16:26

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: 686
Joined: Monday 02 June 2014 22:46
Target OS: Linux
Domoticz version: 3.7546
Location: Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by sincze » Sunday 07 December 2014 19:22

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
Running Domoticz since 2013 with Cubietruck
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave
WIFI: Mi-light Wifi-Bridge, Sonoff, ESP8266
Solar: Omnik Inverter, PVOutput
Video: Kodi clients with Harmony HUB
Sensors: You name it I probably got 1.

MAidEN
Posts: 48
Joined: Sunday 07 December 2014 16:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: HowTo: monitor Synology NAS

Post by MAidEN » Saturday 13 December 2014 23:32

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: 34
Joined: Saturday 06 September 2014 15:08
Target OS: Raspberry Pi
Domoticz version: V3.5595
Contact:

Re: HowTo: monitor Synology NAS

Post by zaadstra » Wednesday 17 December 2014 22:36

I was wondering, does the querying the temp's and diskspace prevent the Syno disks from sleeping?

roblom
Posts: 554
Joined: Wednesday 26 February 2014 16:28
Target OS: Raspberry Pi
Domoticz version:
Location: the Netherlands
Contact:

Re: HowTo: monitor Synology NAS

Post by roblom » Thursday 18 December 2014 21:38

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 2 guests