Xymon Mailing List Archive search

powershell script with BBWin

3 messages in this thread

list Neil Simmonds · Thu, 12 Dec 2013 15:19:44 +0000 ·
I've created a powershell script that upon completion creates a file in C:\Program Files (x86)\BBWin\tmp just as I have many VBS scripts doing. The file is called Trans and disappears from the tmp directory as would be expected, however the Trans column never updates on the relevant page in Xymon.

If I copy the contents of the file and create a new file with exactly the same name, then paste the contents in, it disappears as expected and the column updates on Xymon.

Has anyone any idea why the powershell generated file is not successfully updating Xymon ?

I've checked all the logs and there is nothing there.

Regards,
Neil Simmonds

Name & Registered Office: EXPRESS GIFTS LIMITED, 2 GREGORY ST, HYDE, CHESHIRE, ENGLAND, SK14 4TH, Company No. 00718151.
Express Gifts Limited is authorised and regulated by the Financial Services Authority
NOTE:  This email and any information contained within or attached in a separate file is confidential and intended solely for the Individual to whom it is addressed. The information or data included is solely for the purpose indicated or previously agreed. Any information or data included with this e-mail remains the property of Findel PLC and the recipient will refrain from utilising the information for any purpose other than that indicated and upon request will destroy the information and remove it from their records.  Any views or opinions presented are solely those of the author and do not necessarily represent those of Findel PLC. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. No warranties or assurances are made in relation to the safety and content of this e-mail and any attachments.  No liability is accepted for any consequences arising from it. Findel Plc reserves the right to monitor all e-mail communications through its internal and external networks. If you have received this email in error please notify our IT helpdesk on +44(0) 1254 303030
list Darin D [itsys] Dugan · Thu, 12 Dec 2013 16:04:05 +0000 ·
Likely you're outputting Unicode via script. The PowerShell externals I use with BBWin/Xymon force ASCII with something like:

"$color+13h $now $scriptName $version`n`n$body" | Out-File -FilePath "$path\$TestName" -Encoding ascii

Cheers.
Darin
quoted from Neil Simmonds

From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Neil Simmonds
Sent: Thursday, December 12, 2013 9:20 AM
To: user-7746895938b7@xymon.invalid
Cc: xymon at xymon.com
Subject: [Xymon] powershell script with BBWin

I've created a powershell script that upon completion creates a file in C:\Program Files (x86)\BBWin\tmp just as I have many VBS scripts doing. The file is called Trans and disappears from the tmp directory as would be expected, however the Trans column never updates on the relevant page in Xymon.

If I copy the contents of the file and create a new file with exactly the same name, then paste the contents in, it disappears as expected and the column updates on Xymon.

Has anyone any idea why the powershell generated file is not successfully updating Xymon ?

I've checked all the logs and there is nothing there.

Regards,
Neil Simmonds
Name & Registered Office: EXPRESS GIFTS LIMITED, 2 GREGORY ST, HYDE, CHESHIRE, ENGLAND, SK14 4TH, Company No. 00718151.

Express Gifts Limited is authorised and regulated by the Financial Conduct Authority
quoted from Neil Simmonds
NOTE: This email and any information contained within or attached in a separate file is confidential and intended solely for the Individual to whom it is addressed. The information or data included is solely for the purpose indicated or previously agreed. Any information or data included with this e-mail remains the property of Findel PLC and the recipient will refrain from utilising the information for any purpose other than that indicated and upon request will destroy the information and remove it from their records. Any views or opinions presented are solely those of the author and do not necessarily represent those of Findel PLC. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. No warranties or assurances are made in relation to the safety and content of this e-mail and any attachments. No liability is accepted for any consequences arising from it. Findel Plc reserves the right to monitor all e-mail communications through its internal and external networks. If you have received this email in error please notify our IT helpdesk on +44(0) 1254 303030
list David Baldwin · Fri, 13 Dec 2013 09:34:13 +1100 ·
quoted from Neil Simmonds
On 13/12/13 2:19 AM, Neil Simmonds wrote:
I’ve created a powershell script that upon completion creates a file
in C:\Program Files (x86)\BBWin\tmp just as I have many VBS scripts
doing. The file is called Trans and disappears from the tmp directory
as would be expected, however the Trans column never updates on the
relevant page in Xymon.
Better to just send direct from Powershell to Xymon rather than rely on
BBWin to send a text file. Default charset in PS is Unicode which needs
to be translated to ASCII.

Here's an implementation of xymon send and reply functionality -
basically a port of C code for 'bb/xymon' to PS using .Net classes for
socket handling and also charset translation. Just add it into your
script and call XymonSend. If you send a client report with it you will
be returned the client-local.cfg section relevant to the client, or you
can use it for stuff like 'query' or other commands to interrogate Xymon
server.
http://sourceforge.net/p/xymon/code/HEAD/tree/sandbox/WinPSClient/xymonsend.ps1

David.
quoted from Darin D [itsys] Dugan
 
If I copy the contents of the file and create a new file with exactly
the same name, then paste the contents in, it disappears as expected
and the column updates on Xymon.

 
Has anyone any idea why the powershell generated file is not
successfully updating Xymon ?

 
I’ve checked all the logs and there is nothing there.

 
Regards,

Neil Simmonds

Name & Registered Office: EXPRESS GIFTS LIMITED, 2 GREGORY ST, HYDE,
CHESHIRE, ENGLAND, SK14 4TH, Company No. 00718151.

Express Gifts Limited is authorised and regulated by the Financial
Conduct Authority


NOTE: This email and any information contained within or attached in a
separate file is confidential and intended solely for the Individual
to whom it is addressed. The information or data included is solely
for the purpose indicated or previously agreed. Any information or
data included with this e-mail remains the property of Findel PLC and
the recipient will refrain from utilising the information for any
purpose other than that indicated and upon request will destroy the
information and remove it from their records. Any views or opinions
presented are solely those of the author and do not necessarily
represent those of Findel PLC. If you are not the intended recipient,
be advised that you have received this email in error and that any
use, dissemination, forwarding, printing, or copying of this email is
strictly prohibited. No warranties or assurances are made in relation
to the safety and content of this e-mail and any attachments. No
liability is accepted for any consequences arising from it. Findel Plc
reserves the right to monitor all e-mail communications through its
internal and external networks. If you have received this email in
error please notify our IT helpdesk on +44(0) 1254 303030

 
-- 

David Baldwin - Senior Systems Administrator (Datacentres + Networks)
Information and Communication Technology Services
Australian Sports Commission          http://ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          1 Leverrier Street Bruce ACT 2617
Our Values: RESPECT + INTEGRITY + TEAMWORK + EXCELLENCE


Keep up to date with what's happening in Australian sport visit http://www.ausport.gov.au

This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender.