Simple shell script for capturing SNMP stats to InfluxDB and monitoring health in Grafana.
- InfluxDB
- Grafana
- Synology NAS with SNMP enabled
The script is best suited to run on the NAS itself and highly recommended. It can be ran on another device but the device would need to be able to run shell scripts, able to make SNMP calls such as using snmpwalk and has the Synology SNMP MIB's . With minimal configuration, the Synology NAS should be more than capable of capturing this itself.
- Save the script to a known location on the NAS. For example, /volume1/Local/Scripts/synology_snmp.sh
- Input the InfluxDB information such as URL/IP, ports, database name, username and password.
- Modify any other configuration settings, each should have an explanation.
- On the Synology NAS, Select Control Panel > Terminal & SNMP > SNMP and enable SNMP V1, V2c service.
- On the Synology NAS, Select Control Panel > Task Scheduler > Create >> Scheduled Task >> User-defined Script.
- Give the Task a recognizable name.
- On the Task Settings, set the Run command to bash /path/to/synology_snmp.sh
- On the Schedule:
- Run on the following days: Daily
- First run time: 00:00
- Frequency: Every minute The frequency of times it runs within that minute is defined in the script itself
- Last run time: 23:59
- Import the Synology_dashboard.json file to your Grafana instance, Create > Import > Import .json file.