Page 3 of 4

Re: Scheduled Backups not running

Posted: Wed Jan 28, 2015 3:45 pm
by lmiltchev
Do you have the following log on your system - "/usr/local/nagiosxi/var/components/scheduledbackups.log"? If you do, can you post it?

Re: Scheduled Backups not running

Posted: Wed Jan 28, 2015 6:44 pm
by krobertson71
Here are the last 3 lines from earlier when you had me make those change and schedule a backup right after:

01-28-2015 15:15:01 DEBUG: Running scheduled local backup ...
01-28-2015 15:15:01 INFO: Creating a local backup: nagiosxi.1422476101
01-28-2015 15:15:01 DEBUG: Sending create local backup command to CmdSubsystem


Entire log attached.

Re: Scheduled Backups not running

Posted: Thu Jan 29, 2015 10:40 am
by tgriep
Could you run this and post the output?

Code: Select all

find / -name nagiosxi.*

Re: Scheduled Backups not running

Posted: Thu Jan 29, 2015 12:59 pm
by krobertson71
Here you go. There is only one hit you will see for a backup but it is dated Jan 16th. It is located in /tmp/nagiosxibackups/. I think this was a manual test by another teammate but not sure. No results from our testing was found.

Code: Select all

[nagios@nagiasp01 tmp]$ cat search.txt
/usr/local/nagiosxi/html/includes/css/nagiosxi.css
/usr/local/nagiosxi/tmp/nagiosxi/vmsetup/profile.d/nagiosxi.sh
/usr/local/nagiosxi/tmp/nagiosxi/vmsetup/profile.d/nagiosxi.csh
/usr/local/nagiosxi/tmp/nagiosxi/nagiosxi/nagiosxi.sudoers
/usr/local/nagiosxi/tmp/nagiosxi/nagiosxi/nagiosxi.init
/usr/local/nagiosxi/tmp/nagiosxi/nagiosxi/basedir/html/includes/css/nagiosxi.css
/usr/local/nagiosxi/tmp/nagiosxi/nagiosxi/nagiosxi.cron.d
/tmp/nagiosxi/nagiosxi/nagiosxi.init
/tmp/nagiosxi/nagiosxi/basedir/html/includes/css/nagiosxi.css
/tmp/nagiosxi/nagiosxi/nagiosxi.sudoers
/tmp/nagiosxi/nagiosxi/nagiosxi.cron.d
/tmp/nagiosxi/vmsetup/profile.d/nagiosxi.csh
/tmp/nagiosxi/vmsetup/profile.d/nagiosxi.sh
/tmp/nagiosbackup/nagiosxi.1421388001
/tmp/nagiosbackup/nagiosxi.1421388001/nagiosxi.tar.gz
/home/nagios/nagiosxi.1420524001.tar.gz
/etc/httpd/conf.d/nagiosxi.conf

Re: Scheduled Backups not running

Posted: Thu Jan 29, 2015 1:21 pm
by tgriep
Run this.

Code: Select all

 tail -f /usr/local/nagiosxi/var/cmdsubsys.log
Schedule a backup to happen a few minutes in the future and wait for that time to pass.

Post back the results of the tail.

Re: Scheduled Backups not running

Posted: Thu Jan 29, 2015 2:43 pm
by krobertson71
Here you go. I am going to look at the scripts directory and see what might be going on. Please let me know what I can do to correct this.

Code: Select all

[nagios@nagiasp01 var]$ tail -f cmdsubsys.log
..................................
PROCESSED 0 COMMANDS
tail: cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
tail: cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
tail: cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: cmdsubsys.log: file truncated
............................................................tail: cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
tail: cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
sxi.1422560401";i:1;s:9:"/backups/";}
CMDLINE=/usr/local/nagiosxi/scripts/backup_xi.sh -n nagiosxi.1422560401 -d /backups
/usr/local/nagiosxi/scripts/backup_xi.sh: line 6: /usr/local/nagiosxi/scripts/config.dat: Permission denied
/usr/local/nagiosxi/scripts/backup_xi.sh: line 7: /usr/local/nagiosxi/scripts/config.dat: No such file or directory
OUTPUT=
RETURNCODE=1
...........................................................tail: cmdsubsys.log: file truncated

PROCESSED 1 COMMANDS
tail: cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS


Re: Scheduled Backups not running

Posted: Thu Jan 29, 2015 2:53 pm
by krobertson71
Here is the code snippit it is complaining about

Code: Select all

#!/bin/sh

BASEDIR=$(dirname $0)

# IMPORT ALL XI CFG VARS
php $BASEDIR/import_xiconfig.php > $BASEDIR/config.dat
. $BASEDIR/config.dat
rm -rf $BASEDIR/config.dat
I have checked all directories involved in nagiosxi and they are all owned by nagios nagios.

I have check the files mentioned above. import_xiconfig.php is owned by nagios nagios but config.dat did not exist, but I dont think it was supposed to as it seems to be removed right after.

Looked into the import_xiconfig.php and saw the reference to /usr/local/nagiosxi/html/config.inc.php and it is also owned by nagios nagios.

So the permission denied is confusing me.

Re: Scheduled Backups not running

Posted: Thu Jan 29, 2015 3:19 pm
by cmerchant
What do you have for groups defined?

run this:

Code: Select all

groups nagios
groups apache
and what is the output of this command:

Code: Select all

ll /usr/local/nagiosxi/scripts/import_xiconfig.php

Re: Scheduled Backups not running

Posted: Thu Jan 29, 2015 3:32 pm
by krobertson71
Here you go.

Code: Select all

[nagios@nagiasp01 html]$ groups nagios
nagios : users nagios nagcmd
[nagios@nagiasp01 html]$ groups apache
apache : apache nagios nagcmd
[nagios@nagiasp01 html]$ ll /usr/local/nagiosxi/scripts/import_xiconfig.php 
-r-xr-x--- 1 nagios nagios 908 Jan  5 14:53 /usr/local/nagiosxi/scripts/import_xiconfig.php
[nagios@nagiasp01 html]$ 


Re: Scheduled Backups not running

Posted: Thu Jan 29, 2015 3:34 pm
by krobertson71
Here is nagcmd for good measure.

Code: Select all

[nagios@nagiasp01 html]$ cat /etc/group | grep nagcmd
nagcmd:x:10004:nagios,apache