HowTo: monitor Synology NAS
Moderator: leecollings
-
- Posts: 17
- Joined: Tuesday 07 January 2014 22:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
@mbliek Nice!
-
- Posts: 17
- Joined: Tuesday 07 January 2014 22:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
There is a small typo in the synology part of the wiki. You Copied the enabling SNMP on QNAP to the synology partmbliek wrote:I made a Wiki page for the NAS monitoring.
I added the link in the first post.
http://www.domoticz.com/wiki/NAS_Monitoring
I edited your script a bit @rvmourik
- 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
Oeps changed.rvmourik wrote:There is a small typo in the synology part of the wiki. You Copied the enabling SNMP on QNAP to the synology partmbliek wrote:I made a Wiki page for the NAS monitoring.
I added the link in the first post.
http://www.domoticz.com/wiki/NAS_Monitoring
I edited your script a bit @rvmourik
You can also edit the wiki page if you want
Op zoek naar een Domoticz Start Set?
-
- Posts: 17
- Joined: Tuesday 07 January 2014 22:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
I know, but currently using the smartphone. with all the stupid auto correct not very nice while editing a wiki
-
- Posts: 9
- Joined: Thursday 13 February 2014 16:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
Hi
I was trying this script.
I got some weird numbers from it? Any id?
How can i add all my hdd from my synology nas. I've got 4 drives. need temp and space
Thanks for a great script.
/Niklas
I was trying this script.
I got some weird numbers from it? Any id?
How can i add all my hdd from my synology nas. I've got 4 drives. need temp and space
Thanks for a great script.
/Niklas
- 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
I'm sorry, can't help you really with this.
Since I don't have a sinology.
But I think its caused by the snmp numbers.
You should look on the internet for the right snmp numbers for your NAS.
It's the last number of:
snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.4.1.6574.2.1.1.6.0
this you need to change:
1.3.6.1.4.1.6574.2.1.1.6.0
Since I don't have a sinology.
But I think its caused by the snmp numbers.
You should look on the internet for the right snmp numbers for your NAS.
It's the last number of:
snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.4.1.6574.2.1.1.6.0
this you need to change:
1.3.6.1.4.1.6574.2.1.1.6.0
Op zoek naar een Domoticz Start Set?
-
- Posts: 9
- Joined: Thursday 13 February 2014 16:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
Ok. Thank you for your input
I Read this document on mib from synology:
http://www.synology.com/en-global/support/snmp_mib
Looks like the Numbers in the example on this forum and the doc in the attached link is the same.
Could anyone please verify?
I Read this document on mib from synology:
http://www.synology.com/en-global/support/snmp_mib
Looks like the Numbers in the example on this forum and the doc in the attached link is the same.
Could anyone please verify?
-
- Posts: 17
- Joined: Tuesday 07 January 2014 22:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
The "easy" way is to use snmpwalk, using this you can find out the right numbers.
For example if this is a number of a disk:
1.3.6.1.4.1.6574.2.1.1.6.0
You can use snmpwalk with:
1.3.6.1.4.1.6574.2.1.1.6
To find out al underlaying possibilities.
I know its not a complete how-to but i hope it helps you
For example if this is a number of a disk:
1.3.6.1.4.1.6574.2.1.1.6.0
You can use snmpwalk with:
1.3.6.1.4.1.6574.2.1.1.6
To find out al underlaying possibilities.
I know its not a complete how-to but i hope it helps you
-
- Posts: 9
- Joined: Thursday 13 February 2014 16:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
Hmmmm
This is what i get when running it direct on synology
SYNOLOGY-DISK-MIB::DiskTemperature.0 = INTEGER: -1
SYNOLOGY-DISK-MIB::DiskTemperature.1 = INTEGER: -1
SYNOLOGY-DISK-MIB::DiskTemperature.2 = INTEGER: -1
SYNOLOGY-DISK-MIB::DiskTemperature.3 = INTEGER: -1
??????
This is what i get when running it direct on synology
SYNOLOGY-DISK-MIB::DiskTemperature.0 = INTEGER: -1
SYNOLOGY-DISK-MIB::DiskTemperature.1 = INTEGER: -1
SYNOLOGY-DISK-MIB::DiskTemperature.2 = INTEGER: -1
SYNOLOGY-DISK-MIB::DiskTemperature.3 = INTEGER: -1
??????
-
- Posts: 17
- Joined: Tuesday 07 January 2014 22:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
The sequence i gave was just an example. But as you can see this sequence contains 4 disks.
I don't know why it outputs -1
But this way you can find out which sequence you need to use to get the right information
I don't know why it outputs -1
But this way you can find out which sequence you need to use to get the right information
-
- Posts: 9
- Joined: Thursday 13 February 2014 16:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
i ran
snmpwalk -c public -v2c localhost synoDisk
didn't try your numbers
i will keep searching
snmpwalk -c public -v2c localhost synoDisk
didn't try your numbers
i will keep searching
-
- Posts: 17
- Joined: Tuesday 07 January 2014 22:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
Good luck!
-
- Posts: 9
- Joined: Thursday 13 February 2014 16:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
thank you and thank you for trying to help me..
I'll let you know if i find a solution
I'll let you know if i find a solution
-
- Posts: 9
- Joined: Thursday 13 February 2014 16:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
Upgraded synology dsm 4.3 3210 to 4.3 3810 and vola... there it is
-
- Posts: 9
- Joined: Thursday 13 February 2014 16:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
Hi
Just wanted to show you the result.
Cheers
/Niklas
Just wanted to show you the result.
Cheers
/Niklas
- mbliek
- Posts: 194
- Joined: Friday 12 July 2013 14:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: the Netherlands
- Contact:
-
- 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
Nixta can you post your script here so we can have a look how you add the other HD's into the script
Greetz Bob
Greetz Bob
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
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
-
- Posts: 9
- Joined: Thursday 13 February 2014 16:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
HowTo: monitor Synology NAS
Ok here it is!
--------------------------------
What should i now do with Domoticz? Any idees?
RPI, Domoticz, telldus and tellestick
*got 10 switches, 2 inwall.
*got 2 scenes: Home And away. Would like to have raspbmc on my second Rpi turn light off when startin Movie. But don't know how?
Should i buy razberry and go with Z-wave Products? pros and Cons?
-------------------------------------------------
#!/bin/bash
# Settings
NASIP="192.168.0.190" # NAS IP Address
PASSWORD="password" # SNMP Password
DOMO_IP="192.168.0.182" # Domoticz IP Address
DOMO_PORT="1111" # Domoticz Port
NAS_IDX="15" # NAS Switch IDX
NAS_HD1_TEMP_IDX="12" # NAS HD1 Temp IDX
NAS_HD2_TEMP_IDX="13" # 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="14" # NAS HD1 Temp IDX
NAS_HD2_SPACE_IDX="18" # NAS HD2 Temp 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¶m=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¶m=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¶m=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¶m=udevice&idx=$NAS_HD4_TEMP_IDX&nvalue=0&svalue=$HDtemp4"
# 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¶m=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¶m=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¶m=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¶m=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¶m=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¶m=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¶m=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¶m=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¶m=udevice&idx=$NAS_HD4_TEMP_IDX&nvalue=0&svalue=$HDtemp4"
# 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¶m=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¶m=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¶m=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¶m=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¶m=switchlight&idx=$NAS_IDX&switchcmd=Off"
fi
fi
--------------------------------
What should i now do with Domoticz? Any idees?
RPI, Domoticz, telldus and tellestick
*got 10 switches, 2 inwall.
*got 2 scenes: Home And away. Would like to have raspbmc on my second Rpi turn light off when startin Movie. But don't know how?
Should i buy razberry and go with Z-wave Products? pros and Cons?
-------------------------------------------------
#!/bin/bash
# Settings
NASIP="192.168.0.190" # NAS IP Address
PASSWORD="password" # SNMP Password
DOMO_IP="192.168.0.182" # Domoticz IP Address
DOMO_PORT="1111" # Domoticz Port
NAS_IDX="15" # NAS Switch IDX
NAS_HD1_TEMP_IDX="12" # NAS HD1 Temp IDX
NAS_HD2_TEMP_IDX="13" # 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="14" # NAS HD1 Temp IDX
NAS_HD2_SPACE_IDX="18" # NAS HD2 Temp 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¶m=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¶m=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¶m=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¶m=udevice&idx=$NAS_HD4_TEMP_IDX&nvalue=0&svalue=$HDtemp4"
# 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¶m=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¶m=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¶m=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¶m=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¶m=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¶m=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¶m=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¶m=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¶m=udevice&idx=$NAS_HD4_TEMP_IDX&nvalue=0&svalue=$HDtemp4"
# 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¶m=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¶m=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¶m=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¶m=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¶m=switchlight&idx=$NAS_IDX&switchcmd=Off"
fi
fi
Last edited by Nixta on Sunday 16 February 2014 22:10, edited 1 time in total.
-
- Posts: 4
- Joined: Saturday 15 February 2014 17:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HowTo: monitor Synology NAS
@rvmourik Thanx for the script!
Got it all set up within 30 minutes.
Configuration: DS1010+ DSM 4.3-3810, Raspberry PI Domoticz V1.1492 ( and a Plugwise Circle for the power consumption)
Got it all set up within 30 minutes.
Configuration: DS1010+ DSM 4.3-3810, Raspberry PI Domoticz V1.1492 ( and a Plugwise Circle for the power consumption)
Domoticz, Raspberry Pi, RFXCom, Plugwise Stretch & Smile, KlikaanKlikuit, EQ3 Max!, Foscam, Harmony Hub, Oregon Scientific
Who is online
Users browsing this forum: No registered users and 1 guest