View previous topic :: View next topic |
Author |
Message |
Laureline Champion
Joined: 18 Aug 2005 Posts: 3
|
Posted: Thu Aug 18, 2005 6:43 am Post subject: Colors for tests |
|
|
I was wondering if I could put colors on tests in reports when the %AliveRatio goes under a limit value. Do I have to create a new status depending on the %AliveRatio? Is it possible?
Or do I have to change the HTML code of the reports generated?
Thanks a lot
Laureline |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
|
Back to top |
|
|
Laureline Champion
Joined: 18 Aug 2005 Posts: 3
|
Posted: Fri Aug 19, 2005 6:46 am Post subject: |
|
|
I try to use Custom HTML reports, but I don't know where I can write some Java script.
Where is the file?
Regards,
Laureline |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Fri Aug 19, 2005 10:59 am Post subject: |
|
|
What file?
You may write script in "Header" section of the report template (see "HTML report template" dialog). Then you should call script for each item from "Test items" section of the report.
Regards
Alex |
|
Back to top |
|
|
gjones
Joined: 18 Nov 2005 Posts: 5 Location: Los Angeles, CA
|
Posted: Mon Dec 12, 2005 6:50 pm Post subject: |
|
|
This is exactly the question that I have been searching for an answer to...
Here's my situation: Out of over 2,000 desktop PCs, we have 40 that have to stay on 24/7 for scanned image processing. We have created 40 ping tests and a custom HTML report that shows current good or bad status, but what I really need is a third color to show when something has been down any time within the last 24 hours.
I think I understand what you are saying about the extra java code in the header section to specify a "less-than-100%" status, although a code example would be great. More importantly, do you have any suggestions on how I can limit %AliveRatio% to just the last 24 hours? |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Thu Dec 15, 2005 9:56 pm Post subject: |
|
|
For example you may use following code:
Header: Code: | <html><head>
<meta name="GENERATOR" content="KS-Soft HostMonitor">
<META http-equiv="Content-Style-Type" content="text/css">
<title>HostMonitor report</title>
<STYLE TYPE="text/css"><!-- a:hover { color: "#00FFFF"; } --> </STYLE>
<style type="text/css">
input.Folder { background: #000080; color: #FFFFFF; height:19px; width:55px; line-height:12px; }
input.Good00 { background: #004040; color: #C4FFFF; height:19px; width:55px; line-height:12px; }
input.Good90 { background: #00AA00; color: #C4FFFF; height:19px; width:55px; line-height:12px; }
input.Bad00 { background: #880000; color: #000000; height:19px; width:55px; line-height:12px; }
input.Bad10 { background: #FF0000; color: #000000; height:19px; width:55px; line-height:12px; }
input.Unknown { background: #FFFF00; color: #000000; height:19px; width:55px; line-height:12px; }
input.BadAck { background: #FF8040; color: #000000; height:19px; width:55px; line-height:12px; }
input.UnknAck { background: #FFFF40; color: #000000; height:19px; width:55px; line-height:12px; }
input.WaitForMaster { background: #0000FF; color: #FFFF00; height:19px; width:55px; line-height:12px; }
input.OutOfSchedule { background: #0080FF; color: #FFFF00; height:19px; width:55px; line-height:12px; }
input.Disabled { background: #808080; color: #C0C0C0; height:19px; width:55px; line-height:12px; }
input.NotTested { background: #8080FF; color: #91FFFF; height:19px; width:55px; line-height:12px; }
</style>
</head>
<body bgcolor="#000080" text="#E9E9E9" link="#00FFFF" vlink="#00FFFF" alink="#00FFFF">
<p align="left"><u><strong><big><big>HostMonitor Report</big></big><br>
</strong></u><font face="Arial">Generated on %Date% at %Time%</font></p>
<script language="JavaScript"> <!--
function showinfo(info) { alert(info); }
--> </script>
<hr>
<form>
<table border=0> |
Folder section Code: |
<tr><td valign=top nowrap bgcolor="#000099"><b><font color="#FFFFFF">%Folder%</font></b></td><td> </td><td> |
Test items "with Good status" Code: |
<SCRIPT type="text/javascript">
if (%PassedCnt%/%TotalTests%>0.9) document.write("<input type=button class=Good90 value='%Reply%'>");
else document.write("<input type=button class=Good00 value='%Reply%'>");
--></script> |
Test items "with Bad status" Code: |
<SCRIPT type="text/javascript">
if (%FailedCnt%/%TotalTests%>0.1) document.write("<input type=button class=Bad10 value='%Reply%'>");
else document.write("<input type=button class=Bad00 value='%Reply%'>");
--></script> |
and so on
With this code report will show
- light green color for "good" test items with Alive% ratio >90%
- dark green color for "good" test items with Alive% ratio <=90%
- dark red color for "bad" test items with Dead% ratio <= 10%
- light red color for "bad" test items with Dead% ratio > 10%
Regards
Alex[/code] |
|
Back to top |
|
|
gjones
Joined: 18 Nov 2005 Posts: 5 Location: Los Angeles, CA
|
Posted: Fri Dec 16, 2005 10:06 am Post subject: Perfect! |
|
|
Thanks for providing that very useful code. The report looks good. My last question is whether the statistics can be limited to a rolling 24 hour period. In other words, can we show a change in color for only the machines that have been offline for any amount of time in the last day? |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
|
Back to top |
|
|
gjones
Joined: 18 Nov 2005 Posts: 5 Location: Los Angeles, CA
|
Posted: Fri Dec 16, 2005 5:17 pm Post subject: |
|
|
Thanks for pointing me there. I was struggling to find that setting. Even though it does not allow for a "rolling" 24 hour period, I can have it reset at 17:00, which should be just as good. |
|
Back to top |
|
|
|