Page 2 of 3
Re: Problems with scheduled backups
Posted: Wed Jun 06, 2018 2:08 pm
by scottwilkerson
smersh wrote:Thanks, I'll do that,
But my system is in production, won't the new php file affect it?
NJ
Having an incorrect timezone is already affecting it adversely.
I would place the new file and restart httpd asap to get to a working system
Re: Problems with scheduled backups
Posted: Wed Jun 06, 2018 2:26 pm
by smersh
Actually I see no any problems with my system except scheduled backups.
Anyways I'll proceed right now.
Re: Problems with scheduled backups
Posted: Wed Jun 06, 2018 2:31 pm
by scottwilkerson
Let us know if you have any issues
Re: Problems with scheduled backups
Posted: Wed Jun 06, 2018 3:32 pm
by smersh
Ok, here we are.
This is the setup:
Schedule.PNG
#echo "select * from xi_options where name='scheduled_local_backups';" | mysql -uroot -pnagiosxi -nagiosxi
option_id name value
97 scheduled_local_backups a:9:{s:6:"active";i:1;s:4:"freq";s:5:"daily";s:3:"day";s:1:"6";s:5:"hours";s:2:"00";s:4:"mins";s:2:"10";s:3:"dir";s:23:"/store/backups/nagiosxi";s:5:"limit";s:1:"7";s:7:"lastrun";i:1528315800;s:7:"nextrun";i:1528402200;}
/usr/local/nagiosxi/var/components/scheduledbackups.log:
]
06-02-2018 17:00:02 DEBUG: Running scheduled local backup ....
06-02-2018 17:00:02 INFO: Creating a local backup: nagiosxi.1527944402
06-02-2018 17:00:02 DEBUG: Sending create local backup command to CmdSubsystem
06-05-2018 22:00:02 DEBUG: Running scheduled local backup ....
06-05-2018 22:00:02 INFO: Creating a local backup: nagiosxi.1528221602
06-05-2018 22:00:02 DEBUG: Sending create local backup command to CmdSubsystem
06-06-2018 22:00:02 DEBUG: Running scheduled local backup ....
06-06-2018 22:00:02 INFO: Creating a local backup: nagiosxi.1528308002
06-06-2018 22:00:02 DEBUG: Sending create local backup command to CmdSubsystem
06-07-2018 00:10:01 DEBUG: Running scheduled local backup ....
06-07-2018 00:10:01 INFO: Creating a local backup: nagiosxi.1528315801
06-07-2018 00:10:01 DEBUG: Sending create local backup command to CmdSubsystem
audit.log: (this is from the file, not from the web interface)
2018-06-06 23:28:19 - Nagios XI [32] nagiosadmin:10.171.0.10 - The command_id is 2608
2018-06-07 00:10:01 - Nagios XI [32] system:localhost - User submitted a command to the subsystem (ID=1117)
2018-06-07 00:10:01 - Nagios XI [32] system:localhost - For the SQL command INSERT INTO xi_commands (submitter_id,command,command_data,event_time,submission_time,status_code) VALUES ('0','1117','a:2:{i:0;s:19:"nagiosxi.1528315801";i:1;s:23:"/store/backups/nagiosxi";}',NOW(),NOW(),'0')
2018-06-07 00:10:01 - Nagios XI [32] system:localhost - The returned value ($rs)is ADORecordSet_empty Object
(
[dataProvider] => empty
[databaseType] =>
[EOF] => 1
[_numOfRows] => 0
[fields] =>
[connection] =>
)
2018-06-07 00:10:01 - Nagios XI [32] system:localhost - The command_id is 2609
Re: Problems with scheduled backups
Posted: Wed Jun 06, 2018 3:37 pm
by scottwilkerson
Can you run
and post the results.
Thanks
looking for a nagiosxi.1528315801.tar.gz or a nagiosxi.1528315801 folder
Re: Problems with scheduled backups
Posted: Wed Jun 06, 2018 3:51 pm
by smersh
Here it is:
total 7750660
drwxr-xr-x. 2 nagios nagios 236 Jun 6 23:40 .
drwxr-xr-x. 4 root root 35 Jan 17 22:37 ..
-rw-r--r-- 1 nagios nagios 1277427418 Jun 1 19:29 1527866395.tar.gz
-rw-r--r-- 1 nagios nagios 1316184816 Jun 6 23:40 1528313299.tar.gz
-rw-r--r-- 1 nagios nagios 739892069 Mar 31 00:06 autoupgrade_backup.1522439870.tar.gz
-rw-r--r-- 1 nagios nagios 986764382 Apr 28 11:36 nagiosxi.1524900481.tar.gz
-rw-r--r-- 1 nagios nagios 1084237136 May 7 02:08 nagiosxi.1525644001.tar.gz
-rw-r--r-- 1 nagios nagios 1247325576 May 28 18:54 nagiosxi.1527518582.tar.gz
-rw-r--r-- 1 nagios nagios 1284831850 Jun 2 14:30 nagiosxi.1527934802.tar.gz
Backup from Jun 6 23:40 is created manually.
cmdsubsys.log contsains an unusual line:
PROCESSED 0 COMMANDS
PHP Warning: require_once(/usr/local/nagiosxi/html/includes/utils-commands.inc.php): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/utils.inc.php on line 16
However, there is no timestamp and I'm not sure if it's correlated. But it may help.
UPD: Looks like the above happened just after copying the utils-commands.inc.php file before I fixed the permissions.
Regards!
NJ
Re: Problems with scheduled backups
Posted: Wed Jun 06, 2018 4:00 pm
by scottwilkerson
Oh that is strange, run the following please
Code: Select all
ls -l /usr/local/nagiosxi/html/includes/utils-commands.inc.php
also the following
Code: Select all
grep nag /etc/group
chage -l nagios
Re: Problems with scheduled backups
Posted: Wed Jun 06, 2018 4:08 pm
by smersh
Looks like the problem with permissions happened just after copying the utils-commands.inc.php file before I fixed the permissions.
scottwilkerson wrote:Oh that is strange, run the following please
Code: Select all
ls -l /usr/local/nagiosxi/html/includes/utils-commands.inc.php
-rwxr-x--- 1 nagios nagios 37413 Jun 6 22:39 /usr/local/nagiosxi/html/includes/utils-commands.inc.php
scottwilkerson wrote:also the following
Code: Select all
grep nag /etc/group
chage -l nagios
nagios

1001:nagios,apache
nagcmd

1002:nagios,apache
Last password change : Jan 17, 2018
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
Re: Problems with scheduled backups
Posted: Wed Jun 06, 2018 4:52 pm
by scottwilkerson
could you PM your whole /usr/local/nagiosxi/var/cmdsubsys.log to see if we can discover any more about what happened to command 2609
thanks
Re: Problems with scheduled backups
Posted: Mon Jun 11, 2018 1:02 pm
by smersh
Hello,
Did you check the file you've requested? Anything wrong there?
Regards
NJ