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

Re: Error: Cannot open log file for reading

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Error: Cannot open log file for reading

Post by abrist »

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.
Perintis
Posts: 11
Joined: Tue Feb 19, 2013 5:01 am

Re: Error: Cannot open log file for reading

Post 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 ??
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Error: Cannot open log file for reading

Post by abrist »

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.
Perintis
Posts: 11
Joined: Tue Feb 19, 2013 5:01 am

Re: Error: Cannot open log file for reading

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Error: Cannot open log file for reading

Post 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
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.
Perintis
Posts: 11
Joined: Tue Feb 19, 2013 5:01 am

Re: Error: Cannot open log file for reading

Post by Perintis »

service's running
# service rsyslog status
rsyslogd (pid 1817) is running...
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Error: Cannot open log file for reading

Post by abrist »

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.
Perintis
Posts: 11
Joined: Tue Feb 19, 2013 5:01 am

Re: Error: Cannot open log file for reading

Post 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.
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 »

Is your problem resolved now?
Locked