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
nagios.log file stopped updating
nagios.log file stopped updating
Zajil NMS
Re: nagios.log file stopped updating
The lock file contains the PID, try restarting nagios:
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.
Code: Select all
service nagios restartNot sure how that could have occurred though, this is the first I've seen it.
Re: nagios.log file stopped updating
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
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
Re: nagios.log file stopped updating
They are essentially the same thing. service just has some additional steps involved related to consistency:
http://stackoverflow.com/questions/2250 ... vice-start
http://stackoverflow.com/questions/2250 ... vice-start
Former Nagios employee
Re: nagios.log file stopped updating
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
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
Re: nagios.log file stopped updating
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
Can you post the nagios.cfg?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: nagios.log file stopped updating
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
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.cfgBe sure to check out our Knowledgebase for helpful articles and solutions!