How do nagios logs rotate

scott_yem at agilent.com scott_yem at agilent.com
Thu Apr 14 03:13:57 CEST 2005


I think I was just too vague.  I know how and where the logs are defined
to rotate, what I am looking for is the command they use so I can append
a function to HUP my process reading the tail of the file.  I have
configured Nagios on Redhat 7.3, Fedora Core 2 & 3, RHEL WS 3 and Debian
Woody and Sarge with Netsaint 0.0.7, Nagios 1.2, 1.3(Debian), 2.0a1,
2.0b2, and 2.0b3.  I am currently working on 2.0b3 on RHEL WS 3.
Although I like 1.3 on Debian Sarge, I think the newer version is better
for my purposes.  I have not seen any logging information regarding how
the logs are rotated, but I believe that they are using logrotate.  If
this is the case, I would be happy to use the functionality built into
the system to HUP my process much like I see in the /etc/logrotate.conf
file.  I know there are developers on the list, so I am hoping that
there is a solution that they know about.

 

Once again, I understand that the process of monitoring the log this way
is not the most efficient, but it works for now.  The only problem is
that I inherited a system with a Nagios log of over 3GB and I would like
to prevent this in the future.  The system takes sometimes hours to
display the log information.  My new system resolves this issue and the
logs seem to rotate fine, but the process I use to monitor the log does
not feed any data after the log is rotated.

 

I guess another option would be to set the log rotation to none and use
the logrotate function, but I think this will have adverse affects to
the statistics.  Please help.

 

Scott Yem

  _____  

From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Calvin
Crutchfield
Sent: Wednesday, April 13, 2005 4:02 PM
To: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] How do nagios logs rotate

 

For the nagios log it is in the main config file:


# LOG ROTATION METHOD
# This is the log rotation method that Nagios should use to rotate
# the main log file. Values are as follows..
#       n       = None - don't rotate the log
#       h       = Hourly rotation (top of the hour)
#       d       = Daily rotation (midnight every day)
#       w       = Weekly rotation (midnight on Saturday evening)
#       m       = Monthly rotation (midnight last day of month)

log_rotation_method=d

calvin


On 4/13/05 3:55 PM, "scott_yem at agilent.com" <scott_yem at agilent.com>
wrote:

I have a process looking at the log files and noticed that when the logs
rotate, my process looking at the log file breaks.  I am using a tail -f
command with a perl script to interpret data coming back via a passive
check.  I am then plugging the information into a rrd and making graphs.
I know this is probably easier with nagiosgraph or something, but this
is a migration from a server running Netsaint 007.  I wanted to get
things running the way they were and then work to get the other files
made up the way we want.
 
I will try nagiosgraph, but in my last attempts, I was not able to get
it working properly.  The functionality seems to be better than what I
am currently using, but the code for the current solution is more than 3
years old.
 
I was looking in /etc/logrotate.conf and did not find any log rotation
in there.  If the script was in here I know I could HUP the process for
my script, but I cannot find the process that rotates the logs.
 
Any help is appreciated.
 
Scott Yem
Research Computing Services
Agilent Laboratories

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050413/b884ea8c/attachment.html>


More information about the Users mailing list