File Compare test method issue with encoding

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
gorisdean
Posts: 23
Joined: Wed Jun 20, 2012 7:56 am

File Compare test method issue with encoding

Post by gorisdean »

Hi,

We have a Powershell script running using the Out-File cmdlet to write status information into a file.
This file is being read by multiple tests with the File Compare test method.

In the Powershell script we don't mention any encoding parameter. When I open the file in Notepad++ it mentions UTF16 LE BOM.
As per docu this also seems the default encoding for Powershell Out-File.

The File Compare tests running in Hostmonitor are configured on UTF-16 encoding.
This worked for all tests initially, but at some point in time, it starts failing for a single test. While a number of other tests reading the same file still run fine.
The string to check for is still available in the file, so Hostmonitor should be able to find it.
However it reports status "Bad", (not "Bad Content") and we only get it to succeed again if we change the File Compare encoding to ASCII in the Hostmonitor test.
When the test is configured for ASCII, he finds the string and the test is ok again.
This while the file checked is still in UTF-16 LE BOM encoding and a number of other tests using UTF-16 are still fine.

We encountered this on multiple tests reading similar files, but it can take weeks before it happens again on an arbitrary test at an arbitrary moment in time (as far as we can see).

Any idea what is going wrong here?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Re: File Compare test method issue with encoding

Post by KS-Soft »

I assume you are using "Alert when file does not contain string" option? Test performed by HostMonitor? RMA for Windows?
Yes, Bad status is correct status for this test when alert condition is met.
If you tell us HostMonitor version and send file and test settings to support by e-mail, we will try to check what is wrong.

Regards
Alex
Post Reply