Nagios XI Backup
Posted: Thu Apr 01, 2021 1:08 pm
I ran into a problem yesterday when I went to take a backup before updating our Nagios XI install with the backup failing with a permissions error. This was particularly surprising because it is configured to take a scheduled backup every day, and to email on failures, and we had not gotten any emails for failures (until the one we got when the manual backup I ran failed). I tried running the backup script from command line and got the same error.
This was the backup output:
\nStarting new backup....\n
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up the SNMP directories
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up Nagvis...
tar: Removing leading `/' from member names
Backing up nagios user home dir...
tar: Removing leading `/' from member names
Backing up MySQL databases...
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
Backing up cronjobs for Apache...
Backing up logrotate config files...
Backing up Apache config files...
Compressing backup...
===============
BACKUP COMPLETE
===============
Backup stored in /store/backups/nagiosxi/1617216057.tar.gz
After a bit of digging, I granted the process permission to each of the three users the backup script appeared to be using to connect to the MySQL database, and then retried the backup script. It no longer encountered the mysqldump permissions error, however it still emailed that the backup failed, even though the closest thing to an error in the output was the warning messages about using passwords with the command line interface. What's even stranger, is that when the scheduled backup ran later that day, it did not send a failure email, even though the output from it was identical.
I'm a bit lost on why it does not seem to be sending the email on failure for the scheduled backup, why it is still sending the email for failure when run manually when it does not seem to be failing anymore, and why it started to or was getting the permissions error to begin with. Also on a side note, is the output from the backup script archived anywhere when the script runs or is it really just overwriting the same file every time? It would be nice to be able to go through an actual log to see when it started getting this error or if it was always getting it.
Any insight or guidance is appreciated.
This was the backup output:
\nStarting new backup....\n
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up the SNMP directories
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up Nagvis...
tar: Removing leading `/' from member names
Backing up nagios user home dir...
tar: Removing leading `/' from member names
Backing up MySQL databases...
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
Backing up cronjobs for Apache...
Backing up logrotate config files...
Backing up Apache config files...
Compressing backup...
===============
BACKUP COMPLETE
===============
Backup stored in /store/backups/nagiosxi/1617216057.tar.gz
After a bit of digging, I granted the process permission to each of the three users the backup script appeared to be using to connect to the MySQL database, and then retried the backup script. It no longer encountered the mysqldump permissions error, however it still emailed that the backup failed, even though the closest thing to an error in the output was the warning messages about using passwords with the command line interface. What's even stranger, is that when the scheduled backup ran later that day, it did not send a failure email, even though the output from it was identical.
I'm a bit lost on why it does not seem to be sending the email on failure for the scheduled backup, why it is still sending the email for failure when run manually when it does not seem to be failing anymore, and why it started to or was getting the permissions error to begin with. Also on a side note, is the output from the backup script archived anywhere when the script runs or is it really just overwriting the same file every time? It would be nice to be able to go through an actual log to see when it started getting this error or if it was always getting it.
Any insight or guidance is appreciated.