Discussion:
[Nagios-users] Error: Cannot open log file '/var/log/nagios/nagios.log' for reading!
Yugo Ashida
2003-02-27 07:09:08 UTC
Permalink
I get the message:

Error: Cannot open log file '/var/log/nagios/nagios.log' for reading! when i
try and access the Event Log, Alert History or Notifications on the web
page.

Is this because the nagios process is running as root. If so do i just need
to create a username called nagios and then run the service from that?

Yugo Ashida
EDP
Miki Travel Ltd
+44 (0) 207 398 7284
Stanley Hopcroft
2003-02-27 09:34:06 UTC
Permalink
Dear Sir,


I am writing to thank you for your letter and say,
Post by Yugo Ashida
Error: Cannot open log file '/var/log/nagios/nagios.log' for reading! when i
try and access the Event Log, Alert History or Notifications on the web
page.
Is this because the nagios process is running as root. If so do i just need
to create a username called nagios and then run the service from that?
Probably.

The default (run configure when installing from source) installation is
for nagios to run as user nagios and in group nagios.

You'll have the sort of trouble you describe otherwise.

Here's some of my Nag processes,

nagios 8375 0.0 6.1 25728 15876 ?? Ss Mon10AM 28:44.68
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 69713 0.0 0.1 460 196 ?? S 10:29PM 0:00.00 /sbin/ping
-n -c 10 10.0.100.132
nagios 69717 0.0 6.2 25728 16072 ?? S 10:29PM 0:00.00
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 69718 0.0 0.1 632 272 ?? S 10:29PM 0:00.00 sh -c
/usr/local/nagios/libexec/check_by_ssh -t 30 -H zeus -l wwwrobot -C
'/usr/local/bin/system_health_check poseidon'
nagios 69719 0.0 0.2 972 588 ?? S 10:29PM 0:00.00
/usr/local/nagios/libexec/check_by_ssh -t 30 -H zeus -l wwwrobot -C
/usr/local/bin/system_health_check poseidon
nagios 69720 0.5 0.6 2092 1472 ?? S 10:29PM 0:00.02
/usr/bin/ssh -l wwwrobot zeus /usr/local/bin/system_health_check
poseidon
nagios 69722 0.0 6.2 25728 16072 ?? S 10:29PM 0:00.00
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

All running as user nagios.
Post by Yugo Ashida
Yugo Ashida
EDP
Miki Travel Ltd
+44 (0) 207 398 7284
I can't imagine how your nagios process is running as root after it has
daemonised.

Are you running Nag without -d (not recommended other than for
debugging) ?

Yours sincerely.
--
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------

'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'

from Meditation 17, J Donne.
Loading...