For those used to Windows, you’ll be pleased to know that using DSM is very similar.ĭSM offers more user-friendly network and sharing management features than Microsoft. DSM may look very basic, but it’s very similar to a fully-fledged OS. In the case of Synology, the OS used is called DiskStation Manager (DSM), a lightweight Linux-based platform. For example, it enables the NAS to power up on its own, initializes storage devices, manages network traffic, and more. NAS units need to have their own Operating System (OS) to make everything work independently. They all have processors, memory, storage controllers, network interface, and other necessary hardware. NAS are, essentially, miniature computers. This could be done in /usr/share/zabbix/include/ that the background is out of the way, let’s deal with the down and dirty. As there are weekly or even monthly backup-jobs it makes sense to raise this time. Jobs older then 24hīy default Zabbix' last()-command only shows events happened in the last 24h. To kill it during logrotation simply add kill cat /var/run/qnap-backup-monitor.sh.pid to the postrotate-section of your logrotation-config. This is easiest done by just killing it or calling systemctl restart rvice. When the logfile gets rotated the script has to be aligned to the new file-handle. Whenever the script ends / is killed it is restarted. This will start the script monitoring /var/log/syslog. and activate it via systemctl daemon-reload, systemctl enable rvice and systemctl start rvice. ĭescription=Backup-Monitor for log-entries by QNAP / rsyslogĮxecStart=/usr/share/zabbix-scripts/qnap-backup-monitor.sh -file=/var/log/syslog Create systemd-serviceĬreate /etc/systemd/system/rvice. qnap-backup-monitor.sh -file=/var/log/syslog -import. If you want to import existing data to Zabbix call. Populate the Zabbix-hosts with existing data qnap-backup-monitor.sh -file=/var/log/syslog -hosts-to-create. To easy figure out the names of the hosts to be created you should call. Every QNAPHOST_BACKUPJOB needs to be a virtual Zabbix-host equiped with this template. Now download the template (template_qnap-backup-monitor.xml) and add it to your Zabbix via Configuration -> Templates -> Import. The QNAPHOST is grep'd from the logfile, while BACKUPJOB is one of the jobs you defined in the JOBS-array. The format of the first parameter is QNAPHOST_BACKUPJOB, whereby spaces are replaced by underscores. Every line reflect what would be sent via zabbix_sender to Zabbix. You should see lots of lines like TS251_Sync_to_TS212 status 1546432143 "started". qnap-backup-monitor.sh -file=/var/log/syslog -import -dryrun If this is not the case just start the jobs by hand. Make sure there are already jobs logged to the file.Assuming the file QNAP sends its log-messages to is /var/log/syslog the following is to be done: The job's names have to be exactly named as the jobs are named in QNAP Hybrid Backup Sync, as they are greb'd in the logfile.Īfter doing this I suggest to do a dry-run to check what would happen. You have to add the jobs you want to monitor to the JOBS-array in the beginning of qnap-backup-monitor.sh. qnap-backup-monitor.sh -help - I hate to document and I did it just for you! -) make it executable: chmod a+x qnap-backup-monitor.sh.download qnap-backup-monitor.sh and install it to you ExternalScripts-directory (zabbix_nf -> ExternalScripts).I expect other QNAP backup-tools to work as well this way, but they will need some change to the script in the case "$QNAPAPP" in-section. on the Zabbix-server and let QNAP use this as loghost, which is how I am doing it. One could do this on the QNAP-device itself or configure rsyslog e.g. So the only way to fetch a backup-job's status is by checking the logfiles. QNAP-devices aren't very verbose outside their own communication channels (e-mail, Skype, Facebook Messanger). Last finished backup time - string with the time, when last backup was finished.Current backup status - started, finished or error.When installed in your Zabbix-scripts-directory and after deploying the Template you may see the following data per backup job: Events will be reported via zabbix_sender to a given virtual Zabbix host (backup job). This is a Bash-script running in the background permanently checking a logfile for QNAP-events. So I installed Zabbix and started to play around with its extensions. So inside of me a wish was growing up: I wanted to have an overview over all the backup- and sync-processes I run during the day. It was about Christmas and I started to feel a little nerdy.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |