Page 1 of 1

Nagios Full Backup failed to completed

Posted: Fri Oct 16, 2020 8:02 am
by joash0809
Hi Nagios Support Team,

We recently discovered that the daily nagios backup has not been generating the Gzip files in /store/backups/nagiosxi directory. The error message received when we manually ran the backup_xi.sh script.

Backing up MySQL databases...
mysqldump: Got error: 1066: "Not unique table/alias: 'tbl_lnkcontactgrouptocontact'" when using LOCK TABLES
Error backing up MySQL database 'nagiosql' - check the password in this script!

However when we tested to login to the database with the credentials we have, it was successful.

Can you kindly advise what could have possibly caused this issue.

Re: Nagios Full Backup failed to completed

Posted: Fri Oct 16, 2020 3:03 pm
by tgriep
Some of the mysql messages are a bit confusing but it could be caused by a corrupt mysql tables so run the following as root to repair it.

Code: Select all

mysqlcheck -f -r -u root -pnagiosxi --all-databases --use-frm
If you still get the error, Open a root shell on the Nagios server and run the following commands. Get the /tmp/info.txt file and upload it to the post.

Code: Select all

mysql -u root -pnagiosxi -e "show global status like '%used_connections%'; show variables like 'max_connections';" >/tmp/info.txt
echo "SELECT table_schema as 'Database', table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES ORDER BY (data_length + index_length) DESC;" |mysql -t -u root -pnagiosxi >>/tmp/info.txt
echo 'desc tbl_lnkcontactgrouptocontact;' |mysql -t -u root -pnagiosxi  >>/tmp/info.txt