View previous topic :: View next topic |
Author |
Message |
sadek76
Joined: 27 Apr 2004 Posts: 71 Location: New Jersey
|
Posted: Fri May 07, 2004 2:56 pm Post subject: Receive Error "Unterminated string constant" on Re |
|
|
I created a report that contains all of the test results. The report is using Custom html, Here is the code for the line that's giving me problems: <tr><td><font color=#00FF00> Tests with "Good" status</font></td><td><font color=#00FF00>%GoodTests%</font></td></tr>
This code works for http, url, ping but not Trace. The code that was created looks like: <input type=button class=Good value="London-Proxy Trace: 165.168.184.232" onclick="showinfo('Test name: \tLondon-Proxy Trace: 165.168.184.232\nStatus: \tOk\nRecurrences: \t12730\nReply: \t147.107.53.200
As you can see ')" is missing from the end of the line. I'm using version 4.42 on a Windows 2000 server.[/img] |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Sun May 09, 2004 10:06 am Post subject: |
|
|
#1
Quote: | Here is the code for the line that's giving me problems: <tr><td><font color=#00FF00> Tests with "Good" status</font></td><td><font color=#00FF00>%GoodTests%</font></td></tr> |
#2
Quote: | This code works for http, url, ping but not Trace. The code that was created looks like: <input type=button class=Good value="London-Proxy Trace: 165.168.184.232" onclick="showinfo('Test name: \tLondon-Proxy Trace: 165.168.184.232\nStatus: \tOk\nRecurrences: \t12730\nReply: \t147.107.53.200 |
I do not understand. Line #1 (from the code) cannot produce line #2 (result). Probably you are talking about 2 different problems? Could you provide code that produces line #2?
Regards
Alex |
|
Back to top |
|
|
sadek76
Joined: 27 Apr 2004 Posts: 71 Location: New Jersey
|
Posted: Fri May 14, 2004 11:24 am Post subject: |
|
|
Here is the code from each of the custom html tabs:
Header:
<html><head>
<meta name="Author" content="Jim Stewart">
<META http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="REFRESH" content ="60">
<title>All Tests Report</title>
<STYLE TYPE="text/css"><!-- a:hover { color: "#00FFFF"; } --> </STYLE>
<style type="text/css">
input.Folder { background: #000000; color: #00FFFF; height:20px; width:200px; line-height:12px; }
input.Good { background: #000000; color: #00FF00; height:20px; width:200px; line-height:12px; }
input.Bad { background: #000000; color: #FF0000; height:20px; width:200px; line-height:12px; }
input.Unknown { background: #000000; color: #FFFF00; height:20px; width:200px; line-height:12px; }
input.WaitForMaster { background: #000000; color: #FFFF00; height:20px; width:200px; line-height:12px; }
input.OutOfSchedule { background: #000000; color: #FFFF00; height:20px; width:200px; line-height:12px; }
input.Disabled { background: #000000; color: #C0C0C0; height:20px; width:200px; line-height:12px; }
input.NotTested { background: #000000; color: #91FFFF; height:20px; width:200px; line-height:12px; }
</style>
</head>
<body bgcolor="#000000" text="#00FFFF" link="#00FFFF" vlink="#00FFFF" alink="#00FFFF">
<p align="left"><strong><big><big>whdhostmonprod2 - All Tests Report</big></big><br>
</strong><font face="Arial" size="1">Page Last Updated %Date% at %Time%</font></p>
<script language="JavaScript"> <!--
function showinfo(info) { alert(info); }
--> </script>
<hr>
<form>
<table border=0>
Folder Title:
<tr><td valign=top align=right nowrap bgcolor="#000000"><b><font color="#00FFFF"> %Folder%</font></b></td><td> </td><td>
Test Items:
with "Good" status:
<input type=button class=Good value="%TestName%" onclick="showinfo('Test name: \t%TestName%\nStatus: \t%Status%\nRecurrences: \t%Recurrences%\nReply: \t%Reply%')">
with "Bad" status:
<input type=button class=Bad value="%TestName%" onclick="showinfo('Test name: \t%TestName%\nStatus: \t%Status%\nRecurrences: \t%Recurrences%\nReply: \t%Reply%')">
with "Unknown" status:
<input type=button class=Unknown value="%TestName%" onclick="showinfo('Test name: \t%TestName%\nStatus: \t%Status%\nRecurrences: \t%Recurrences%\nReply: \t%Reply%')">
Wait for Master:
<input type=button class=WaitForMaster value="%TestName%" onclick="showinfo('Test name: \t%TestName%\nStatus: \t%Status%\nRecurrences: \t%Recurrences%')">
Footer:
</table>
</form>
<hr>
<br>
<table border=0>
<tr><td><font color=#00FF00> Tests with "Good" status</font></td><td><font color=#00FF00>%GoodTests%</font></td></tr>
<tr><td><font color=#FF0000> Tests with "Bad" status</font></td><td><font color=#FF0000>%BadTests%</font></td></tr>
<tr><td><font color=#FFFF00> Tests with "Unknown" status </font></td><td><font color=#FFFF00>%UnknownTests%</font></td></tr>
<tr><td><font color=#FFFF00> Tests with "Waiting for Master" status </font></td><td><font color=#FFFF00>%WaitForMasterTests%</font></td></tr>
</table><br>
<p><font face="Arial" size="1">Report Created by the EMS Group</font></p>
</body>
</html>
The test is set to include Hosts Good, Bad, Unknown and Out of Schedule.
Include ALL types and a few field s to report. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Sun May 16, 2004 4:07 am Post subject: |
|
|
Quote: | <input type=button class=Good value="%TestName%" onclick="showinfo('Test name: \t%TestName%\nStatus: \t%Status%\nRecurrences: \t%Recurrences%\nReply: \t%Reply%')"> |
Now I see code you are using.
Problem - Reply field for Trace test may contain more than 1 line, in this case script showinfo('Test name: \t%TestName%\nStatus: \t%Status%\nRecurrences: \t%Recurrences%\nReply: \t%Reply%') fails
Solution?
H'm.. don't see nice solution. Probably complicate script by adding check for test method (using %TestMethod% macro variable)....
Or probably we can add some new macro variable that will represent Reply field, use '\r\n' string instead of CR CL characters
...
Regards
Alex |
|
Back to top |
|
|
sadek76
Joined: 27 Apr 2004 Posts: 71 Location: New Jersey
|
Posted: Mon May 17, 2004 10:17 am Post subject: |
|
|
Where would I add the check for TestMethod? What language should it be written in JavaScript, Perl, VB? |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Mon May 17, 2004 4:54 pm Post subject: |
|
|
I have added new macro variable %Reply_CStyle%, so now you don't need to write any script.
Just download upgrade www.ks-soft.net/download/hm446.zip and modify your report profile (change %Reply% to %Reply_Cstyle%)
Also this new version supports new SNMP Trap test method. If you want to try this method, I would recommend to copy your existent Advanced Host Monitor into another directory (or another computer), unzip new modules, and setup SNMP Trap tests for testing purpose only!
Regards
Alex |
|
Back to top |
|
|
sadek76
Joined: 27 Apr 2004 Posts: 71 Location: New Jersey
|
Posted: Tue May 18, 2004 9:05 am Post subject: |
|
|
Alex - Your the greatest! Works fine. |
|
Back to top |
|
|
|