nagios.log file stopped updating

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

nagios.log file stopped updating

Post 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
Zajil NMS
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: nagios.log file stopped updating

Post 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.
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: nagios.log file stopped updating

Post 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
Zajil NMS
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: nagios.log file stopped updating

Post 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
Former Nagios employee
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: nagios.log file stopped updating

Post 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
Zajil NMS
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: nagios.log file stopped updating

Post 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.
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: nagios.log file stopped updating

Post by zaji_nms »

Dear ssax

Nagios XI 2014R2.0

Regards
Zajil NMS
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: nagios.log file stopped updating

Post by lmiltchev »

Can you post the nagios.cfg?
Be sure to check out our Knowledgebase for helpful articles and solutions!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: nagios.log file stopped updating

Post 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.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: nagios.log file stopped updating

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked