[Check_mk (english)] agent for windows and Powershell scripts / agent error 1067

Hi,

i use check_mk for Linux and it works fine (check_mk is a great tool, thanks a lot Mathias and your team !!! ).

The next task is “windows monitoring” with check_mk (sadly, in this case exchange monitoring). I try it since couple of days. The “basic checks” works fine (cpu, hdd, wmi access via batch etc). Now I want use powershell scripts as Plugin for windows check_mk_agent.
My questions:

  1. Can I use Powershell-Scripts with windows check_mk_agent? Or works only vbs and batch scripts?
  2. Is the problem known?: If I wrote a script with mistakes (inadvertent :wink: ), after that hangs the agent. I can’t stop the agent. I can only do it via command line and “taskkill”. And after that I don’t can start the agent (I get an error: 1067). At the moment I must reboot the host. Has someone the same issue?

Agent: v1.1.11i1
Windows: Windows 2008 R2 Enterprise 64bit SP1, 4GB RAM

Thanks for your help / answers.
cu Jens

Think green - keep it on the screen.
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

#2 is a known issue. I think the windows agent needs to be rewritten using REUSE_ADDR, REUSE_PORT.

I have no knowledge on item 1

···

From: checkmk-en-bounces@lists.mathias-kettner.de [mailto:checkmk-en-bounces@lists.mathias-kettner.de]
On Behalf Of Fritsch, Jens
Sent: Wednesday, August 17, 2011 11:59 AM
To: checkmk-en@lists.mathias-kettner.de
Subject: [Check_mk (english)] agent for windows and Powershell scripts / agent error 1067

Hi,

i use check_mk for Linux and it works fine (check_mk is a great tool, thanks a lot Mathias and your team !!! ).

The next task is “windows monitoring” with check_mk (sadly, in this case exchange monitoring). I try it since couple of days. The “basic checks” works fine (cpu, hdd, wmi access via batch etc). Now I want use powershell scripts as Plugin for windows check_mk_agent.
My questions:

  1. Can I use Powershell-Scripts with windows check_mk_agent? Or works only vbs and batch scripts?
  2. Is the problem known?: If I wrote a script with mistakes (inadvertent :wink: ), after that hangs the agent. I can’t stop the agent. I can only do it via command line and “taskkill”. And after that I don’t can start the agent (I get an error: 1067). At the
    moment I must reboot the host. Has someone the same issue?

Agent: v1.1.11i1
Windows: Windows 2008 R2 Enterprise 64bit SP1, 4GB RAM

Thanks for your help / answers.
cu Jens

Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed
to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

AW: [Check_mk (english)] agent for windows and Powershell scripts /agent error 1067
Hi Scott,

Thanks for your quick answer. I thought too but I was not sure.

If I check it via command “netstat” on the windows host, I can see a status for the port 6556: “CLOSE_WAIT”.

Do you know a temporary solution? Maybe a command for the manually close for REUSE_ADDR, REUSE_PORT. Only a reboot is not a production solution. I’m sorry, windows is not really my main knowledge

cu Jens

···

-----Ursprüngliche Nachricht-----

Von: Lander, Scott [mailto:slander@hearstsc.com]

Gesendet: Mi 17.08.2011 18:08

An: Fritsch, Jens; checkmk-en@lists.mathias-kettner.de

Betreff: RE: [Check_mk (english)] agent for windows and Powershell scripts /agent error 1067

#2 is a known issue. I think the windows agent needs to be rewritten using REUSE_ADDR, REUSE_PORT.

I have no knowledge on item 1

From: checkmk-en-bounces@lists.mathias-kettner.de [mailto:checkmk-en-bounces@lists.mathias-kettner.de] On Behalf Of Fritsch, Jens

Sent: Wednesday, August 17, 2011 11:59 AM

To: checkmk-en@lists.mathias-kettner.de

Subject: [Check_mk (english)] agent for windows and Powershell scripts / agent error 1067

Hi,

i use check_mk for Linux and it works fine (check_mk is a great tool, thanks a lot Mathias and your team !!! ).

The next task is “windows monitoring” with check_mk (sadly, in this case exchange monitoring). I try it since couple of days. The “basic checks” works fine (cpu, hdd, wmi access via batch etc). Now I want use powershell scripts as Plugin for windows check_mk_agent.

My questions:

  1. Can I use Powershell-Scripts with windows check_mk_agent? Or works only vbs and batch scripts?

  2. Is the problem known?: If I wrote a script with mistakes (inadvertent :wink: ), after that hangs the agent. I can’t stop the agent. I can only do it via command line and “taskkill”. And after that I don’t can start the agent (I get an error: 1067). At the moment I must reboot the host. Has someone the same issue?

Agent: v1.1.11i1

Windows: Windows 2008 R2 Enterprise 64bit SP1, 4GB RAM

Thanks for your help / answers.

cu Jens

Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


This e-mail message is intended only for the personal use of the recipient(s) named above. If you are not an intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the Hearst Service Center (cadmin@hearstsc.com) immediately by email and delete the original message.


Think green - keep it on the screen.
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

Hi,

I’m also intressed to monitor exchange 2003 or performance counters using wmi, powershell etc.

Has anyone a example of a batch file using wmi or just PowerShell.

Eikelenboom, Hans
Servicebeheer en Beleid - ICT Beheer
Gemeente Alphen aan den Rijn
Stadhuisplein 1, , 2405 SH, Alphen aan den Rijn
T 465547 | M | F
E
HEikelenboom@alphenaandenrijn.nl | I

W http://www.alphenaandenrijn.nl

P ** * Please consider the environment before printing this e-mail***

Werkdagen: Ma,Di,Wo en Vr

Thanks in Advance

···

Van: checkmk-en-bounces@lists.mathias-kettner.de [mailto:checkmk-en-bounces@lists.mathias-kettner.de] Namens Fritsch, Jens
Verzonden: woensdag 17 augustus 2011 17:59
Aan:
checkmk-en@lists.mathias-kettner.de
Onderwerp: [Check_mk (english)] agent for windows and Powershell scripts /agent error 1067

Hi,

i use check_mk for Linux and it works fine (check_mk is a great tool, thanks a lot Mathias and your team !!! ).

The next task is “windows monitoring” with check_mk (sadly, in this case exchange monitoring). I try it since couple of days. The “basic checks” works fine (cpu, hdd, wmi access via batch etc). Now I want use powershell scripts as Plugin for windows check_mk_agent.
My questions:

  1. Can I use Powershell-Scripts with windows check_mk_agent? Or works only vbs and batch scripts?
  2. Is the problem known?: If I wrote a script with mistakes (inadvertent :wink: ), after that hangs the agent. I can’t stop the agent. I can only do it via command line and “taskkill”. And after that I don’t can start the agent (I get an error: 1067). At the moment I must reboot the host. Has someone the same issue?

Agent: v1.1.11i1
Windows: Windows 2008 R2 Enterprise 64bit SP1, 4GB RAM

Thanks for your help / answers.
cu Jens

Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

Sorry Jens – I have the exact same problem – not a ton of windows knowledge, and not able to reboot production boxes easily. So, I have several unmonitored
boxes right now……

Scott

···

From: Fritsch, Jens [mailto:jens.fritsch@logica.com]
Sent: Wednesday, August 17, 2011 1:57 PM
To: Lander, Scott; checkmk-en@lists.mathias-kettner.de
Subject: AW: [Check_mk (english)] agent for windows and Powershell scripts /agent error 1067

Hi Scott,

Thanks for your quick answer. I thought too but I was not sure.

If I check it via command “netstat” on the windows host, I can see a status for the port 6556: “CLOSE_WAIT”.

Do you know a temporary solution? Maybe a command for the manually close for REUSE_ADDR, REUSE_PORT. Only a reboot is not a production solution. I’m sorry, windows is not really my main knowledge

cu Jens

-----Ursprüngliche Nachricht-----

Von: Lander, Scott [mailto:slander@hearstsc.com]

Gesendet: Mi 17.08.2011 18:08

An: Fritsch, Jens; checkmk-en@lists.mathias-kettner.de

Betreff: RE: [Check_mk (english)] agent for windows and Powershell scripts /agent error 1067

#2 is a known issue. I think the windows agent needs to be rewritten using REUSE_ADDR, REUSE_PORT.

I have no knowledge on item 1

From: checkmk-en-bounces@lists.mathias-kettner.de [mailto:checkmk-en-bounces@lists.mathias-kettner.de] On Behalf Of Fritsch, Jens

Sent: Wednesday, August 17, 2011 11:59 AM

To: checkmk-en@lists.mathias-kettner.de

Subject: [Check_mk (english)] agent for windows and Powershell scripts / agent error 1067

Hi,

i use check_mk for Linux and it works fine (check_mk is a great tool, thanks a lot Mathias and your team !!! ).

The next task is “windows monitoring” with check_mk (sadly, in this case exchange monitoring). I try it since couple of days. The “basic checks” works fine (cpu, hdd, wmi access via batch etc). Now I want use powershell scripts as Plugin for windows check_mk_agent.

My questions:

  1. Can I use Powershell-Scripts with windows check_mk_agent? Or works only vbs and batch scripts?

  2. Is the problem known?: If I wrote a script with mistakes (inadvertent :wink: ), after that hangs the agent. I can’t stop the agent. I can only do it via command line and “taskkill”. And after that I don’t can start the agent (I get an error: 1067). At the
    moment I must reboot the host. Has someone the same issue?

Agent: v1.1.11i1

Windows: Windows 2008 R2 Enterprise 64bit SP1, 4GB RAM

Thanks for your help / answers.

cu Jens

Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed
to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


This e-mail message is intended only for the personal use of the recipient(s) named above. If you are not an intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the Hearst
Service Center (cadmin@hearstsc.com) immediately by email and delete the original message.


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed
to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

If you look in the windows plugin directory there are several vbs script examples provided. Anything that can return results as one or more lines of text
can be used as the agent, just by putting it in the plugins dir.

It should return something like

<<< checkname >>>

Instance name instance result

Next instance instance result

You then need to write the actual check that parses the results and resides on the check_mk server. That is pretty well documented in the check_mk docs.

Scott

···

From: checkmk-en-bounces@lists.mathias-kettner.de [mailto:checkmk-en-bounces@lists.mathias-kettner.de]
On Behalf Of Eikelenboom, Hans
Sent: Wednesday, August 17, 2011 2:41 PM
To: Fritsch, Jens; checkmk-en@lists.mathias-kettner.de
Subject: Re: [Check_mk (english)] agent for windows and Powershell scripts /agent error 1067

Hi,

I’m also intressed to monitor exchange 2003 or performance counters using wmi, powershell etc.

Has anyone a example of a batch file using wmi or just PowerShell.

Thanks in Advance

Eikelenboom, Hans
Servicebeheer en Beleid - ICT Beheer
Gemeente Alphen aan den Rijn
Stadhuisplein 1, , 2405 SH, Alphen aan den Rijn
T 465547 |
M |
F
E
HEikelenboom@alphenaandenrijn.nl |
I

Whttp://www.alphenaandenrijn.nl

P ** * Please consider the environment
before printing this e-mail***

Werkdagen: Ma,Di,Wo en Vr


Van: checkmk-en-bounces@lists.mathias-kettner.de
[mailto:checkmk-en-bounces@lists.mathias-kettner.de] Namens Fritsch, Jens
Verzonden: woensdag 17 augustus 2011 17:59
Aan: checkmk-en@lists.mathias-kettner.de
Onderwerp: [Check_mk (english)] agent for windows and Powershell scripts /agent error 1067

Hi,

i use check_mk for Linux and it works fine (check_mk is a great tool, thanks a lot Mathias and your team !!! ).

The next task is “windows monitoring” with check_mk (sadly, in this case exchange monitoring). I try it since couple of days. The “basic checks” works fine (cpu, hdd, wmi access via batch etc). Now I want use powershell scripts as Plugin for windows check_mk_agent.
My questions:

  1. Can I use Powershell-Scripts with windows check_mk_agent? Or works only vbs and batch scripts?
  2. Is the problem known?: If I wrote a script with mistakes (inadvertent :wink: ), after that hangs the agent. I can’t stop the agent. I can only do it via command line and “taskkill”. And after that I don’t can start the agent (I get an error: 1067). At the
    moment I must reboot the host. Has someone the same issue?

Agent: v1.1.11i1
Windows: Windows 2008 R2 Enterprise 64bit SP1, 4GB RAM

Thanks for your help / answers.
cu Jens

Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed
to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

AW: [Check_mk (english)] agent for windows and Powershell scripts /agent error 1067
Hi,

thats is the reason why I asked.

You can find a couple of powershell scripts for exchange checks (in my case for exchange 2010 e.g.: http://exchange.nagios.org/directory/Plugins/Email-and-Groupware/Microsoft-Exchange/Exchange-2010-CAS/details). Works check_mk_agent with powershell then we can rewrite the exist powershell code for check_mk_agent.

Mathias has a simple example for wmi check - wmichecks.bat: http://mathias-kettner.de/checkmk_windows.html (fyi: http://technet.microsoft.com/en-us/library/aa996078%28EXCHG.65%29.aspx)

···

-----Ursprüngliche Nachricht-----

Von: Eikelenboom, Hans [mailto:Heikelenboom@alphenaandenrijn.nl]

Gesendet: Mi 17.08.2011 20:40

An: Fritsch, Jens; checkmk-en@lists.mathias-kettner.de

Betreff: RE: [Check_mk (english)] agent for windows and Powershell scripts /agent error 1067

Hi,

I’m also intressed to monitor exchange 2003 or performance counters

using wmi, powershell etc.

Has anyone a example of a batch file using wmi or just PowerShell.

Thanks in Advance

Eikelenboom, Hans

Servicebeheer en Beleid - ICT Beheer

Gemeente Alphen aan den Rijn

Stadhuisplein 1, , 2405 SH, Alphen aan den Rijn

T 465547 | M | F

E HEikelenboom@alphenaandenrijn.nl | I

W http://www.alphenaandenrijn.nl <http://www.alphenaandenrijn.nl/>

P Please consider the environment before printing this e-mail

Werkdagen: Ma,Di,Wo en Vr


Van: checkmk-en-bounces@lists.mathias-kettner.de

[mailto:checkmk-en-bounces@lists.mathias-kettner.de] Namens Fritsch,

Jens

Verzonden: woensdag 17 augustus 2011 17:59

Aan: checkmk-en@lists.mathias-kettner.de

Onderwerp: [Check_mk (english)] agent for windows and Powershell scripts

/agent error 1067

Hi,

i use check_mk for Linux and it works fine (check_mk is a great tool,

thanks a lot Mathias and your team !!! ).

The next task is “windows monitoring” with check_mk (sadly, in this case

exchange monitoring). I try it since couple of days. The “basic checks”

works fine (cpu, hdd, wmi access via batch etc). Now I want use

powershell scripts as Plugin for windows check_mk_agent.

My questions:

  1. Can I use Powershell-Scripts with windows check_mk_agent? Or works

only vbs and batch scripts?

  1. Is the problem known?: If I wrote a script with mistakes (inadvertent

:wink: ), after that hangs the agent. I can’t stop the agent. I can only do

it via command line and “taskkill”. And after that I don’t can start

the agent (I get an error: 1067). At the moment I must reboot the host.

Has someone the same issue?

Agent: v1.1.11i1

Windows: Windows 2008 R2 Enterprise 64bit SP1, 4GB RAM

Thanks for your help / answers.

cu Jens

Think green - keep it on the screen. This e-mail and any attachment is

for authorised use by the intended recipient(s) only. It may contain

proprietary material, confidential information and/or be subject to

legal privilege. It should not be copied, disclosed to, retained or used

by, any other party. If you are not an intended recipient then please

promptly delete this e-mail and any attachment and all copies and inform

the sender. Thank you.

Think green - keep it on the screen.
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

Try TCPView from sysinternals

A nice script to mirror the sysinternal tools
http://blogs.microsoft.co.il/blogs/scriptfanatic/archive/2008/09/06/keep-in-sync-with-sysinternals-tools.aspx

If you go with powerscript think about the scripts should be signed by a trusted certificate you can disable the need for signed scripts but it can happen it will be activated again the time you install hotfixes (happed to me).

A god toolset for powerscripting: http://powergui.org/

···

On 2011-08-17 19:57, Fritsch, Jens wrote:

Hi Scott,
Thanks for your quick answer. I thought too but I was not sure.
If I check it via command "netstat" on the windows host, I can see a status for the port 6556: "CLOSE_WAIT".
Do you know a temporary solution? Maybe a command for the manually close for REUSE_ADDR, REUSE_PORT. Only a reboot is not a production solution. I'm sorry, windows is not really my main knowledge
cu Jens

--
Regards,
olli

-----Urspr�ngliche Nachricht-----
Von: Lander, Scott [mailto:slander@hearstsc.com]
Gesendet: Mi 17.08.2011 18:08
An: Fritsch, Jens; checkmk-en@lists.mathias-kettner.de
Betreff: RE: [Check_mk (english)] agent for windows and Powershell scripts /agent error 1067

#2 is a known issue. I think the windows agent needs to be rewritten using REUSE_ADDR, REUSE_PORT.

I have no knowledge on item 1

From: checkmk-en-bounces@lists.mathias-kettner.de [mailto:checkmk-en-bounces@lists.mathias-kettner.de] On Behalf Of Fritsch, Jens
Sent: Wednesday, August 17, 2011 11:59 AM
To: checkmk-en@lists.mathias-kettner.de
Subject: [Check_mk (english)] agent for windows and Powershell scripts / agent error 1067

Hi,

i use check_mk for Linux and it works fine (check_mk is a great tool, thanks a lot Mathias and your team !!! ).

The next task is "windows monitoring" with check_mk (sadly, in this case exchange monitoring). I try it since couple of days. The "basic checks" works fine (cpu, hdd, wmi access via batch etc). Now I want use powershell scripts as Plugin for windows check_mk_agent.
My questions:

1) Can I use Powershell-Scripts with windows check_mk_agent? Or works only vbs and batch scripts?
2) Is the problem known?: If I wrote a script with mistakes (inadvertent :wink: ), after that hangs the agent. I can't stop the agent. I can only do it via command line and "taskkill". And after that I don't can start the agent (I get an error: 1067). At the moment I must reboot the host. Has someone the same issue?

Agent: v1.1.11i1
Windows: Windows 2008 R2 Enterprise 64bit SP1, 4GB RAM

Thanks for your help / answers.
cu Jens

Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
------------------------------------------------------------------------------------
This e-mail message is intended only for the personal use of the recipient(s) named above. If you are not an intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the Hearst Service Center (cadmin@hearstsc.com) immediately by email and delete the original message.
------------------------------------------------------------------------------------

Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

Hello,

1:

I have no real experience with powershell scripts, but it should be the same as for the vbs thing.
By defaults the vbs scripts get opened in notepad in current windows installaions. Since the agent uses the default file handler for opening a plugin it opens a notepad for the plugin instead of executing the script. So we had to add a wrapper function to the agent which opens the vbs files with cscript interpreter.

I guess it is the same for the powershell scripts, right? So in the long term we should add a powershell wrapper to the agent.

In the short term you could try these ways:

- Make the powershell interpreter default file handler for the powershell scripts
- Another solution would be to create a wrapper batch script which runs the power shell script then

Regards,
Lars

···

On 17/08/11 17:59, Fritsch, Jens wrote:

Hi,

i use check_mk for Linux and it works fine (check_mk is a great tool, thanks a lot Mathias and your team !!! ).

The next task is "windows monitoring" with check_mk (sadly, in this case exchange monitoring). I try it since couple of days. The "basic checks" works fine (cpu, hdd, wmi access via batch etc). Now I want use powershell scripts as Plugin for windows check_mk_agent.
My questions:

1) Can I use Powershell-Scripts with windows check_mk_agent? Or works only vbs and batch scripts?
2) Is the problem known?: If I wrote a script with mistakes (inadvertent :wink: ), after that hangs the agent. I can't stop the agent. I can only do it via command line and "taskkill". And after that I don't can start the agent (I get an error: 1067). At the moment I must reboot the host. Has someone the same issue?

Agent: v1.1.11i1
Windows: Windows 2008 R2 Enterprise 64bit SP1, 4GB RAM

Thanks for your help / answers.
cu Jens

Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

Hello Jens,

1) Can I use Powershell-Scripts with windows check_mk_agent? Or works only vbs
and batch scripts?
2) Is the problem known?: If I wrote a script with mistakes (inadvertent :wink: ),
after that hangs the agent. I can't stop the agent. I can only do it via
command line and "taskkill". And after that I don't can start the agent (I get
an error: 1067). At the moment I must reboot the host. Has someone the same

yes, you could use powershell-scripts with the windows agent.

The problem is, that the file-extension for powershell-scripts is associated
with the "Editor" as the default action - so check_mk runs notepad.exe
instead of powershell.exe for this script.

Could you check if you have "notepad.exe" tasks in your process list /
task list?

I've had the same problem (powershell script plus hanging agent) just a few
hours ago.

Killing all notepad.exe processes solved the CLOSE_WAIT-problem on
port 6556 and let us (re)start the check_mk agent

(move any powershell-script away from the plugin-directory if you do
not want to get stuck again a few minutes later)

Greetings

Sebastian

Re: [Check_mk (english)] agent for windows and Powershell scripts / agent error 1067
Hi Sebastian,
regard error 1067 (check_mk_agent service start):
The hint “notepad.exe” is the solution. I tryed it and it works.

fyi (for all):

  1. mv powershell script with mistakes in the check_mk_agent plugin-directory
  2. after that has the check_mk_agent problems
  3. I try stop the check_mk_agent (but it doesn’t work).
  4. I kill the process with the command “Stop-Process -Id xxx” (Win 2008 R2)
  5. check via command netstat: port 6556 = Close_Wait
  6. I check the windows-taskmanager and saw the process notepad.exe (32bit)
  7. I killed this process
  8. and I start the check_mk_agent again → and works

Thanks a lot for the hint!

Jens

···

Von: checkmk-en-bounces@lists.mathias-kettner.de im Auftrag von Sebastian Talmon
Gesendet: Do 18.08.2011 00:11
An: checkmk-en@lists.mathias-kettner.de
Betreff: Re: [Check_mk (english)] agent for windows and Powershell scripts / agent error 1067

Hello Jens,

  1. Can I use Powershell-Scripts with windows check_mk_agent? Or works only vbs
    and batch scripts?
  2. Is the problem known?: If I wrote a script with mistakes (inadvertent :wink: ),
    after that hangs the agent. I can’t stop the agent. I can only do it via
    command line and “taskkill”. And after that I don’t can start the agent (I get
    an error: 1067). At the moment I must reboot the host. Has someone the same

yes, you could use powershell-scripts with the windows agent.

The problem is, that the file-extension for powershell-scripts is associated
with the “Editor” as the default action - so check_mk runs notepad.exe
instead of powershell.exe for this script.

Could you check if you have “notepad.exe” tasks in your process list /
task list?

I’ve had the same problem (powershell script plus hanging agent) just a few
hours ago.

Killing all notepad.exe processes solved the CLOSE_WAIT-problem on
port 6556 and let us (re)start the check_mk agent

(move any powershell-script away from the plugin-directory if you do
not want to get stuck again a few minutes later)

Greetings

Sebastian


checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

Think green - keep it on the screen.
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

Hi Scott,

have you tried to log into the Windows *console* and see if some
(error) window has popped open by your plugin? In that case
exactly that happens: The agent cannot be restarted. Simply
close that window and everything is fine again...

Mathias

···

Am 17.08.2011 20:42, schrieb Lander, Scott:

Sorry Jens � I have the exact same problem � not a ton of windows
knowledge, and not able to reboot production boxes easily. So, I have
several unmonitored boxes right now�..

Scott

*From:*Fritsch, Jens [mailto:jens.fritsch@logica.com]
*Sent:* Wednesday, August 17, 2011 1:57 PM
*To:* Lander, Scott; checkmk-en@lists.mathias-kettner.de
*Subject:* AW: [Check_mk (english)] agent for windows and Powershell
scripts /agent error 1067

Hi Scott,
Thanks for your quick answer. I thought too but I was not sure.
If I check it via command "netstat" on the windows host, I can see a
status for the port 6556: "CLOSE_WAIT".
Do you know a temporary solution? Maybe a command for the manually close
for REUSE_ADDR, REUSE_PORT. Only a reboot is not a production solution.
I'm sorry, windows is not really my main knowledge
cu Jens

-----Urspr�ngliche Nachricht-----
Von: Lander, Scott [mailto:slander@hearstsc.com]
Gesendet: Mi 17.08.2011 18:08
An: Fritsch, Jens; checkmk-en@lists.mathias-kettner.de
Betreff: RE: [Check_mk (english)] agent for windows and Powershell
scripts /agent error 1067

#2 is a known issue. I think the windows agent needs to be rewritten
using REUSE_ADDR, REUSE_PORT.

I have no knowledge on item 1

From: checkmk-en-bounces@lists.mathias-kettner.de
<mailto:checkmk-en-bounces@lists.mathias-kettner.de>
[mailto:checkmk-en-bounces@lists.mathias-kettner.de] On Behalf Of
Fritsch, Jens
Sent: Wednesday, August 17, 2011 11:59 AM
To: checkmk-en@lists.mathias-kettner.de
<mailto:checkmk-en@lists.mathias-kettner.de>
Subject: [Check_mk (english)] agent for windows and Powershell scripts /
agent error 1067

Hi,

i use check_mk for Linux and it works fine (check_mk is a great tool,
thanks a lot Mathias and your team !!! ).

The next task is "windows monitoring" with check_mk (sadly, in this case
exchange monitoring). I try it since couple of days. The "basic checks"
works fine (cpu, hdd, wmi access via batch etc). Now I want use
powershell scripts as Plugin for windows check_mk_agent.
My questions:

1) Can I use Powershell-Scripts with windows check_mk_agent? Or works
only vbs and batch scripts?
2) Is the problem known?: If I wrote a script with mistakes (inadvertent
:wink: ), after that hangs the agent. I can't stop the agent. I can only do
it via command line and "taskkill". And after that I don't can start the
agent (I get an error: 1067). At the moment I must reboot the host. Has
someone the same issue?

Agent: v1.1.11i1
Windows: Windows 2008 R2 Enterprise 64bit SP1, 4GB RAM

Thanks for your help / answers.
cu Jens

Think green - keep it on the screen. This e-mail and any attachment is
for authorised use by the intended recipient(s) only. It may contain
proprietary material, confidential information and/or be subject to
legal privilege. It should not be copied, disclosed to, retained or used
by, any other party. If you are not an intended recipient then please
promptly delete this e-mail and any attachment and all copies and inform
the sender. Thank you.
------------------------------------------------------------------------------------
This e-mail message is intended only for the personal use of the
recipient(s) named above. If you are not an intended recipient, you may
not review, copy or distribute this message. If you have received this
communication in error, please notify the Hearst Service Center
(cadmin@hearstsc.com <mailto:cadmin@hearstsc.com>) immediately by email
and delete the original message.
------------------------------------------------------------------------------------

Think green - keep it on the screen. This e-mail and any attachment is
for authorised use by the intended recipient(s) only. It may contain
proprietary material, confidential information and/or be subject to
legal privilege. It should not be copied, disclosed to, retained or used
by, any other party. If you are not an intended recipient then please
promptly delete this e-mail and any attachment and all copies and inform
the sender. Thank you.

------------------------------------------------------------------------------------
This e-mail message is intended only for the personal use of the
recipient(s) named above. If you are not an intended recipient, you may
not review, copy or distribute this message. If you have received this
communication in error, please notify the Hearst Service Center
(cadmin@hearstsc.com) immediately by email and delete the original message.
------------------------------------------------------------------------------------

_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

Hello List,

FYI: I have a pending change to the agent in progress. Still need to test
something.
Will push it today in the evening if everything works well.

Regards,
Lars

Hi Sebastian,
regard error 1067 (check_mk_agent service start):
The hint "notepad.exe" is the solution. I tryed it and it works.
fyi (for all):
1) mv powershell script with mistakes in the check_mk_agent
plugin-directory
2) after that has the check_mk_agent problems
3) I try stop the check_mk_agent (but it doesn't work).
4) I kill the process with the command "Stop-Process -Id xxx" (Win 2008

R2)

5) check via command netstat: port 6556 = Close_Wait
6) I check the windows-taskmanager and saw the process notepad.exe

(32bit)

7) I killed this process
8) and I start the check_mk_agent again -> and works

Thanks a lot for the hint!
Jens

________________________________

Von: checkmk-en-bounces@lists.mathias-kettner.de im Auftrag von

Sebastian

Talmon
Gesendet: Do 18.08.2011 00:11
An: checkmk-en@lists.mathias-kettner.de
Betreff: Re: [Check_mk (english)] agent for windows and Powershell

scripts

/ agent error 1067

Hello Jens,

1) Can I use Powershell-Scripts with windows check_mk_agent? Or works
only vbs
and batch scripts?
2) Is the problem known?: If I wrote a script with mistakes

(inadvertent

:wink: ),
after that hangs the agent. I can't stop the agent. I can only do it

via

command line and "taskkill". And after that I don't can start the agent
(I get
an error: 1067). At the moment I must reboot the host. Has someone the
same

yes, you could use powershell-scripts with the windows agent.

The problem is, that the file-extension for powershell-scripts is
associated
with the "Editor" as the default action - so check_mk runs notepad.exe
instead of powershell.exe for this script.

Could you check if you have "notepad.exe" tasks in your process list /
task list?

I've had the same problem (powershell script plus hanging agent) just a

few

hours ago.

Killing all notepad.exe processes solved the CLOSE_WAIT-problem on
port 6556 and let us (re)start the check_mk agent

(move any powershell-script away from the plugin-directory if you do
not want to get stuck again a few minutes later)

Greetings

Sebastian
_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be

copied,

···

On Thu, 18 Aug 2011 08:24:37 +0200, "Fritsch, Jens" <jens.fritsch@logica.com> wrote:

disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.

--

--
                       __ __ _ __
Mathias Kettner GmbH | \/ | |/ / M A T H I A S K E T T N E R
Lars Michelsen | |\/| | ' /
Preysingstr. 74 | | | | . \ Linux Beratung & Schulung
81667 München |_| |_|_|\_\ http://mathias-kettner.de
089 / 18 90 4210
lm@mathias-kettner.de

Hello List,

I applied the change to the current git HEAD. Please give it a go and give feedback if you experience any problems.

I hardcoded the following call for .ps1 scripts:

   powershell.exe -NoLogo -ExecutionPolicy RemoteSigned "& '<ps1-path>'"

Regards,
Lars

···

On 18/08/11 12:05, Lars Michelsen wrote:

Hello List,

FYI: I have a pending change to the agent in progress. Still need to test
something.
Will push it today in the evening if everything works well.

Regards,
Lars

On Thu, 18 Aug 2011 08:24:37 +0200, "Fritsch, Jens" > <jens.fritsch@logica.com> wrote:

Hi Sebastian,
regard error 1067 (check_mk_agent service start):
The hint "notepad.exe" is the solution. I tryed it and it works.
fyi (for all):
1) mv powershell script with mistakes in the check_mk_agent
plugin-directory
2) after that has the check_mk_agent problems
3) I try stop the check_mk_agent (but it doesn't work).
4) I kill the process with the command "Stop-Process -Id xxx" (Win 2008

R2)

5) check via command netstat: port 6556 = Close_Wait
6) I check the windows-taskmanager and saw the process notepad.exe

(32bit)

7) I killed this process
8) and I start the check_mk_agent again -> and works

Thanks a lot for the hint!
Jens

________________________________

Von: checkmk-en-bounces@lists.mathias-kettner.de im Auftrag von

Sebastian

Talmon
Gesendet: Do 18.08.2011 00:11
An: checkmk-en@lists.mathias-kettner.de
Betreff: Re: [Check_mk (english)] agent for windows and Powershell

scripts

/ agent error 1067

Hello Jens,

1) Can I use Powershell-Scripts with windows check_mk_agent? Or works
only vbs
and batch scripts?
2) Is the problem known?: If I wrote a script with mistakes

(inadvertent

:wink: ),
after that hangs the agent. I can't stop the agent. I can only do it

via

command line and "taskkill". And after that I don't can start the agent
(I get
an error: 1067). At the moment I must reboot the host. Has someone the
same

yes, you could use powershell-scripts with the windows agent.

The problem is, that the file-extension for powershell-scripts is
associated
with the "Editor" as the default action - so check_mk runs notepad.exe
instead of powershell.exe for this script.

Could you check if you have "notepad.exe" tasks in your process list /
task list?

I've had the same problem (powershell script plus hanging agent) just a

few

hours ago.

Killing all notepad.exe processes solved the CLOSE_WAIT-problem on
port 6556 and let us (re)start the check_mk agent

(move any powershell-script away from the plugin-directory if you do
not want to get stuck again a few minutes later)

Greetings

Sebastian
_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be

copied,

disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.

Re: [Check_mk (english)] agent for windows and Powershell scripts / agent error 1067
Hi Lars,

update / fyi:

I tryed the agent on a windows host since 4 days . The windows agent works fine mostly (~90%). I had a few known issues (error 1067), If I use own powershell scripts with syntax/code errors (therefore is a plugin test on a test system always important (: ).

But I think so, the function with ps1 files of the agent is fine now.

Currently I have another problems with powershell scripts and the check_mk_agent. The check_mk agent calls powershell.exe(32bit) for the ps1 scripts (standard). But the PSSnapin for MS Exchange2010 works only with powershell.exe 64bit. This observation is very interesting for monitoring MS Exchange 2010 server. I will open a new mailing thread for this issue.

Thanks Lars for your quick help and agent-modification.

Thanks Lars for your quick help and agent-modification.

configuration details:

Windows host:

  • Windows 2008 R2 64bit server (with all MS Exchange 2010 roles for test)

  • plugins; batch and powershell scripts

<<<check_mk>>> (agent)
Version: 1.1.11i2
AgentOS: windows
WorkingDirectory: C:\Windows\system32
ConfigFile: c:\Program Files (x86)\check_mk\check_mk.ini
AgentDirectory: c:\Program Files (x86)\check_mk
PluginsDirectory: c:\Program Files (x86)\check_mk\plugins
LocalDirectory: c:\Program Files (x86)\check_mk\local

···

Von: checkmk-en-bounces@lists.mathias-kettner.de im Auftrag von Lars Michelsen
Gesendet: Do 18.08.2011 20:12
An: checkmk-en@lists.mathias-kettner.de
Betreff: Re: [Check_mk (english)] agent for windows and Powershell scripts / agent error 1067

Hello List,

I applied the change to the current git HEAD. Please give it a go and
give feedback if you experience any problems.

I hardcoded the following call for .ps1 scripts:

powershell.exe -NoLogo -ExecutionPolicy RemoteSigned “& ‘’”

Regards,
Lars

On 18/08/11 12:05, Lars Michelsen wrote:

Hello List,

FYI: I have a pending change to the agent in progress. Still need to test
something.
Will push it today in the evening if everything works well.

Regards,
Lars

On Thu, 18 Aug 2011 08:24:37 +0200, “Fritsch, Jens” > jens.fritsch@logica.com wrote:

Hi Sebastian,
regard error 1067 (check_mk_agent service start):
The hint “notepad.exe” is the solution. I tryed it and it works.
fyi (for all):

  1. mv powershell script with mistakes in the check_mk_agent
    plugin-directory
  2. after that has the check_mk_agent problems
  3. I try stop the check_mk_agent (but it doesn’t work).
  4. I kill the process with the command “Stop-Process -Id xxx” (Win 2008
    R2)
  5. check via command netstat: port 6556 = Close_Wait
  6. I check the windows-taskmanager and saw the process notepad.exe
    (32bit)
  7. I killed this process
  8. and I start the check_mk_agent again → and works

Thanks a lot for the hint!
Jens


Von: checkmk-en-bounces@lists.mathias-kettner.de im Auftrag von
Sebastian
Talmon
Gesendet: Do 18.08.2011 00:11
An: checkmk-en@lists.mathias-kettner.de
Betreff: Re: [Check_mk (english)] agent for windows and Powershell
scripts
/ agent error 1067

Hello Jens,

  1. Can I use Powershell-Scripts with windows check_mk_agent? Or works
    only vbs
    and batch scripts?
  2. Is the problem known?: If I wrote a script with mistakes
    (inadvertent
    :wink: ),
    after that hangs the agent. I can’t stop the agent. I can only do it
    via
    command line and “taskkill”. And after that I don’t can start the agent
    (I get
    an error: 1067). At the moment I must reboot the host. Has someone the
    same

yes, you could use powershell-scripts with the windows agent.

The problem is, that the file-extension for powershell-scripts is
associated
with the “Editor” as the default action - so check_mk runs notepad.exe
instead of powershell.exe for this script.

Could you check if you have “notepad.exe” tasks in your process list /
task list?

I’ve had the same problem (powershell script plus hanging agent) just a
few
hours ago.

Killing all notepad.exe processes solved the CLOSE_WAIT-problem on
port 6556 and let us (re)start the check_mk agent

(move any powershell-script away from the plugin-directory if you do
not want to get stuck again a few minutes later)

Greetings

Sebastian


checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be
copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.


checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

Think green - keep it on the screen.
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.