Page 2 of 3

Re: Error: Cannot open log file for reading

Posted: Mon Sep 23, 2013 10:36 pm
by Perintis
here's permission sample from my archive :
  • -rw-r--r--. 1 root root 2679238 Dec 27 2012 /usr/local/nagios/var/archives/nagios-12-28-2012-00.log
    -rw-r--r--. 1 root root 1585577 Dec 28 2012 /usr/local/nagios/var/archives/nagios-12-29-2012-00.log
    -rw-r--r--. 1 root root 366062 Dec 29 2012 /usr/local/nagios/var/archives/nagios-12-30-2012-00.log
    -rw-r--r--. 1 root root 329504 Dec 30 2012 /usr/local/nagios/var/archives/nagios-12-31-2012-00.log

Re: Error: Cannot open log file for reading

Posted: Tue Sep 24, 2013 10:04 am
by abrist
These log should be owned by nagios.

Code: Select all

chown nagios:nagios /usr/local/nagios/var/archives/*

Re: Error: Cannot open log file for reading

Posted: Tue Sep 24, 2013 8:53 pm
by Perintis
  • -rw-r--r--. 1 nagios nagios 1263020 Sep 14 00:00 nagios-09-14-2013-00.log
    -rw-r--r--. 1 nagios nagios 596027 Sep 15 00:00 nagios-09-15-2013-00.log
    -rw-r--r--. 1 nagios nagios 460356 Sep 16 00:00 nagios-09-16-2013-00.log
    -rw-r--r--. 1 nagios nagios 599444 Sep 17 00:00 nagios-09-17-2013-00.log
OK, i have changed the owner, there is no impact with my archive log. the file log on archive folder didn't created for today archive log.
and my nagios.log file size always increase , because daily log rotation not working properly. any idea ??

Re: Error: Cannot open log file for reading

Posted: Wed Sep 25, 2013 2:43 pm
by abrist
Lets check the config for log rotation:

Code: Select all

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

Re: Error: Cannot open log file for reading

Posted: Wed Sep 25, 2013 9:26 pm
by Perintis
Log rotation method is daily (d) as below :
# grep log /usr/local/nagios/etc/nagios.cfg
log_event_handlers=0
log_archive_path=/usr/local/nagios/var/archives
log_external_commands=0
log_file=/usr/local/nagios/var/nagios.log
log_host_retries=1
log_initial_states=0
log_notifications=1
log_passive_checks=0
log_rotation_method=d
log_service_retries=1
use_syslog=1

Re: Error: Cannot open log file for reading

Posted: Thu Sep 26, 2013 10:25 am
by abrist
Is syslog running?

Code: Select all

service rsyslog status
You may want to restart it anyways:

Code: Select all

service rsyslog stop
killall rsyslog
service rsyslog start

Re: Error: Cannot open log file for reading

Posted: Thu Sep 26, 2013 9:52 pm
by Perintis
service's running
# service rsyslog status
rsyslogd (pid 1817) is running...

Re: Error: Cannot open log file for reading

Posted: Fri Sep 27, 2013 9:51 am
by abrist
Did you restart rsyslog for good measure? So your logs have not rotated since the 17th?

Re: Error: Cannot open log file for reading

Posted: Tue Nov 12, 2013 7:16 pm
by Perintis
OK done. for log history problem is finished after i 'am created script to manual copy from nagios.log to archive folder and restarted manually.

Re: Error: Cannot open log file for reading

Posted: Wed Nov 13, 2013 11:24 am
by slansing
Is your problem resolved now?