Page 4 of 4
Re: Scheduled Backups not running
Posted: Thu Jan 29, 2015 3:49 pm
by tgriep
Run these and post back the output.
Code: Select all
ll /usr/local/nagiosxi/scripts/
ll /usr/local/nagiosxi/
Re: Scheduled Backups not running
Posted: Thu Jan 29, 2015 4:16 pm
by krobertson71
First
Code: Select all
[nagios@nagiasp01 html]$ ll /usr/local/nagiosxi/scripts
total 528
-r-xr-x--- 1 nagios nagios 4696 Jan 5 14:53 backup_xi.sh
-r-xr-x--- 1 nagios nagios 1538 Jan 5 14:53 change_timezone.sh
-r--r----- 1 nagios nagios 2532 Jan 5 14:53 contact_notification_handler.php
-r-xr-x--- 1 nagios nagios 652 Jan 5 14:53 export_nagiosql.sh
-r-xr-x--- 1 nagios nagios 824 Jan 5 14:53 handle_nagioscore_event.php
-r-xr-x--- 1 nagios nagios 832 Jan 5 14:53 handle_nagioscore_notification.php
-r-xr-x--- 1 nagios nagios 432 Jan 5 14:53 import_nagiosql.sh
-r-xr-x--- 1 nagios nagios 908 Jan 5 14:53 import_xiconfig.php
-r-xr-x--- 1 nagios nagios 153 Jan 5 14:53 kill_rrdtool.sh
-r-xr-x--- 1 nagios nagios 1758 Jan 5 14:53 manage_services.sh
-rwxrwxr-x 1 nagios nagios 161 Jan 28 07:54 nagiosql.cookies
-rwxrwxr-x 1 nagios nagios 271780 Jan 5 14:53 nagiosql_defaults.sql
-rwxrwxr-x 1 nagios nagios 952 Jan 5 14:53 nagiosql_delete_contact.php
-rwxrwxr-x 1 nagios nagios 1991 Jan 5 14:53 nagiosql_delete_host.php
-rwxrwxr-x 1 nagios nagios 509 Jan 5 14:53 nagiosql_delete_object.sh
-rwxrwxr-x 1 nagios nagios 2846 Jan 5 14:53 nagiosql_delete_service.php
-rwxrwxr-x 1 nagios nagios 955 Jan 5 14:53 nagiosql_delete_timeperiod.php
-rwxrwxr-x 1 nagios nagios 1334 Jan 5 14:53 nagiosql_exportall.php
-rwxrwxr-x 1 nagios nagios 13346 Jan 28 07:54 nagiosql.export.monitoring
-rwxrwxr-x 1 nagios nagios 1333 Jan 5 14:53 nagiosql_importall.php
-rwxrwxr-x 1 nagios nagios 44125 Jan 28 07:54 nagiosql.import.monitoring
-rwxrwxr-x 1 nagios nagios 10401 Jan 28 07:54 nagiosql.login
-rwxrwxr-x 1 nagios nagios 1849 Jan 5 14:53 nagiosql_login.php
-rwxrwxr-x 1 nagios nagios 2246 Jan 5 14:53 nagiosql_snapshot.sh
-rwxrwxr-x 1 nagios nagios 262 Jan 5 14:53 nagiosql_trim_backups.sh
-r-xr-x--- 1 nagios nagios 519 Jan 5 14:53 nom_create_nagioscore_checkpoint_cond.sh
-r-xr-x--- 1 nagios nagios 826 Jan 5 14:53 nom_create_nagioscore_checkpoint.sh
-r-xr-x--- 1 nagios nagios 635 Jan 5 14:53 nom_create_nagioscore_errorpoint.sh
-r-xr-x--- 1 nagios nagios 788 Jan 5 14:53 nom_restore_nagioscore_checkpoint.sh
-r-xr-x--- 1 nagios nagios 839 Jan 5 14:53 nom_restore_nagioscore_checkpoint_specific.sh
-r-xr-x--- 1 nagios nagios 2972 Jan 5 14:53 nom_trim_nagioscore_checkpoints.sh
-r-xr-x--- 1 nagios nagios 4621 Jan 5 14:53 parse_core_eventlog.php
-r-xr-x--- 1 nagios nagios 6077 Jan 5 14:53 patch_ndoutils.php
-r-xr-x--- 1 nagios nagios 600 Jan 5 14:53 reconfigure_nagios.sh
-r-xr-x--- 1 nagios nagios 469 Jan 5 14:53 repair_databases.sh
-r-xr-x--- 1 nagios nagios 1157 Jan 5 14:53 repairmysql.sh
-r-sr-xr-x 1 root nagios 6846 Jan 5 14:53 reset_config_perms
-r--r----- 1 nagios nagios 280 Jan 5 14:53 reset_config_perms.c
-r-sr-xr-x 1 root nagios 1347 Jan 5 14:53 reset_config_perms.sh
-r-xr-x--- 1 nagios nagios 1155 Jan 5 14:53 reset_nagiosadmin_password.php
-r-xr-x--- 1 nagios nagios 1610 Jan 5 14:53 restart_nagios_with_export.sh
-r-xr-x--- 1 nagios nagios 765 Jan 5 14:53 restore_defaults.sh
-r-xr-x--- 1 nagios nagios 5731 Jan 5 14:53 restore_xi.sh
-r-xr-x--- 1 nagios nagios 1847 Jan 5 14:53 send_to_auditlog.php
-r--r----- 1 nagios nagios 2379 Jan 5 14:53 uninstall_xi.sh
-r-xr-x--- 1 nagios nagios 2348 Jan 5 14:53 upgrade_to_latest.sh
Second
Code: Select all
[nagios@nagiasp01 html]$ ll /usr/local/nagiosxi
total 32
drwxr-xr-x 2 nagios nagios 4096 Dec 19 14:18 cron
drwxr-xr-x 3 nagios nagios 4096 Dec 19 14:18 etc
drwxr-xr-x 18 nagios nagios 4096 Jan 29 14:50 html
drwxr-xr-x 3 nagios nagios 4096 Dec 19 14:18 nom
dr-xr-xr-x 2 nagios nagios 4096 Jan 16 01:00 scripts
drwsrwsr-x 3 nagios nagios 4096 Jan 22 15:25 tmp
drwxr-xr-x 2 nagios nagios 4096 Dec 19 14:18 tools
drwxr-xr-x 5 nagios nagios 4096 Jan 29 16:15 var
[nagios@nagiasp01 html]$
Re: Scheduled Backups not running
Posted: Thu Jan 29, 2015 4:32 pm
by tgriep
Run this command and try the backup again.
Code: Select all
chmod -R u+w /usr/local/nagiosxi/scripts
Re: Scheduled Backups not running
Posted: Thu Jan 29, 2015 5:34 pm
by krobertson71
It worked!
Code: Select all
[nagios@nagiasp01 var]$ tail -f cmdsubsys.log
............................................................tail: cmdsubsys.log: file truncated
PROCESSED 0 COMMANDS
tail: cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: cmdsubsys.log: file truncated
PROCESSED 0 COMMANDS
sxi.1422570001";i:1;s:9:"/backups/";}
CMDLINE=/usr/local/nagiosxi/scripts/backup_xi.sh -n nagiosxi.1422570001 -d /backups
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
tar: /usr/local/nagios/var/ndo.sock: socket ignored
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up MySQL databases...
Backing up PostgresQL databases...
Backing up logrotate config files...
Backing up Apache config files...
Compressing backup...
===============
BACKUP COMPLETE
===============
Backup stored in /backups/nagiosxi.1422570001.tar.gz
OUTPUT=Backup stored in /backups/nagiosxi.1422570001.tar.gz
RETURNCODE=0
..................tail: cmdsubsys.log: file truncated
PROCESSED 1 COMMANDS
tail: cmdsubsys.log: file truncated
PROCESSED 0 COMMANDS
Code: Select all
[nagios@nagiasp01 backups]$ ll -h
total 164M
drwx------ 2 root root 16K Jan 22 11:20 lost+found
-rw-r--r-- 1 nagios nagios 164M Jan 29 17:20 nagiosxi.1422570001.tar.gz
-rw-r--r-- 1 nagios users 0 Jan 26 18:21 test1
-rw-r--r-- 1 nagios users 0 Jan 26 18:21 test2
-rw-r--r-- 1 nagios users 0 Jan 28 14:58 test3
Assuming we made sure nagios user had write permissions to all files and sub-directories?
Can you explain what lead you to this and how this corrected the problem? I will need to document this. For whatever reason something was wrong after initial install or after an upgrade maybe?
Re: Scheduled Backups not running
Posted: Thu Jan 29, 2015 5:41 pm
by tgriep
This is what lead me to it.
tail -f cmdsubsys.log
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