Xymon Mailing List Archive search

Powershell external scripts

7 messages in this thread

list Steve Brown · Fri, 30 Jun 2017 03:13:59 +0000 ·
Hi,
What format to external scripts <externalscriptlocation> need to be?  Can they be windows bat files or do they need to be powershell .ps1 scripts or something else?
Thanks
Steve
list David Boyer · Sun, 2 Jul 2017 15:59:22 -0400 ·
The "<externalscriptlocation>" is the folder where the scripts are located.
They can be written in anything you like.


Dave
quoted from Steve Brown

On Thu, Jun 29, 2017 at 11:13 PM, Steve Brown <user-a23886790dfc@xymon.invalid> wrote:
Hi,

What format to external scripts <externalscriptlocation> need to be?  Can
they be windows bat files or do they need to be powershell .ps1 scripts or
something else?

Thanks

Steve

list Steve Brown · Mon, 3 Jul 2017 14:53:56 +0000 ·
Thank you for the reply. I have a bat file in the "<externalscriptlocation>" folder but it is not being executed. If I schedule it through the Windows Task scheduler it does get executed.  Is there something else I need to do in the xymon powershell to have it execute the bat file?  It appears I’m missing something.
Thank you for your help
Steve
quoted from David Boyer

From: David Boyer [mailto:user-a6c09f28d9d2@xymon.invalid]
Sent: Sunday, July 02, 2017 2:59 PM
To: Steve Brown <user-a23886790dfc@xymon.invalid>
Cc: xymon at xymon.com
Subject: Re: [Xymon] Powershell external scripts

The "<externalscriptlocation>" is the folder where the scripts are located. They can be written in anything you like.

Dave

On Thu, Jun 29, 2017 at 11:13 PM, Steve Brown <user-a23886790dfc@xymon.invalid<mailto:user-a23886790dfc@xymon.invalid>> wrote:
Hi,
What format to external scripts <externalscriptlocation> need to be?  Can they be windows bat files or do they need to be powershell .ps1 scripts or something else?
Thanks
Steve
list Zak Beck · Mon, 3 Jul 2017 15:33:12 +0000 ·
Hi

If you’re using XymonPSClient, you need to tell the client to execute it. You do this via configuration on the server in client-local.cfg, something like this:

[hostname]
external:everyscan:sync:batchfile.bat

I think that should work! If you want to get more advanced, you can also have the client download the batch file from a web server and this enables you to update the batch file remotely (see the doc file).

Zak
quoted from Steve Brown

From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Steve Brown
Sent: 03 July 2017 15:54
To: David Boyer <user-a6c09f28d9d2@xymon.invalid>
Cc: xymon at xymon.com
Subject: [External] Re: [Xymon] Powershell external scripts

Thank you for the reply. I have a bat file in the "<externalscriptlocation>" folder but it is not being executed. If I schedule it through the Windows Task scheduler it does get executed.  Is there something else I need to do in the xymon powershell to have it execute the bat file?  It appears I’m missing something.
Thank you for your help
Steve

From: David Boyer [mailto:user-a6c09f28d9d2@xymon.invalid]
Sent: Sunday, July 02, 2017 2:59 PM
To: Steve Brown <user-a23886790dfc@xymon.invalid<mailto:user-a23886790dfc@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] Powershell external scripts

The "<externalscriptlocation>" is the folder where the scripts are located. They can be written in anything you like.
Dave

On Thu, Jun 29, 2017 at 11:13 PM, Steve Brown <user-a23886790dfc@xymon.invalid<mailto:user-a23886790dfc@xymon.invalid>> wrote:
Hi,
What format to external scripts <externalscriptlocation> need to be?  Can they be windows bat files or do they need to be powershell .ps1 scripts or something else?
Thanks
Steve


Xymon at xymon.com<https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.xymon.com_mailman_listinfo_xymon&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=LpEH5mi4BBdGxqvJGmLapbOSpq299arjLUfbVo98MsE&s=Zitmt7g1XCELmzuj1X33oPX_CipHyQRPoEkHECmMzvA&e=>;


This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

www.accenture.com
list David Boyer · Mon, 3 Jul 2017 12:23:40 -0400 ·
Zak,

    Given this entry:

[hostname]
external:everyscan:sync:batchfile.bat

Where would the batchfile.bat located on the Xymon Server?  Would it be in
the HOME directory of ~xymon/server/etc?


Dave
quoted from Zak Beck

On Mon, Jul 3, 2017 at 11:33 AM, Beck, Zak <user-aada0fa38bf8@xymon.invalid> wrote:
Hi


If you’re using XymonPSClient, you need to tell the client to execute it.
You do this via configuration on the server in client-local.cfg, something
like this:


[hostname]

external:everyscan:sync:batchfile.bat


I think that should work! If you want to get more advanced, you can also
have the client download the batch file from a web server and this enables
you to update the batch file remotely (see the doc file).


Zak


*From:* Xymon [mailto:xymon-bounces at xymon.com] *On Behalf Of *Steve Brown
*Sent:* 03 July 2017 15:54
*To:* David Boyer <user-a6c09f28d9d2@xymon.invalid>
*Cc:* xymon at xymon.com
*Subject:* [External] Re: [Xymon] Powershell external scripts


Thank you for the reply. I have a bat file in the
"<externalscriptlocation>" folder but it is not being executed. If I
schedule it through the Windows Task scheduler it does get executed.  Is
there something else I need to do in the xymon powershell to have it
execute the bat file?  It appears I’m missing something.

Thank you for your help

Steve


*From:* David Boyer [mailto:user-a6c09f28d9d2@xymon.invalid <user-a6c09f28d9d2@xymon.invalid>]
quoted from Zak Beck
*Sent:* Sunday, July 02, 2017 2:59 PM
*To:* Steve Brown <user-a23886790dfc@xymon.invalid>
*Cc:* xymon at xymon.com
*Subject:* Re: [Xymon] Powershell external scripts


The "<externalscriptlocation>" is the folder where the scripts are
located. They can be written in anything you like.

Dave


On Thu, Jun 29, 2017 at 11:13 PM, Steve Brown <user-a23886790dfc@xymon.invalid> wrote:

Hi,

What format to external scripts <externalscriptlocation> need to be?  Can
they be windows bat files or do they need to be powershell .ps1 scripts or
something else?

Thanks

Steve


<https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.xymon.com_mailman_listinfo_xymon&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=LpEH5mi4BBdGxqvJGmLapbOSpq299arjLUfbVo98MsE&s=Zitmt7g1XCELmzuj1X33oPX_CipHyQRPoEkHECmMzvA&e=>;
quoted from Zak Beck


This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise confidential information. If you have
received it in error, please notify the sender immediately and delete the
original. Any other use of the e-mail by you is prohibited. Where allowed
by local law, electronic communications with Accenture and its affiliates,
including e-mail and instant messaging (including content), may be scanned
by our systems for the purposes of information security and assessment of
internal compliance with Accenture policy.

www.accenture.com
list Steve Brown · Mon, 3 Jul 2017 17:21:50 +0000 ·
Thank you Zak. The bat file is executing now.
David, the batchfile.bat is located in the <externalscriptlocation> folder
quoted from David Boyer
Steve

From: David Boyer [mailto:user-a6c09f28d9d2@xymon.invalid]
Sent: Monday, July 03, 2017 11:24 AM
To: Beck, Zak <user-aada0fa38bf8@xymon.invalid>
Cc: Steve Brown <user-a23886790dfc@xymon.invalid>; xymon at xymon.com
Subject: Re: [Xymon] Powershell external scripts

Zak,
    Given this entry:
[hostname]
external:everyscan:sync:batchfile.bat
Where would the batchfile.bat located on the Xymon Server?  Would it be in the HOME directory of ~xymon/server/etc?

Dave

On Mon, Jul 3, 2017 at 11:33 AM, Beck, Zak <user-aada0fa38bf8@xymon.invalid<mailto:user-aada0fa38bf8@xymon.invalid>> wrote:
Hi

If you’re using XymonPSClient, you need to tell the client to execute it. You do this via configuration on the server in client-local.cfg, something like this:

[hostname]
external:everyscan:sync:batchfile.bat

I think that should work! If you want to get more advanced, you can also have the client download the batch file from a web server and this enables you to update the batch file remotely (see the doc file).

Zak

From: Xymon [mailto:xymon-bounces at xymon.com<mailto:xymon-bounces at xymon.com>] On Behalf Of Steve Brown
Sent: 03 July 2017 15:54
To: David Boyer <user-a6c09f28d9d2@xymon.invalid<mailto:user-a6c09f28d9d2@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: [External] Re: [Xymon] Powershell external scripts

Thank you for the reply. I have a bat file in the "<externalscriptlocation>" folder but it is not being executed. If I schedule it through the Windows Task scheduler it does get executed.  Is there something else I need to do in the xymon powershell to have it execute the bat file?  It appears I’m missing something.
Thank you for your help
Steve

From: David Boyer [mailto:user-a6c09f28d9d2@xymon.invalid]
Sent: Sunday, July 02, 2017 2:59 PM
To: Steve Brown <user-a23886790dfc@xymon.invalid<mailto:user-a23886790dfc@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] Powershell external scripts

The "<externalscriptlocation>" is the folder where the scripts are located. They can be written in anything you like.
Dave

On Thu, Jun 29, 2017 at 11:13 PM, Steve Brown <user-a23886790dfc@xymon.invalid<mailto:user-a23886790dfc@xymon.invalid>> wrote:
Hi,
What format to external scripts <externalscriptlocation> need to be?  Can they be windows bat files or do they need to be powershell .ps1 scripts or something else?
Thanks
Steve


Xymon at xymon.com<https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.xymon.com_mailman_listinfo_xymon&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=LpEH5mi4BBdGxqvJGmLapbOSpq299arjLUfbVo98MsE&s=Zitmt7g1XCELmzuj1X33oPX_CipHyQRPoEkHECmMzvA&e=>;


This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

www.accenture.com<http://www.accenture.com>;
list Zak Beck · Tue, 4 Jul 2017 08:01:37 +0000 ·
Hi

The example given does not enable the download from server option – it expects the batch file to be present in the <externalscriptlocation> as you mentioned before.

To enable server downloads, it needs to be something like this (untested):

external:everyscan:sync:http://server1/XymonPS/script.bat|MD5|536476abc234c3c1|script.bat

The client uses the hash (which can be SHA1, SHA256 or MD5) to work out whether or not the script needs redownloading.

This (and other examples) are in the doc, towards the end, under ‘external’.

On the server, you need a directory that will be served up by the webserver. On our setup, we added a directory and configured Apache appropriately.

Thanks

Zak
quoted from David Boyer

From: David Boyer [mailto:user-a6c09f28d9d2@xymon.invalid]
Sent: 03 July 2017 17:24
To: Beck, Zak <user-aada0fa38bf8@xymon.invalid>
Cc: Steve Brown <user-a23886790dfc@xymon.invalid>; xymon at xymon.com
Subject: [External] Re: [Xymon] Powershell external scripts

Zak,
    Given this entry:
[hostname]
external:everyscan:sync:batchfile.bat
Where would the batchfile.bat located on the Xymon Server?  Would it be in the HOME directory of ~xymon/server/etc?

Dave

On Mon, Jul 3, 2017 at 11:33 AM, Beck, Zak <user-aada0fa38bf8@xymon.invalid<mailto:user-aada0fa38bf8@xymon.invalid>> wrote:
Hi

If you’re using XymonPSClient, you need to tell the client to execute it. You do this via configuration on the server in client-local.cfg, something like this:

[hostname]
external:everyscan:sync:batchfile.bat

I think that should work! If you want to get more advanced, you can also have the client download the batch file from a web server and this enables you to update the batch file remotely (see the doc file).

Zak

From: Xymon [mailto:xymon-bounces at xymon.com<mailto:xymon-bounces at xymon.com>] On Behalf Of Steve Brown
Sent: 03 July 2017 15:54
To: David Boyer <user-a6c09f28d9d2@xymon.invalid<mailto:user-a6c09f28d9d2@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: [External] Re: [Xymon] Powershell external scripts

Thank you for the reply. I have a bat file in the "<externalscriptlocation>" folder but it is not being executed. If I schedule it through the Windows Task scheduler it does get executed.  Is there something else I need to do in the xymon powershell to have it execute the bat file?  It appears I’m missing something.
Thank you for your help
Steve

From: David Boyer [mailto:user-a6c09f28d9d2@xymon.invalid]
Sent: Sunday, July 02, 2017 2:59 PM
To: Steve Brown <user-a23886790dfc@xymon.invalid<mailto:user-a23886790dfc@xymon.invalid>>
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] Powershell external scripts

The "<externalscriptlocation>" is the folder where the scripts are located. They can be written in anything you like.
Dave

On Thu, Jun 29, 2017 at 11:13 PM, Steve Brown <user-a23886790dfc@xymon.invalid<mailto:user-a23886790dfc@xymon.invalid>> wrote:
Hi,
What format to external scripts <externalscriptlocation> need to be?  Can they be windows bat files or do they need to be powershell .ps1 scripts or something else?
Thanks
Steve


Xymon at xymon.com<https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.xymon.com_mailman_listinfo_xymon&d=DwMGaQ&c=eIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU&r=S-aLwpx-PHBTBMIG_c2JczRC0SfuZCmsiH9Iams25FI&m=LpEH5mi4BBdGxqvJGmLapbOSpq299arjLUfbVo98MsE&s=Zitmt7g1XCELmzuj1X33oPX_CipHyQRPoEkHECmMzvA&e=>;


This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

www.accenture.com<http://www.accenture.com>;