[Check_mk (english)] Problem with local powershell script

Hi all,

I have a simple local check written in powershell making a query to an oracle DB. The script runs fine in Powershell(32bit) but fails in powershell(64bit) as below.

Exception calling “Open” with “0” argument(s): "Attempt to load Oracle client libraries threw BadImageFormatException.

This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed."

Not a problem I though as I would simple use a batch file in the local folder to execute the script using the 32bit version of powershell(as below)

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Powershell.exe -executionpolicy remotesigned -File “C:\Program Files (x86)\check_mk\mi_scripts\mi_MTW_proc_check.ps1”

However, for some reason when this runs under the agent, I get the exact same error I was getting when running the script under 64bit powershell.

What is going on here, the agent is 1.2.4p5 (32bit) and the call to powershell is using the 32bit version, so why the 64bit error??

Any help/suggestions much appreciated.

Thanks

Mark

image001.gif

···

Mark Dollemore

Global Operations

mark.dollemore@man.com

Tel +44 20 7144 3749

Mob 07762893260

Man Group UK Limited |

Registered address: Riverbank House, 2 Swan Lane, London EC4R 3AD, United Kingdom

Registered in England and Wales no. 5856654

Visit us at:
www.man.com

Ignore this I have found a solution;-

Use the following to launch the powershell and everything works fine;-

C:\Windows\sysnative\WindowsPowerShell\v1.0\Powershell.exe -executionpolicy remotesigned -File “C:\Program Files (x86)\check_mk\mi_scripts\mi_MTW_proc_check.ps1”

Just incase anyone else wastes an afternoon trying to get a similar thing to work…

Cheers

Mark

image001.gif

···

From: checkmk-en-bounces@lists.mathias-kettner.de
[mailto:checkmk-en-bounces@lists.mathias-kettner.de] On Behalf Of Dollemore, Mark (London)©
Sent: 21 March 2016 15:54
To: checkmk-en@lists.mathias-kettner.de
Subject: [Check_mk (english)] Problem with local powershell script

Hi all,

I have a simple local check written in powershell making a query to an oracle DB. The script runs fine in Powershell(32bit) but fails in powershell(64bit) as below.

Exception calling “Open” with “0” argument(s): "Attempt to load Oracle client libraries threw BadImageFormatException.

This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed."

Not a problem I though as I would simple use a batch file in the local folder to execute the script using the 32bit version of powershell(as below)

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Powershell.exe -executionpolicy remotesigned -File “C:\Program Files (x86)\check_mk\mi_scripts\mi_MTW_proc_check.ps1”

However, for some reason when this runs under the agent, I get the exact same error I was getting when running the script under 64bit powershell.

What is going on here, the agent is 1.2.4p5 (32bit) and the call to powershell is using the 32bit version, so why the 64bit error??

Any help/suggestions much appreciated.

Thanks

Mark

Mark Dollemore

Global Operations

mark.dollemore@man.com

Tel +44 20 7144 3749

Mob 07762893260

Man Group UK Limited |

Registered address: Riverbank House, 2 Swan Lane, London EC4R 3AD, United Kingdom

Registered in England and Wales no. 5856654

Visit us at:
www.man.com

This email has been sent by a member of the Man group (“Man”). Man’s parent company, Man Group plc, is registered in England and Wales (company number 08172396) at Riverbank House,
2 Swan Lane, London, EC4R 3AD.

The contents of this email are for the named addressee(s) only. It contains information which may be confidential and privileged. If you are not the intended recipient, please notify the sender immediately, destroy this email and any attachments and do not
otherwise disclose or use them. Email transmission is not a secure method of communication and Man cannot accept responsibility for the completeness or accuracy of this email or any attachments. Whilst Man makes every effort to keep its network free from viruses,
it does not accept responsibility for any computer virus which might be transferred by way of this email or any attachments. This email does not constitute a request, offer, recommendation or solicitation of any kind to buy, subscribe, sell or redeem any investment
instruments or to perform other such transactions of any kind. Man reserves the right to monitor, record and retain all electronic and telephone communications through its network in accordance with applicable laws and regulations.
–UwQe9f5k7pI3vplngP