LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-20-2014, 08:04 AM   #1
hhm
LQ Newbie
 
Registered: Sep 2014
Posts: 6

Rep: Reputation: Disabled
Talking Error: Cannot open log file '/usr/local/nagios/var/archives/nagios


I get this error on nagios web interface

Error: Cannot open log file '/usr/local/nagios/var/archives/nagios-09-19-2014-00.log' for reading!
Error: Cannot open log file '/usr/local/nagios/var/archives/nagios-09-20-2014-00.log' for reading!
I find that get this Error because time is mismatch but in my case time is mactch, any help please?
:/usr/local/nagios/etc/objects$ cd /
:/$ cd /usr/local/nagios/var/archives
:/usr/local/nagios/var/archives$ ls -al
total 88
drwxrwxr-x 2 nagios nagios 4096 Sep 17 23:59 .
drwxrwxr-x 5 nagios nagios 4096 Sep 20 10:56 ..
-rw-r--r-- 1 nagios nagios 4549 Aug 23 00:01 nagios-08-23-2014-00.log
-rw-r--r-- 1 nagios nagios 15821 Sep 1 00:08 nagios-09-01-2014-00.log
-rw-r--r-- 1 nagios nagios 3822 Sep 3 00:59 nagios-09-03-2014-00.log
-rw-r--r-- 1 nagios nagios 2681 Sep 4 01:02 nagios-09-04-2014-00.log
-rw-r--r-- 1 nagios nagios 11111 Sep 9 23:34 nagios-09-09-2014-00.log
-rw-r--r-- 1 nagios nagios 6301 Sep 11 00:08 nagios-09-11-2014-00.log
-rw-r--r-- 1 nagios nagios 3266 Sep 12 01:00 nagios-09-12-2014-00.log
-rw-r--r-- 1 nagios nagios 4681 Sep 13 01:24 nagios-09-13-2014-00.log
-rw-r--r-- 1 nagios nagios 12359 Sep 18 00:24 nagios-09-18-2014-00.log

\\regards,
 
Old 09-20-2014, 11:21 AM   #2
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
It's been a while since I've used nagios, but don't the permissions need to be nagios:apache? (or whatever user you are using for the web server)
 
Old 09-20-2014, 11:49 AM   #3
hhm
LQ Newbie
 
Registered: Sep 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks for reply,

I'm new to nagios. I installed apache 2 + why some logs are available and some are not!! even though I'm using same permission nagios:nagios and I didn't change it since first day of installation.
 
Old 09-20-2014, 11:50 AM   #4
hhm
LQ Newbie
 
Registered: Sep 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by GaWdLy View Post
It's been a while since I've used nagios, but don't the permissions need to be nagios:apache? (or whatever user you are using for the web server)
Thanks for reply,

I'm new to nagios. I installed apache 2 + why some logs are available and some are not!! even though I'm using same permission nagios:nagios and I didn't change it since first day of installation.
 
Old 09-20-2014, 01:43 PM   #5
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
Run the pre-flight check from the CL:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

(correct the paths for your environment)
 
Old 09-21-2014, 10:11 AM   #6
hhm
LQ Newbie
 
Registered: Sep 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by GaWdLy View Post
Run the pre-flight check from the CL:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

(correct the paths for your environment)
here output of pre-flight check:
Nagios Core 4.0.6
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 04-29-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 10 services.
Checked 2 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 2 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check


can you please elaborate more on changing path environment. I didn't get what do you mean.
 
Old 09-21-2014, 11:37 AM   #7
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
Correct the PATH (/usr/local/nagios) if different. Clearly, since you posted the output, it's not.

I haven't put a lot of time into resolving your issue. One thing that I hearkened back on is that this sort of thing always used to happen to me after a fresh install. I always found that this doc resolved a large majority if my problems: http://assets.nagios.com/downloads/n...rom_Source.pdf

Follow it from beginning to end, unless you're using NagiosXI, and if that's the case, then you should be taking advantage of support.

Also, the forum over at Nagios-even the core forum for free-has always been *very* useful for resolving issues.
 
Old 09-26-2014, 07:42 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Given that neither of those files appear in the dir listing, I'm not surprised it complains.
 
Old 09-27-2014, 02:05 AM   #9
hhm
LQ Newbie
 
Registered: Sep 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
dir listing

Quote:
Originally Posted by chrism01 View Post
Given that neither of those files appear in the dir listing, I'm not surprised it complains.
if I undrestand what you are saying. Then I modify nagios.cfg and I remove (#) from this line cfg_dir=/usr/local/nagios/etc/hosts. after restarting nagios I get this Error: Could not open config directory '/usr/local/nagios/etc/hosts' for reading.
Error processing object config files!
therefore, I comment out cfg_dir=/usr/local/nagios to eliminate the error.

please explain how can let the files to appear in the dir listing
 
Old 09-27-2014, 08:18 AM   #10
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
Are you using a hosts file? Does it exist? If not, then you cannot tell config that it should be checked.

If you have no hosts file, then what happened to it, btw? It's a standard cfg file.
 
Old 09-27-2014, 08:46 AM   #11
hhm
LQ Newbie
 
Registered: Sep 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by GaWdLy View Post
Are you using a hosts file? Does it exist? If not, then you cannot tell config that it should be checked.

If you have no hosts file, then what happened to it, btw? It's a standard cfg file.
I have hosts.cfg file (already configured to moniter some services), here are some lines from nagios.cfg

# OBJECT CONFIGURATION FILE(S)

# You can specify individual object config files as shown below:
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/objects/templates.cfg

# Definitions for monitoring the host
cfg_file=/usr/local/nagios/etc/objects/hosts.cfg

# You can also tell Nagios to process all config files (with a .cfg
# extension) in a particular directory by using the cfg_dir
# directive as shown below:

#cfg_dir=/usr/local/nagios/etc/servers
#cfg_dir=/usr/local/nagios/etc/printers
#cfg_dir=/usr/local/nagios/etc/switches
#cfg_dir=/usr/local/nagios/etc/routers
#cfg_dir=/usr/local/nagios/etc/hosts
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/usr/local/nagios/bin/nagios not found Divya V N Linux - Kernel 6 02-05-2013 08:59 AM
ould not create external command file '/usr/local/nagios/var/rw/nagios.cmd gerard.zapata Linux - Newbie 2 09-14-2012 01:57 PM
what do selinux can't apply partial context to unlabeled file /usr/local/nagios/sbin/ parthipan Linux - Server 1 06-07-2012 01:36 PM
what do selinux can't apply partial context to unlabeled file /usr/local/nagios/sbin/ parthipan Linux - Server 3 06-07-2012 07:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration