- Fixed the math to support MB/GB/TB on disk volume
- Edited the Prerequisites and Instructions section below, hopefully there is enough instructions to help you get it going
- Enable SNMP on QNAP. Port 161, SNMP V1/V2, Enter a COMMUNITY name.
Home > Network Services > SNMP Settings - Install Optware
- Install Optware's "coreutils" tool
- Install Optware's "bc" tool
- Install Optware's "net-snmp" tool
- Install Cacti, use instructions from http://forum.qnap.com/viewtopic.php?t=21218
- Edit the script qnap-cpu-cron.sh to modify the SNMP_COMMUNITY variable to match the one set in your Qnap device.
- Edit the script qnap-temperature.sh to reflect the number of hard drives you have in the device.
- Copy the shell scripts (.sh files) into /share/MD0_DATA/Web/cacti/script, and make sure they're mode 0755 (run "chmod 0755 qnap*.sh" in that folder).
- Import the .XML file by using the Cacti Import Template function.
- Configure Cacti to point to Qnap, use the template, and configure SNMP community string to match.
- Add the crontab into the autorun.sh script to ensure it survives the reboot. Check Wiki for QNAP autorun.sh script. Example autorun.sh inclusion:
prompt> cat >> /etc/config/crontab <<\EOF
* * * * * /share/MD0_DATA/Web/cacti/scripts/qnap-cpu-cron.sh >/dev/null 2>&1
EOF
prompt> crontab /etc/config/crontab
Also note, per-minute polls is assumed, for better graphs.
For many of the shell scripts, I give credit to the original work by http://pnpk.net (Sorry, I don't read Japanese...), but I've restructured most of them and added some other scripts to make it into this host template.
I spent quite a few sleepless nights on this, so hopefully you'll find it useful. Enjoy!