Page 2 of 3
Re: Offloading MySQL & xi-sys.cfg
Posted: Thu Dec 14, 2017 12:59 pm
by andyb4u
Apologies. Here you go:
Commands 3.JPG
A local backup completes in 10 mins. I've watched the cmdsubsys.log file at the time of the schedule when it hasn't worked. It doesn't actually fire the cron command to run the backup and no local files created in /store/backups/nagiosxi. I've watched a successful run and I can see the cron command being fired and the local files being created before copied via ssh.
Re: Offloading MySQL & xi-sys.cfg
Posted: Thu Dec 14, 2017 4:42 pm
by npolovenko
@andyb4u, Please delete all the backups from the /store/backups/nagiosxi/ folder, or move them to another folder, for now. In the "Scheduled Backups" menu please click on the local backups tab, click on test permission, check the location, change the scheduled backup time, click on enable local backups and click on Update Settings. The goal here is to see whether local
scheduled backups are still working with their original settings.
After the scheduled backup time is due, give it another hour and then run the ls -l on the /store/backups/nagiosxi/ folder one more time. Please share the screenshot.
Re: Offloading MySQL & xi-sys.cfg
Posted: Fri Dec 15, 2017 4:08 am
by andyb4u
I've done those steps and here is the result
ls -l backups.JPG
It hasn't run successfully.
Tail from the scheduledbackups.log file
12-15-2017 07:40:01 INFO: Creating a local backup: nagiosxi.1513323601
12-15-2017 07:40:01 DEBUG: Sending create local backup command to CmdSubsystem
Nothing in cmdsubsys around the time of the schedule.
Re: Offloading MySQL & xi-sys.cfg
Posted: Fri Dec 15, 2017 11:03 am
by npolovenko
@andyb4u, Can you go to the admin menu, then click on System information, then Audit log. Can you upload a screenshot of the audit log entries after the scheduled backup was supposed to run? Also, if you haven't upgraded XI to the latest version please do so. There were a few bug fixes related to scheduled backups.
Re: Offloading MySQL & xi-sys.cfg
Posted: Fri Dec 15, 2017 3:04 pm
by andyb4u
schedlocal.JPG
auditlog.JPG
We are up to date running Nagios XI (5.4.11).
Re: Offloading MySQL & xi-sys.cfg
Posted: Fri Dec 15, 2017 3:49 pm
by tgriep
Can you run the following commands and post the output?
Code: Select all
echo 'desc xi_commands;' |mysql -t -u root -pnagiosxi nagiosxi
echo 'select * from xi_commands;' |mysql -t -u root -pnagiosxi nagiosxi
This will show us if the backup job was put in to the MYSQL commands table and the layout of the table.
Thanks
Re: Offloading MySQL & xi-sys.cfg
Posted: Sat Dec 16, 2017 7:03 am
by andyb4u
This mornings backups failed:
all_scheduled_backups.JPG
Scheduledbackups.log
12-16-2017 05:30:01 DEBUG: Running scheduled SSH backup ...
12-16-2017 05:30:01 DEBUG: Sending create local backup command to CmdSubsystem
12-16-2017 07:11:16 ERROR: Scheduled SSH Backup Failed: Local file to transfer does not exist
12-16-2017 07:40:02 DEBUG: Running scheduled local backup ...
12-16-2017 07:40:02 INFO: Creating a local backup: nagiosxi.1513410002
12-16-2017 07:40:02 DEBUG: Sending create local backup command to CmdSubsystem
I've attached the results of the 2 MYSQL queries.
The only entry I can see in cmdsubsys.log
...............PROCESSING COMMAND ID 37056...
PROCESS COMMAND: CMD=1119, DATA=a:2:{i:0;s:19:"nagiosxi.1513402201";i:1;s:24:"/store/backups/nagiosxi/";}
CMDLINE=rm -rf /store/backups/nagiosxi/nagiosxi.1513402201.tar.gz
OUTPUT=
RETURNCODE=0
..............................................
PROCESSED 1 COMMANDS
Re: Offloading MySQL & xi-sys.cfg
Posted: Mon Dec 18, 2017 3:37 pm
by tgriep
What OS and release is the MYSQL server running?
What version of MYSQl or MariaDB is the remote server running?
Can you post the MYSQL configuration files from the server?
The /etc/my.cnf file and all of the files in the /etc/my.cnf.d folder if they exist.
Is the time and time zone settings setup on the MYSQL server and do they match the XI server?
Then run the following to repair the mysql database.
Code: Select all
mysqlcheck -f -r -u nagiosxi -pnagios --use_frm --database nagiosxi -h xxx.xxx.xxx.xxx
Run the following command and post the /tmp/nagiosxi.txt file so we can check and see if all of the tables were created correctly.
Code: Select all
mysqldump --no-data --databases nagiosxi -u nagiosxi -pnagios -h xxx.xxx.xxx.xxx >/tmp/nagiosxi.txt
Replace xxx.xxx.xxx.xxx with the IP address of the MYSQL server.
The repair of the database may fix the issue so wait until the next scheduled time to see if the backup runs.
Re: Offloading MySQL & xi-sys.cfg
Posted: Tue Dec 19, 2017 6:38 am
by andyb4u
What OS and release is the MYSQL server running?
Red Hat Enterprise Linux Server 7.4 (Maipo)
What version of MYSQl or MariaDB is the remote server running?
5.5.56-MariaDB MariaDB Server
Can you post the MYSQL configuration files from the server?
/etc/my.cnf
Code: Select all
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
max_allowed_packet=512M
bind-address=[i]xxx.xxx.xxx.xxx[/i]
port=3306
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
Files in /etc/my.cnf.d
client.cnf
Code: Select all
#
# These two groups are read by the client library
# Use it for options that affect all clients, but not the server
#
[client]
# This group is not read by mysql client library,
# If you use the same .cnf file for MySQL and MariaDB,
# use it for MariaDB-only client options
[client-mariadb]
mysql-clients.cnf
Code: Select all
#
# These groups are read by MariaDB command-line tools
# Use it for options that affect only one utility
#
[mysql]
[mysql_upgrade]
[mysqladmin]
[mysqlbinlog]
[mysqlcheck]
[mysqldump]
[mysqlimport]
[mysqlshow]
[mysqlslap]
server.cnf
Code: Select all
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
[mariadb-5.5]
The result of the running the MySQL repair command:
SQL Repair Command - Live -Redacted.JPG
The mysql dump output is attached.
I set a schedule and sat and watched it. The same thing happened where it didn't fire the command and no backup was generated.
Re: Offloading MySQL & xi-sys.cfg
Posted: Tue Dec 19, 2017 3:53 pm
by tgriep
I talked with one of the developers and they said to login to the XI GUI as another Administrator and submit a new backup job.
It could be that the user ID is corrupted somehow and it may work with another user.
Also, I would like to see the /etc/sudoers file so can you post it here?