KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Colors for tests

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Reports
View previous topic :: View next topic  
Author Message
Laureline Champion



Joined: 18 Aug 2005
Posts: 3

PostPosted: Thu Aug 18, 2005 6:43 am    Post subject: Colors for tests Reply with quote

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
View user's profile Send private message Send e-mail
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Thu Aug 18, 2005 11:22 am    Post subject: Reply with quote

Its not very easy. You should use Custom HTML report (http://www.ks-soft.net/hostmon.eng/mframe.htm#profiles.htm#CustomHTML) and write some Java script that should check value of %AliveRatio% variable returning different colors (or styles) for different %AliveRatio% values...

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
Laureline Champion



Joined: 18 Aug 2005
Posts: 3

PostPosted: Fri Aug 19, 2005 6:46 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Fri Aug 19, 2005 10:59 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
gjones



Joined: 18 Nov 2005
Posts: 5
Location: Los Angeles, CA

PostPosted: Mon Dec 12, 2005 6:50 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Thu Dec 15, 2005 9:56 pm    Post subject: Reply with quote

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>&nbsp;</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
View user's profile Send private message Visit poster's website
gjones



Joined: 18 Nov 2005
Posts: 5
Location: Los Angeles, CA

PostPosted: Fri Dec 16, 2005 10:06 am    Post subject: Perfect! Reply with quote

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
View user's profile Send private message MSN Messenger
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Fri Dec 16, 2005 10:47 am    Post subject: Reply with quote

You may use "Reset statistisc daily" option located on Statistisc tab in the Folder Properties dialog
http://www.ks-soft.net/hostmon.eng/mframe.htm#testlist.htm#FolderTree

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
gjones



Joined: 18 Nov 2005
Posts: 5
Location: Los Angeles, CA

PostPosted: Fri Dec 16, 2005 5:17 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Reports All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index