I need to automate getting data about the correctness of creating copies of mysql backups. Those. exclude null sizes, damaged files, etc. And then output the answer in zabbix , for example, 0 or 1. I make dumps using mysqldump , using bash- script.

  • specify the question, please: specify what you already have, and with what exactly the problems arose. - aleksandr barakin
  • There is a script that makes a dump. I want to make sure that backups are obtained without problems. I want to check the integrity of the archive, the presence of its size is more than 100 kb (for example), and if everything is OK, write it to the file, and then transfer it to zabbiks. If the dump is not there, it is damaged, or it weighs a little to receive 0. - James M
  • How do you check “archive integrity”? - aleksandr barakin
  • Try to pour the resulting backup to another machine. - azalio
  • You can check the integrity using archiver tools, zcat for example. - James M

1 answer 1

As an option:

  1. On the server side, a bash script that checks the validity of the dump and returns 1 or 0

  2. In the zabbix client, issue a separate UserParameter with an item that returns 1 or 0

eg:

 UserParameter=checkIntegrity,/path/to/bash-script.sh 

in the simplest case: 1 - everything is fine, 0 - everything is bad

  1. Zabbix server add item and trigger with your logic