Page 1 of 2

nagios.log file stopped updating

Posted: Sun Jul 26, 2015 3:15 am
by zaji_nms
Dear Expert

while checking found @03:40 nagios.log stopped updating, how to fix?

pwd
/usr/local/nagios/var

-rw-r--r-- 1 nagios nagios 0 Jul 26 03:40 nagios.log <<<<<<< should update
-rw-r--r-- 1 nagios nagios 976895 Jul 26 11:01 nagios.log-20150726 <<<<<<<<< should stop updating


-rw-r--r-- 1 nagios nagios 2745343 Jul 26 11:01 npcd.log <<<<<<< updating (its okay)
-rw-r--r-- 1 nagios nagios 10327712 Jul 26 03:39 npcd.log-20150726 <<<<<<<<<<< stopped (its okay)

-rw-rw-rw- 1 nagios nagios 8961227 Jul 26 11:01 perfdata.log <<<<<<<< updating (its okay)
-rw-rw-rw- 1 nagios nagios 3709910 Jul 26 03:39 perfdata.log-20150726 <<<<<<<<<< stopped (its okay)


currently issue with nagios.log file, if same thing goes wrong with npcd.log , perfdata.log how to fix? (its additional info)

After posting this , I found there is some role of lock file , ndo2db.lock , nagios.lock ,, I don't know what was the last value but currently showing
more /usr/local/nagios/var/nagios.lock
20987

Our senior has fixed this issue but need some guidance from you , document so we can fix in future too without troubling to you/our senior.

-rw-r--r-- 1 nagios nagios 6 Jul 26 11:18 nagios.lock
-rw-r--r-- 1 nagios nagios 48657 Jul 26 11:44 nagios.log <<<<< now updating (it okay now)
-rw-r--r-- 1 nagios nagios 1010127 Jul 26 11:18 nagios.log-20150726 <<<<<< stopped updating (its okay now)


Regards

Re: nagios.log file stopped updating

Posted: Mon Jul 27, 2015 1:19 pm
by ssax
The lock file contains the PID, try restarting nagios:

Code: Select all

service nagios restart
If that happens with the others I would restart them as well.

Not sure how that could have occurred though, this is the first I've seen it.

Re: nagios.log file stopped updating

Posted: Tue Jul 28, 2015 1:11 am
by zaji_nms
Thanks ssax

as per your hint, checked and found he did => /etc/init.d/nagios restart

before closing, can you please explain what is difference between /etc/init.d/nagios restart AND service nagios restart

Regards

Re: nagios.log file stopped updating

Posted: Tue Jul 28, 2015 8:45 am
by tmcdonald
They are essentially the same thing. service just has some additional steps involved related to consistency:

http://stackoverflow.com/questions/2250 ... vice-start

Re: nagios.log file stopped updating

Posted: Sun Aug 02, 2015 3:32 am
by zaji_nms
Dear Expert

ls -l /usr/local/nagios/var | grep -i nagios.lo
-rw-r--r-- 1 nagios nagios 5 Jul 30 14:51 nagios.lock
-rw-r--r-- 1 nagios nagios 0 Aug 2 03:42 nagios.log
-rw-r--r-- 1 nagios nagios 969425 Aug 2 10:57 nagios.log-20150802

Today again it happened (new nagios.log file is 0 byte not updating), I did not do any service restart instead did Applied Configuration and okay. Looks it will happen again every week (Sunday). Why? Any solution?

-bash-4.1$ ls -l /usr/local/nagios/var | grep -i nagios.lo
-rw-r--r-- 1 nagios nagios 6 Aug 2 10:59 nagios.lock
-rw-r--r-- 1 nagios nagios 39734 Aug 2 11:20 nagios.log
-rw-r--r-- 1 nagios nagios 972031 Aug 2 10:59 nagios.log-20150802

merged two files (work around solution)

cat nagios.log-20150802 nagios.log > nagios.log
cat: nagios.log: input file is output file

Regards

Re: nagios.log file stopped updating

Posted: Mon Aug 03, 2015 10:09 am
by ssax
What specific version of XI are you running? You can grab it from the bottom left hand side of the XI web interface.

Re: nagios.log file stopped updating

Posted: Sun Aug 23, 2015 1:23 am
by zaji_nms
Dear ssax

Nagios XI 2014R2.0

Regards

Re: nagios.log file stopped updating

Posted: Mon Aug 24, 2015 9:38 am
by lmiltchev
Can you post the nagios.cfg?

Re: nagios.log file stopped updating

Posted: Mon Aug 24, 2015 9:42 am
by ssax
Do you have anything configured for nagios in /etc/logrotate.d or /etc/logrotate.conf? If so, please attach the files. Also, please attach a sanitized copy of your /usr/local/nagios/etc/nagios.cfg.

Re: nagios.log file stopped updating

Posted: Mon Aug 24, 2015 9:44 am
by tgriep
Could you run the following and post the output so we can get the settings for logging?

Code: Select all

 grep log /usr/local/nagios/etc/nagios.cfg