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

Receive Error "Unterminated string constant" on Re

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
sadek76



Joined: 27 Apr 2004
Posts: 71
Location: New Jersey

PostPosted: Fri May 07, 2004 2:56 pm    Post subject: Receive Error "Unterminated string constant" on Re Reply with quote

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



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Sun May 09, 2004 10:06 am    Post subject: Reply with quote

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



Joined: 27 Apr 2004
Posts: 71
Location: New Jersey

PostPosted: Fri May 14, 2004 11:24 am    Post subject: Reply with quote

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>&nbsp;</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 &nbsp;</font></td><td><font color=#FFFF00>%UnknownTests%</font></td></tr>
<tr><td><font color=#FFFF00> Tests with "Waiting for Master" status &nbsp;</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
View user's profile Send private message Send e-mail
KS-Soft



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Sun May 16, 2004 4:07 am    Post subject: Reply with quote

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



Joined: 27 Apr 2004
Posts: 71
Location: New Jersey

PostPosted: Mon May 17, 2004 10:17 am    Post subject: Reply with quote

Where would I add the check for TestMethod? What language should it be written in JavaScript, Perl, VB?
Back to top
View user's profile Send private message Send e-mail
KS-Soft



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Mon May 17, 2004 4:54 pm    Post subject: Reply with quote

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



Joined: 27 Apr 2004
Posts: 71
Location: New Jersey

PostPosted: Tue May 18, 2004 9:05 am    Post subject: Reply with quote

Alex - Your the greatest! Works fine.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting 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