Discussion:
[Check_mk (english)] Simple script in Powershell
(too old to reply)
Daniel Niemczok
2017-12-29 10:04:00 UTC
Permalink
Raw Message
hi,
I would like to write a simple Powershell script that recognizes Status. Eg.

# script.ps1

$dn = 1

if ($dn -eq 1) {
Write-Host "OK queued"
exit 0
} elseif ($dn -eq 2) {
Write-Host "WARNING - queued"
exit 1
} elseif ($dn -eq 3) {
Write-Host "CRITICAL - queued"
exit 2
} else {
Write-Host "UNKNOWN - queue returned "
exit 3

However, he gets the message all the time:

UNKN -
<http://81.2.239.25/prod/check_mk/view.py?host=w10t1&service=-&site=prod&view_name=service>
UNKNOWN - Invalid performance data Do in local check output OK queued

However, he does not recognize the status

Thank you for your help
--
, POZDRAWIAM

Daniel Niemczok <https://about.me/danielniemczok>
Robert Sander
2017-12-29 10:42:29 UTC
Permalink
Raw Message
Hi,
Post by Daniel Niemczok
UNKNOWN - Invalid performance data Do in local check output OK queued
when you place that script in the local directory the output has to
conform to the specification for local checks:

http://mathias-kettner.com/cms_localchecks.html

Regards
--
Robert Sander
Heinlein Support GmbH
Linux: Akademie - Support - Hosting
http://www.heinlein-support.de

Tel: 030-405051-43
Fax: 030-405051-19

Zwangsangaben lt. §35a GmbHG:
HRB 93818 B / Amtsgericht Berlin-Charlottenburg,
GeschÀftsfÌhrer: Peer Heinlein -- Sitz: Berlin
Andreas Döhler
2017-12-29 19:41:26 UTC
Permalink
Raw Message
As extra comment to the answer from Robert you should also consider to use
the
dynamic status calculation like it is described in the linked webpage under
point
3.4. Calculating status dynamically

best regards
Andreas
Post by Daniel Niemczok
hi,
I would like to write a simple Powershell script that recognizes Status. Eg.
# script.ps1
$dn = 1
if ($dn -eq 1) {
Write-Host "OK queued"
exit 0
} elseif ($dn -eq 2) {
Write-Host "WARNING - queued"
exit 1
} elseif ($dn -eq 3) {
Write-Host "CRITICAL - queued"
exit 2
} else {
Write-Host "UNKNOWN - queue returned "
exit 3
UNKN -
<http://81.2.239.25/prod/check_mk/view.py?host=w10t1&service=-&site=prod&view_name=service>
UNKNOWN - Invalid performance data Do in local check output OK queued
However, he does not recognize the status
Thank you for your help
--
, POZDRAWIAM
Daniel Niemczok <https://about.me/danielniemczok>
_______________________________________________
checkmk-en mailing list
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
Loading...