This works GREAT! Thanks for your help. Mark
-----Original Message----- From: Matt Robertson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 11, 2003 12:37 PM To: CF-Talk Subject: RE: Monitoring Server Uptime You can get a time-since-last-reboot and quite a bit more with this code. I got it from the devex ages ago. Can't remember the name of the tag. -------------------------------------------- Matt Robertson [EMAIL PROTECTED] MSB Designs, Inc. http://mysecretbase.com -------------------------------------------- <cfset ticks = gettickcount()/1000> <cfset days = int(ticks/86400)> <cfset left = ticks-(86400*days)> <cfset hours = int(left/3600)> <cfset left = left-(3600*hours)> <cfset minutes = int(left/60)> <cfset left = left-(60*minutes)> <cfset seconds = int(left)> <CFSET pmData = GetMetricData("PERF_MONITOR")> <CFSET QueryName="MyQuery"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><title>Untitled</title></head> <body BGCOLOR="#FFFFFF"> <FONT FACE="Tahoma, Verdana, Arial, Helvetica"> <FONT FACE="Tahoma, Verdana, Arial, Helvetica" SIZE="1">Amount of time server has been up since last restart: <CFOUTPUT> <FONT COLOR="##800000">#days#</FONT> Day<CFIF #days# GT 1>s<CFELSE><CFIF #days# EQ 0>s</CFIF></CFIF> , <FONT COLOR="##800000">#hours#</FONT> Hour<CFIF #hours# GT 1>s<CFELSE><CFIF #hours# EQ 0>s</CFIF></CFIF> , <FONT COLOR="##800000">#minutes#</FONT> Minute<CFIF #minutes# GT 1>s<CFELSE><CFIF #minutes# EQ 0>s</CFIF></CFIF> , <FONT COLOR="##800000">#seconds#</FONT> Second<CFIF #seconds# GT 1>s<CFELSE><CFIF #seconds# EQ 0>s</CFIF></CFIF><HR> <HR> </FONT> <table cellpadding="4"> <tr> <td>InstanceName</td><td>#pmData.InstanceName#</td><td></td> </tr> <tr> <td>PageHits</td><td>#pmData.PageHits#</td><td></td> </tr> <tr> <td><b>ReqQueued</b></td><td><b>#pmData.ReqQueued#</b></td> <td> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td width="#Evaluate('#pmData.ReqQueued#*10')#" bgcolor="Blue"> </td> </tr> </table> </td> </tr> <tr> <td>DBHits</td><td>#pmData.DBHits#</td><td></td> </tr> <tr> <td><b>ReqRunning</b></td><td><b>#pmData.ReqRunning#</b></td> <td> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td width="#Evaluate('#pmData.ReqRunning#*10')#" bgcolor="Blue"> </td> </tr> </table> </td> </tr> <tr> <td>ReqTimedOut</td><td>#pmData.ReqTimedOut#</td><td></td> </tr> <tr> <td>BytesIn</td><td>#pmData.BytesIn#</td><td></td> </tr> <tr> <td>BytesOut</td><td>#pmData.BytesOut#</td><td></td> </tr> <tr> <td><b>AvgQueueTime</b></td><td><b>#pmData.AvgQueueTime#</b></td> <td> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td width="#Evaluate('#pmData.AvgQueueTime#/20')#" bgcolor="Red"> </td> </tr> </table> </td> </tr> <tr> <td><b>AvgReqTime</b></td><td><b>#pmData.AvgReqTime#</b></td> <td> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td width="#Evaluate('#pmData.AvgReqTime#/20')#" bgcolor="Red"> </td> </tr> </table> </td> </tr> <tr> <td><b>AvgDBTime</b></td><td><b>#pmData.AvgDBTime#</b></td> <td> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td width="#Evaluate('#pmData.AvgDBTime#/20')#" bgcolor="Red"> </td> </tr> </table> </td> </tr> <tr> <td>CachePops</td><td>#pmData.CachePops#</td><td></td> </tr> </table> </DIV> </CFOUTPUT> </body> </html> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

