Page 1 of 1

autoremove all files owned by user nagios

Posted: Tue Apr 10, 2012 3:00 am
by Martin Reniec
autoremove all files owned by user nagios

Hi,
we have problem on nagiosxi, one per week all files owned by nagios auto remove.
We disable autobackup script and restore in /usr/local/nagiosxi/scripts.
but still removed all files :(

help please :(

Re: autoremove all files owned by user nagios

Posted: Tue Apr 10, 2012 9:50 am
by scottwilkerson
I would check the crontab's on the machine it see what you have running at that particular time.

There isn't anything that I am aware of that auto removes all files owned by a particular user.

Is it everything, or just in a certain directory?

Re: autoremove all files owned by user nagios

Posted: Fri Apr 13, 2012 7:11 am
by Martin Reniec
crontab nagios user:

* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php > /usr/local/nagiosxi/var/sysstat.log 2>&1
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php > /usr/local/nagiosxi/var/cmdsubsys.log 2>&1
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php > /usr/local/nagiosxi/var/eventman.log 2>&1
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php > /usr/local/nagiosxi/var/feedproc.log 2>&1
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php > /usr/local/nagiosxi/var/perfdataproc.log 2>&1
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/nom.php > /usr/local/nagiosxi/var/nom.log 2>&1
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/reportengine.php > /usr/local/nagiosxi/var/reportengine.log 2>&1
*/5 * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/dbmaint.php > /usr/local/nagiosxi/var/dbmaint.log 2>&1
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/cleaner.php > /usr/local/nagiosxi/var/cleaner.log 2>&1
01 * * * * /usr/local/nagiosxi/cron/recurringdowntime.pl > /usr/local/nagiosxi/var/recurringdowntime.log 2>&1

crontab root user:

######################################
# Nagios XI Cron Jobs - Run as root
######################################
# Backup MySQL Databases (daily 7:00am w/ weekly and monthly rotations)
#0 7 * * * /root/scripts/automysqlbackup

# Backup Postgresql Databases (daily 8:00am w/ weekly and monthly rotations)
0 8 * * * /root/scripts/autopostgresqlbackup


directory leave but all files /home/nagios ..... remove :(

Re: autoremove all files owned by user nagios

Posted: Fri Apr 13, 2012 7:39 am
by scottwilkerson
it removes file in /home/nagios ?

Re: autoremove all files owned by user nagios

Posted: Thu Apr 26, 2012 7:40 am
by Martin Reniec
scottwilkerson wrote:it removes file in /home/nagios ?
yes

Re: autoremove all files owned by user nagios

Posted: Thu Apr 26, 2012 9:15 am
by mguthrie
There isn't anything in that directory that Nagios actually uses. The nagios user is set to nologin so it doesn't really even need that directory.