Page 2 of 6

Re: 2012 R1.6 : apply configuration doesn't work

Posted: Mon Mar 11, 2013 4:49 am
by Frédéric GRANAT
Hi,
I've got several files named cmdsubsys
cmdsubsys.log
cmdsubsys.log.1
cmdsubsys.log.2
cmdsubsys.log.3
cmdsubsys.log.4

I run "Apply configuration"
vi of first file : empty file

Other files :
...........................................................
PROCESSED 0 COMMANDS

Re: 2012 R1.6 : apply configuration doesn't work

Posted: Mon Mar 11, 2013 9:19 am
by slansing
Lets see if these files are empty, run the following:

Code: Select all

ls -la /usr/local/nagiosxi/var/ | grep subsys
Keep in mind we asked to see the tail of the files, not what they show when opened in an editor, these can provide different results :)

Re: 2012 R1.6 : apply configuration doesn't work

Posted: Mon Mar 11, 2013 11:14 am
by Frédéric GRANAT
Here it's

Code: Select all

-rw-r--r--  1 nagios nagios     0 Mar 11 17:13 cmdsubsys.log
-rw-r--r--  1 nagios nagios    82 Feb 24 04:03 cmdsubsys.log.1
-rw-r--r--  1 nagios nagios    82 Feb 17 04:03 cmdsubsys.log.2
-rw-r--r--  1 nagios nagios    81 Feb 10 04:03 cmdsubsys.log.3
-rw-r--r--  1 nagios nagios    82 Feb  3 04:03 cmdsubsys.log.4

Re: 2012 R1.6 : apply configuration doesn't work

Posted: Mon Mar 11, 2013 11:35 am
by abrist
Is crond running? Do a running tail on /var/log/cron and then try killing all cron instances and restart it. Send the tail back.

Code: Select all

tail -f /var/log/cron
service crond stop
ps -aef | grep crond
killall crond
service crond start

Re: 2012 R1.6 : apply configuration doesn't work

Posted: Mon Mar 11, 2013 12:19 pm
by Frédéric GRANAT
Do a running tail on /var/log/cron Send the tail back.

Code: Select all

[root@nagiosxi var]# tail -f /var/log/cron
Mar 11 18:16:01 nagiosxi crond[3328]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/cleaner.php > /usr/local/nagiosxi/var/cleaner.log 2>&1)
Mar 11 18:16:01 nagiosxi crond[3329]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/reportengine.php > /usr/local/nagiosxi/var/reportengine.log 2>&1)
Mar 11 18:16:01 nagiosxi crond[3332]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/nom.php > /usr/local/nagiosxi/var/nom.log 2>&1)
Mar 11 18:16:01 nagiosxi crond[3334]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php > /usr/local/nagiosxi/var/perfdataproc.log 2>&1)
Mar 11 18:16:01 nagiosxi crond[3336]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php > /usr/local/nagiosxi/var/eventman.log 2>&1)
Mar 11 18:16:01 nagiosxi crond[3337]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php > /usr/local/nagiosxi/var/feedproc.log 2>&1)
Mar 11 18:16:01 nagiosxi crond[3338]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php > /usr/local/nagiosxi/var/cmdsubsys.log 2>&1)
Mar 11 18:16:02 nagiosxi crond[3346]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php > /usr/local/nagiosxi/var/sysstat.log 2>&1)
Mar 11 18:16:02 nagiosxi crond[3348]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/cmdsubsys.php > /usr/local/nagiosfusion/var/cmdsubsys.log 2>&1)
Mar 11 18:16:02 nagiosxi crond[3356]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosfusion/cron/eventman.php > /usr/local/nagiosfusion/var/eventman.log 2>&1)
and then try killing all cron instances and restart it.
=> How can I do to kill all cron instances ?

Code: Select all

[root@nagiosxi var]# killall crond
crond: no process killed

Re: 2012 R1.6 : apply configuration doesn't work

Posted: Mon Mar 11, 2013 12:25 pm
by abrist
If you stopped the crond service and the "killall" command "reports no process killed", this means that crond was functioning normally (no orphaned procs or multiple crond parent instances). Remember to restart crond:

Code: Select all

service crond start
After the crond restart, are things functioning normally?

Re: 2012 R1.6 : apply configuration doesn't work

Posted: Tue Mar 12, 2013 2:36 am
by Frédéric GRANAT
Unfortunately not

Aditional information : System status show many components off since the upgrade (see the attached file).
And when trying to restart nagios :

Code: Select all

> service nagios restart
Running configuration check... CONFIG ERROR!  Restart aborted.  Check your Nagios configuration.

Rgds

Re: 2012 R1.6 : apply configuration doesn't work

Posted: Tue Mar 12, 2013 9:14 am
by mguthrie
Can you post the contents of the following file?
/etc/cron.d/nagiosxi

And also run

Code: Select all

chown nagios.nagios /usr/local/nagiosxi/var/*.log
service crond restart

Re: 2012 R1.6 : apply configuration doesn't work

Posted: Tue Mar 12, 2013 10:07 am
by Frédéric GRANAT

Code: Select all

# /etc/cron.d/nagiosxi: crontab fragment for nagiosxi

# Backup MySQL & PostgreSQL Databases
0   7 * * * root   /root/scripts/automysqlbackup
0   8 * * * root   /root/scripts/autopostgresqlbackup

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

Code: Select all

chown nagios.nagios /usr/local/nagiosxi/var/*.log
service crond restart
=> Done and doesn't solve the problem

Re: 2012 R1.6 : apply configuration doesn't work

Posted: Tue Mar 12, 2013 10:24 am
by mguthrie
Can you post the output from the following command:

Code: Select all

su nagios -c '/usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php'