- -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
Error: Cannot open log file for reading
Re: Error: Cannot open log file for reading
here's permission sample from my archive :
Re: Error: Cannot open log file for reading
These log should be owned by nagios.
Code: Select all
chown nagios:nagios /usr/local/nagios/var/archives/*
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Error: Cannot open log file for reading
- -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
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
Lets check the config for log rotation:
Code: Select all
grep log /usr/local/nagios/etc/nagios.cfg
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Error: Cannot open log file for reading
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
Is syslog running?
You may want to restart it anyways:
Code: Select all
service rsyslog status
Code: Select all
service rsyslog stop
killall rsyslog
service rsyslog start
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Error: Cannot open log file for reading
service's running
# service rsyslog status
rsyslogd (pid 1817) is running...
Re: Error: Cannot open log file for reading
Did you restart rsyslog for good measure? So your logs have not rotated since the 17th?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Error: Cannot open log file for reading
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.
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Error: Cannot open log file for reading
Is your problem resolved now?