<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Re: [Nagios-users] How do nagios logs rotate</title>
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Scott
Yem</span></font><font color=navy face=Arial><span style='font-family:Arial;
color:navy'><o:p></o:p></span></font></p>
</div>
<div>
<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal style='margin-left:.5in'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
nagios-users-admin@lists.sourceforge.net
[mailto:nagios-users-admin@lists.sourceforge.net] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Calvin Crutchfield<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, April 13, 2005
4:02 PM<br>
<b><span style='font-weight:bold'>To:</span></b>
nagios-users@lists.sourceforge.net<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Nagios-users] How do
nagios logs rotate</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:.5in'><font size=1 face=Verdana><span style='font-size:9.0pt;
font-family:Verdana'>For the nagios log it is in the main config file:<br>
<br>
<br>
# LOG ROTATION METHOD<br>
# This is the log rotation method that Nagios should use to rotate<br>
# the main log file. Values are as follows..<br>
# n =
None - don't rotate the log<br>
# h =
Hourly rotation (top of the hour)<br>
# d =
Daily rotation (midnight every day)<br>
# w =
Weekly rotation (midnight on Saturday evening)<br>
# m =
Monthly rotation (midnight last day of month)<br>
<br>
log_rotation_method=d<br>
<br>
calvin<br>
<br>
<br>
On 4/13/05 3:55 PM, "scott_yem@agilent.com"
<scott_yem@agilent.com> wrote:</span></font><o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:.5in'><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
Any help is appreciated.<br>
<br>
Scott Yem<br>
Research Computing Services<br>
Agilent Laboratories</span></font><o:p></o:p></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>