If then echo "NAS already ON" # Temperature HD1 HDtemp1 = `snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.2.1.1.6.0 ` # Send dataĬurl -s -i -H "Accept: application/json" " $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.2.1.1.6.1 ` # Send dataĬurl -s -i -H "Accept: application/json" " $DOMO_IP : $DOMO_PORT /json.htm?type=command¶m=udevice&idx= $NAS_HD2_TEMP_IDX &nvalue=0&svalue= $HDtemp2 " # Free space volume in Go HDUnit = `snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.2.1.25.2.3.1.4.36 ` # Change OID to. #!/bin/bash # Settings NASIP = "'''0.0.0.0'''" # NAS IP Address PASSWORD = "'''SNMP password'''" # SNMP Password DOMO_IP = "'''0.0.0.0'''" # Domoticz IP Address DOMO_PORT = "'''0000'''" # Domoticz Port NAS_IDX = "'''1'''" # Virtual switch NAS STATUS CPU_TEMP_IDX = "'''2'''" # Virtual temerature sensor IDX NAS CPU HD1_TEMP_IDX = "'''3'''" # Virtual temerature sensor IDX HD1 HD2_TEMP_IDX = "'''4'''" # Virtual temerature sensor IDX HD2 HD_REMAIN_IDX = "'''5'''" # Virtual temerature sensor IDX HD REMAIN # Check if NAS in online PINGTIME = `ping -c 1 -q $NASIP | awk -F "/" '' | xargs ` echo $PINGTIME if expr " $PINGTIME " '>' 0 thenĬurl -s " $DOMO_IP : $DOMO_PORT /json.htm?type=devices&rid= $NAS_IDX " | grep "Status" | grep "On" > /dev/null ![]() Snmpget -v 2c -c PASSWORD -O qv NASIPADDRESS 1.3.6.1.1.1.2.11.1.3.1Ĭreate 1 virtual switch and 4 virtual temperature sensors. When the NAS is OFF the switch will be switched OFF, and will be left alone till the NAS is back ON.įor this script to work you need to enable SNMP on your NAS and install SNMP on your Raspberry Pi On the next check (5 min later), if the has is still ON it will leave the switch alone and only update the temperature sensors. The script will check if the NAS is on, when the NAS was first Off it will switch a virtual switch to ON and update the temperature sensors. This part of the guide describes how to monitor your QNAP NAS via SNMP on your Raspberry Pi. This guide contains instructions for QNAP, Synology, and NETGEAR This guide describes how to monitor your NAS (Network Attached Storage) via SNMP on your Raspberry Pi. ![]() NAS (Network Attached Storage) Monitoring via SNMP 1.2.1.1 Enable SNMP on your Synology NAS. ![]() 1 NAS (Network Attached Storage) Monitoring via SNMP.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |