<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:m="http://schemas.microsoft.com/office/2004/12/omml" 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 12 (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]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        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:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="2050" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal>If a host or service is found to be flapping when state is
read in during startup in xrddefault.c, then a new comment about the flapping
is added to the system.<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>Since this happens before all of retention.dat has been read
in, the comment ID assigned to this new comment could conflict with a comment
ID of an existing comment later in retention.dat.<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>Then, when that later comment is read in, it gets assigned a
new comment ID. (Or, if you're using my recently submitted startup time
speed-up patch, it gets assigned a <i>duplicate</i> comment ID.  D'oh!)<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>A comment ID changing when Nagios restarts can cause
problems if comment IDs are being stored and used in a persistent fashion anywhere
outside of the Nagios process itself.  One way I know that happens is in
the CGI.  If I have a page with a comment on it displayed in my browser,
and then the Nagios server restarts, and then I try to remove the comment and
it has been renumbered, I'll end up removing the wrong comment.  I don't
know how else, if at all, comment IDs are used outside of the Nagios process,
so I don't know how much larger than that the scope of the problem is.<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>I have been trying, unsuccessfully, to think of a good fix
for this problem.  I've thought of a fix that I think will work, but it makes
me uncomfortable in a "boy, that's gross, that can't possibly be the
correct fix" sort of way.  The fix I have in mind depends on the facts
that (a) only persistent comments will be read from retention.dat on startup,
and (b) flapping comments are non-persistent.  So what I'm thinking is
that we should allow duplicate comment IDs to be created when adding flapping
comments (as my patch does), and then when we're done reading retention.dat,
scan through the list of comments (after sorting it), find duplicates, and when
a duplicate is found, renumber the one that isn't marked persistent (since when
there are duplicates, exactly one of them will always be non-persistent). 
Like I said, that's really gross, but I think it will do the right thing.<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>Thoughts?<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt'>Jonathan Kamens<br>
Operations Manager<o:p></o:p></span></p>

<p class=MsoNormal style='mso-margin-top-alt:6.0pt;margin-right:0in;margin-bottom:
6.0pt;margin-left:0in'><a
href="http://www.advent.com/solutions/by-product/tamale-rms"><span
style='font-size:12.0pt;color:blue;text-decoration:none'><img border=0
width=190 height=34 id="Picture_x0020_1"
src="cid:image001.jpg@01CAA346.063475E0" alt="Advent Tamale RMS"></span></a><span
style='font-size:12.0pt'><o:p></o:p></span></p>

<p class=MsoNormal style='mso-margin-bottom-alt:auto'><span style='font-size:
8.0pt'>201 South Street, Suite 300, Boston, MA  02111<br>
Phone: +1 617 261 0264 ext. 133 |
Mobile : +1 617 417 8989 |
Fax: + 1 617 812 0330<br>
<a href="mailto:jkamens@advent.com" title="mailto:jkamens@advent.com">jkamens@advent.com</a> |
<a href="http://www.advent.com/" title="http://www.advent.com/">www.advent.com</a></span><span
style='font-size:12.0pt'><o:p></o:p></span></p>

<p class=MsoNormal><o:p> </o:p></p>

</div>

</body>

</html>