Nagios XI Backup intermittent failure - Ticket Re-open

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nms
Posts: 222
Joined: Wed Sep 28, 2016 9:35 am

Nagios XI Backup intermittent failure - Ticket Re-open

Post by nms »

Hi,

I am re-opening ticket Nagios XI Backup intermittent failure since we are still experiencing issues.

As a summary, we are backing up Nagios using the default script:

Code: Select all

/usr/local/nagiosxi/scripts/backup_xi.sh
Sometimes we end up with an error for the Mysql Nagios password:

Code: Select all

Backing up MySQL databases...
Error backing up MySQL database 'nagios' - check the password in this script!
The backup is done daily at 04:00 GMT+1.

In the ticket, I was told that I might have crashed tables in the database in which I ran

Code: Select all

/usr/local/nagiosxi/scripts/repair_databases.sh
to try and solve the issue.

However, at some point in time, I received the password failure again.

Note that this happens intermittently not every day.

Nagios XI version is currently 5.4.13 running on CentOS 6.10
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagios XI Backup intermittent failure - Ticket Re-open

Post by benjaminsmith »

Hi @nms,

Looks like the problem is recurring, have you checked the available disk space on this server?

Code: Select all

df -h
If you're running out of the space this could be causing the backup to fail along with the crashed database tables.

Also, did you change the default passwords for the database?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
nms
Posts: 222
Joined: Wed Sep 28, 2016 9:35 am

Re: Nagios XI Backup intermittent failure - Ticket Re-open

Post by nms »

Hi Benjamin,

The disk is fine, I have only 53% usage so far.
As the password, there aren't any changes done.

Rgds,

Matt
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagios XI Backup intermittent failure - Ticket Re-open

Post by benjaminsmith »

Hi @nms

The most common cause of the backup failing is usually database corruption, let's run the following to repair the databases again:

Code: Select all

mysqlcheck -r -f -uroot -pnagiosxi --all-databases	
Next, go the Admin > System Backups >Local Backup Archives and run the following command to monitor the process and then Create Backup.
Please take a screen shot or post any errors to this thread.

Code: Select all

tail /usr/local/nagiosxi/var/cmdsubsys.log -f
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
nms
Posts: 222
Joined: Wed Sep 28, 2016 9:35 am

Re: Nagios XI Backup intermittent failure - Ticket Re-open

Post by nms »

Hi,

I ran the mysql check in which I did not encounter any issues at all (see attached file).

After I ran the backup from the GUI, while checking the cmdsubsys.log file i noticed that it processed the command to start the backup but after a while I saw 0 processed commands:

Code: Select all

[root@am1nms-nagiosxi output]# tail /usr/local/nagiosxi/var/cmdsubsys.log -f
    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

sudo: no tty present and no askpass program specified
OUTPUT=
RETURNCODE=1
.
PROCESSED 1 COMMANDS
...........................................................
PROCESSED 0 COMMANDS
............................................................
PROCESSED 0 COMMANDS
..................................PROCESSING COMMAND ID 33274...
PROCESS COMMAND: CMD=1117, DATA=
CMDLINE=sudo /usr/local/nagiosxi/scripts/backup_xi.sh
sudo: no tty present and no askpass program specified
OUTPUT=
RETURNCODE=1
.PROCESSING COMMAND ID 33275...
PROCESS COMMAND: CMD=1117, DATA=
CMDLINE=sudo /usr/local/nagiosxi/scripts/backup_xi.sh
sudo: no tty present and no askpass program specified
OUTPUT=
RETURNCODE=1
.PROCESSING COMMAND ID 33276...
PROCESS COMMAND: CMD=1117, DATA=
CMDLINE=sudo /usr/local/nagiosxi/scripts/backup_xi.sh
sudo: no tty present and no askpass program specified
OUTPUT=
RETURNCODE=1
.......................
PROCESSED 3 COMMANDS
............................................................
PROCESSED 0 COMMANDS
............................................................
PROCESSED 0 COMMANDS
...........................................................
PROCESSED 0 COMMANDS
............................................................
PROCESSED 0 COMMANDS
.............................................................
PROCESSED 0 COMMANDS
.................................^C
Then I checked if at least the backup was running, which wasn't:

Code: Select all

root@am1nms-nagiosxi backups]# ps -ef | grep backup_xi
root     12814   384  0 12:06 pts/1    00:00:00 grep backup_xi
Also, the folder nagiosxi was not created in /store/backups, could be that the backup process did not run

Code: Select all

[root@am1nms-nagiosxi backups]# cd /store/backups/nagiosxi
-bash: cd: /store/backups/nagiosxi: No such file or directory
During this week, the automatic backup I do daily (i.e. using the same script but placed in crontab) failed one time, in which when I ran it again there was no issue. I changed also the scheduled time from 04:00 to 05:00 GMT+1.

Rgds,

Matt
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagios XI Backup intermittent failure - Ticket Re-open

Post by benjaminsmith »

Hi @nms,

It looks like you have missing or incorrect sudoers entries:

Code: Select all

CMDLINE=sudo /usr/local/nagiosxi/scripts/backup_xi.sh
sudo: no tty present and no askpass program specified
Please follow the steps (Fixing the sudoers Entries) in the following guide to correct this:
https://support.nagios.com/kb/article.p ... ategory=44

Then restart, and try to run a backup.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
nms
Posts: 222
Joined: Wed Sep 28, 2016 9:35 am

Re: Nagios XI Backup intermittent failure - Ticket Re-open

Post by nms »

Hi,
Then restart, and try to run a backup.
Restart as restarting nagios right?

Rgds,

Matt
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagios XI Backup intermittent failure - Ticket Re-open

Post by benjaminsmith »

Hello @nms,

Yes. Follow the instructions in the guide then go to Configure > CCM > Apply Configuration.

Let me know if you're able to get it resolved.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked