0

i have a strange problem, i want to monitor my Synology DiskStation NAS with Nagios. I installed SNMP on it and created a custom exec in my snmpd.conf

exec synology_disk_usage  /opt/bin/bash /usr/bin/diskusage.sh

The /usr/bin/diskusage.sh is a simple script which run a single snmpget and multiply it by 4 to give me exact diskusage:

#!/opt/bin/bash
value=$(snmpget -v 1 -c public localhost HOST-RESOURCES-MIB::hrStorageSize.33 -O Qve)
echo "$value * 4" | bc

When I run the script directly:

bash-3.2# /usr/bin/diskusage.sh 
956787604

And when I make an snmpwalk:

bash-3.2# snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.8.1  
iso.3.6.1.4.1.2021.8.1.1.1 = INTEGER: 1 
iso.3.6.1.4.1.2021.8.1.2.1 = STRING: "synology_disk_usage" 
iso.3.6.1.4.1.2021.8.1.3.1 = STRING: "/opt/bin/bash" 
Timeout: No Response from localhost

The problem must be somewhere around the snmpget in script, when i change it i.e to value=123 then in snmpwalk the output is correct. Tried to make snmpget with bigger timeout (even 20 secs) but I was still getting this.

Any help would be very appreciated! Regards

My snmpd.conf

rocommunity  public                                                        
rwcommunity  public                                                        

proc  smbd 30 1                                                            
proc  nmbd 1 1                                                             
proc  sshd 30 1                                                            
proc  syslogd 1 1                                                           
proc  klogd 1 1                                                             
proc  USB_Detect 2 2                                                        

disk  / 5%                                                                  
disk  /share/hdd/data 5%                                                    
disk  /share/hdd/conf 5%                                                    

load  10 8 5                                                                    
file  /var/log/messages 131072                                                  
file  /var/log/samba/log.nmbd 131072                                            
file  /var/log/samba/log.smbd 131072                                            

syslocation  "UNKNOWN LOCATION"                                                 

syscontact  "UNKNOWN CONTACT"                                                   

exec synology_disk_usage  /opt/bin/bash /usr/bin/diskusage.sh
  • Please post snmpd.conf – TheFiddlerWins Oct 21 '14 at 16:16
  • edited main post with config – user2008937 Oct 21 '14 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.