<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>

<META content="MSHTML 6.00.6000.21314" name=GENERATOR></HEAD>
<BODY><p><font face='Microsoft Sans Serif' color='Black' size='2'><b>UNCLASSIFIED</b></font></p>
<DIV><SPAN class=674475123-24092012><FONT face=Arial size=2>I have found an 
issue in xymond_client.c where it fails to detect the correct uptime from 
Solaris 10 clients (and it may occur with other versions). 
</FONT></SPAN></DIV>
<DIV><SPAN class=674475123-24092012><FONT face=Arial size=2>The symptom I had 
was that the charts for load and users & processes had regular NaN 
updates, at uniform spacing every hour.</FONT></SPAN></DIV>
<DIV><SPAN class=674475123-24092012><FONT face=Arial 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=674475123-24092012><FONT face=Arial size=2>The cause was the 
following code;</FONT></SPAN></DIV>
<DIV><SPAN class=674475123-24092012><FONT face=Arial 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=674475123-24092012><FONT face=Arial size=2>else if 
(strncmp(hourmark, "1 hr", 4) ==0) {</FONT></SPAN></DIV>
<DIV><SPAN class=674475123-24092012>    <FONT face=Arial 
size=2>uptimesecs = 3600;</FONT></SPAN></DIV>
<DIV><SPAN class=674475123-24092012><FONT face=Arial 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=674475123-24092012><FONT face=Arial size=2>This line only looks 
for uptimes with "1 hr" in them. My Solaris 10 systems report uptime like 
this;</FONT></SPAN></DIV>
<DIV><SPAN class=674475123-24092012><FONT face=Arial 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=674475123-24092012><FONT face=Arial size=2>11:05pm up 830 
days(s), 21:55, 0 users, load average: 0.18, 0.20, 0.20</FONT></SPAN></DIV>
<DIV><SPAN class=674475123-24092012><SPAN class=674475123-24092012><FONT 
face=Arial size=2>11:10pm up 830 days(s), 22 hrs, 0 users, load average: 0.19, 
0.20, 0.20</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=674475123-24092012><SPAN class=674475123-24092012><SPAN 
class=674475123-24092012><FONT face=Arial size=2>11:15pm up 830 days(s), 21:05, 
0 users, load average: 0.16, 0.20, 0.20</FONT></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=674475123-24092012><SPAN class=674475123-24092012><SPAN 
class=674475123-24092012><FONT face=Arial 
size=2></FONT></SPAN></SPAN></SPAN> </DIV>
<DIV><SPAN class=674475123-24092012><SPAN class=674475123-24092012><SPAN 
class=674475123-24092012><FONT face=Arial size=2>Note that at 11:10pm it 
reported "22 hrs", instead of the expected "22:00", and that "22 hrs" does not 
match "1 hr".</FONT></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=674475123-24092012><SPAN class=674475123-24092012><SPAN 
class=674475123-24092012><FONT face=Arial 
size=2></FONT></SPAN></SPAN></SPAN> </DIV>
<DIV><SPAN class=674475123-24092012><SPAN class=674475123-24092012><SPAN 
class=674475123-24092012><FONT face=Arial size=2>This was not matched in the 
uptimesecs calculation code, so the load and user graphs were not getting passed 
values (which I verified using the --processor switch to rrdstatus 
xymond_channel), and a Nan would appear in the la.rrd and users.rrd files, I 
also confirmed via a clientlog "section=uptime" query every 5 mins, which 
would return an empty set for uptime when the client sent uptime with xx hrs 
instead of xx:xx, but no one would notice this as the cpu doesn't go purple 
until it hasn't been updated for several polls, this is only missing one poll 
every hour.</FONT></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=674475123-24092012><SPAN class=674475123-24092012><SPAN 
class=674475123-24092012><FONT face=Arial 
size=2></FONT></SPAN></SPAN></SPAN> </DIV>
<DIV><SPAN class=674475123-24092012><SPAN class=674475123-24092012><SPAN 
class=674475123-24092012><FONT face=Arial size=2>A patch to fix xymond_client.c 
is;</FONT></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=674475123-24092012><SPAN class=674475123-24092012><SPAN 
class=674475123-24092012><FONT face=Arial 
size=2>373,364c373,374</FONT></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=674475123-24092012><SPAN class=674475123-24092012><SPAN 
class=674475123-24092012><FONT face=Arial 
size=2><        else if(strncmp(hourmark, 
"1 hr", 4) == 0) {</FONT></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=674475123-24092012><SPAN class=674475123-24092012><SPAN 
class=674475123-24092012><            
<FONT face=Arial size=2>uptimesecs = 3600;</FONT></SPAN></SPAN></SPAN></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=674475123-24092012>---</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=674475123-24092012>>        else if 
(sscanf(hourmark, "%ld hr", &uphour) == 1) {</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=674475123-24092012>>            
uptimesecs = 3600*uphour</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=674475123-24092012></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=674475123-24092012>This stops the 
interuptions to load and user graphs, and ensures the cpu status is updated 
every time the client sends an update.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=674475123-24092012></SPAN></FONT> </DIV>
<DIV align=left>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN 
class=256574823-17022010><STRONG>--</STRONG></SPAN></FONT></DIV>
<DIV dir=ltr align=left><SPAN class=256574823-17022010><FONT size=2><FONT 
face=Arial><STRONG>Note</STRONG>: I am only at Defence Mondays and Tuesdays, so 
please cc: any response to <FONT color=#000000><A 
href="mailto:jason.mcavoy@saltbushgroup.com">jason.mcavoy@saltbushgroup.com</A>.</FONT></FONT></FONT></SPAN></DIV></DIV>
<DIV> </DIV><p><font face='microsoft sans serif' color='Red' size='2'><b>IMPORTANT</b>: This email remains the property of the Department of Defence and is subject to the jurisdiction of section 70 of the Crimes Act 1914. If you have received this email in error, you are requested to contact the sender and delete the email.<br></font><font face='microsoft sans serif' color='Black' size='2'></font></p></BODY></HTML>