Error: Cannot open log file for reading

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Perintis
Posts: 11
Joined: Tue Feb 19, 2013 5:01 am

Error: Cannot open log file for reading

Post by Perintis »

Hi,

Could you help me for "Error: Cannot open log file '/usr/local/nagios/var/archives/nagios-xx-xx-xx.log' for reading!" .
when i'm want look Notification history the error show up and likes my history and performance graph for spesific time and date gone .
i'm tried look on nagios.log no one clue related this error. search the file nagios-xx-xx-xx.log on the path is gone . i think this log on spesific date archive isn't create. please your advice for solve this issue.. :?:

thank in advance for your help.

Note:
Nagios version Nagios XI 2012R2.2
OS -> Centos 6.4 x84_64.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Error: Cannot open log file for reading

Post by slansing »

Are you able to open earlier date ranges? Can you view the last 24 hours? Please also rung the following and report it back to us:

Code: Select all

ll -la /usr/local/nagios/var/archives/

ll -la /usr/local/nagios/var/nagios.log
Perintis
Posts: 11
Joined: Tue Feb 19, 2013 5:01 am

Re: Error: Cannot open log file for reading

Post by Perintis »

hi. sory for late message ,

you can see for list 25 august file not created. at september this issue's come again the log not created and message.log :
Sep 2 00:00:00 localhost nagios: Caught SIGSEGV, shutting down...
Sep 2 00:00:00 localhost ndo2db: Error: mysql_query() failed for 'UPDATE nagios_conninfo SET disconnect_time=NOW(), last_checkin_t
ime=NOW(), data_end_time=FROM_UNIXTIME, bytes_processed='0', lines_processed='0', entries_processed='0' WHERE conninfo_id='0''
Sep 2 00:00:00 localhost ndo2db: mysql_error: 'MySQL server has gone away'
Sep 2 00:00:00 localhost ndo2db: Error: Connection to MySQL database has been lost!

i tried to fix database nagios n complete successfully. n still monitoring this issue hope not happen again.

any advice ??

thnks.
Last edited by Perintis on Mon Sep 16, 2013 1:50 am, edited 1 time in total.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Error: Cannot open log file for reading

Post by lmiltchev »

Are you seeing the same problem after fixing the database issue?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Perintis
Posts: 11
Joined: Tue Feb 19, 2013 5:01 am

Re: Error: Cannot open log file for reading

Post by Perintis »

until now all this ok.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Error: Cannot open log file for reading

Post by lmiltchev »

I am locking this topic as resolved. If you have any more issues, please, start a new thread.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Perintis
Posts: 11
Joined: Tue Feb 19, 2013 5:01 am

Re: Error: Cannot open log file for reading

Post by Perintis »

hello ,

i found the root couse is if any scheduled downtime host or service (ex. 3 days) at midnight nagios service unexpectedly stop and impact to log archives didn't created. please your advice this is bug from nagios or any information ?? ,i used nagios xi 2012R2.2 .
for temporary action i created corntab job for check nagios service at midnight every day its fix for issue nagios stop with "SIGSEGV "message ,but nagios log didn't created archive log .
could you help to share manually run Log rotate / where script on nagios to run log rotate archive??,can i ran manual it..

thank you,
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Error: Cannot open log file for reading

Post by slansing »

Are you using mk_livestatus?:

Code: Select all

cat /usr/local/nagios/etc/nagios.cfg | grep broker_mod
Perintis
Posts: 11
Joined: Tue Feb 19, 2013 5:01 am

Re: Error: Cannot open log file for reading

Post by Perintis »

yes , as below :

Code: Select all

# cat /usr/local/nagios/etc/nagios.cfg | grep broker_mod
broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg
broker_module=/usr/local/lib/mk-livestatus/livestatus.o /usr/local/nagios/var/rw/live
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Error: Cannot open log file for reading

Post by slansing »

Can you also show us the permissions on the nagios log?:

Code: Select all

ll -la /usr/local/nagios/var/archives/nagios*
Locked