New Lines in Return of Performance Data


(Christian) #1

Hello there,

i am writing a custom plugin which is returning performance data of IIS servers. The plugin is written in powershell and I am using NRPE to trigger it. This is working great with Windows Server 2012, but with Windows Server 2008 I do have the problem, that the returned performance data is including more new lines and icinga2 is only able to interpret the first line…

For example:
Ok| ‘DWS2_GET’=394 ‘DWS2_POST’=200 ‘DWS2_HEAD’=0 ‘DWS2_PROPFIND’=0 ‘DWS2_PROPP
ATCH’=0 ‘DWS2_OPTIONS’=0 ‘DWS2_COPY’=0 ‘DWS2_DELETE’=0 ‘DWS2_MOVE’=0 ‘DWS2_PUT’
=0 ‘DWS2_TRACE’=0 ‘DWS2_SEARCH’=0 ‘DWS2_LOCK’=0 ‘DWS2_UNLOCK’=0 ‘DWS2_MKCOL’=0
’DWS2_Other’=0 ‘DWS2_Aktuelle Verbindungen’=0 ‘DWS2_Maximale Anzahl Verbindunge
n’=16 ‘DWS2_Verbindungsversuche Insgesamt’=85 ‘DWS2_Fehler Nicht gefunden’=9 ‘B
ISS_Sperrfehler’=0 ‘DWS2_ISAPI Erweiterungsanforderungen’=0 ‘DWS2_CGI Anforderu
ngen’=0 ‘DWS2_Anforderungen aller Methoden’=594 ‘Default Web Site_GET’=0 ‘Defau
lt Web Site_POST’=0 ‘Default Web Site_HEAD’=0 ‘Default Web Site_PROPFIND’=0 ‘De
fault Web Site_PROPPATCH’=0 ‘Default Web Site_OPTIONS’=0 ‘Default Web Site_COPY
’=0 ‘Default Web Site_DELETE’=0 ‘Default Web Site_MOVE’=0 ‘Default Web Site_PUT
’=0 ‘Default Web Site_TRACE’=0 ‘Default Web Site_SEARCH’=0 ‘Default Web Site_LO
CK’=0 ‘Default Web Site_UNLOCK’=0 ‘Default Web Site_MKCOL’=0 ‘Default Web Site_
Other’=0 ‘Default Web Site_Aktuelle Verbindungen’=0

With Server 2012 it is:

Ok| ‘Default Web Site_GET’=0 ‘Default Web Site_POST’=1978 ‘Default Web Site_HEAD’=0 ‘Default Web Site_PROPFIND’=0 ‘Default Web Site_PROPPATCH’=0 ‘Default Web Site_OPTIONS’=0 ‘Default Web Site_COPY’=0 ‘Default Web Site_DELETE’=0 ‘Default Web Site_MOVE’=0 ‘Default Web Site_PUT’=0 ‘Default Web Site_TRACE’=0 ‘Default Web Site_SEARCH’=0 ‘Default Web Site_LOCK’=0 ‘Default Web Site_UNLOCK’=0 ‘Default Web Site_MKCOL’=0 ‘Default Web Site_Other’=0 ‘Default Web Site_Aktuelle Verbindungen’=0 ‘Default Web Site_Maximale Anzahl Verbindungen’=2 ‘Default Web Site_Verbindungsversuche Insgesamt’=1949 ‘Default Web Site_Fehler Nicht gefunden’=0 ‘Default Web Site_Sperrfehler’=0 ‘Default Web Site_ISAPI Erweiterungsanforderungen’=0 ‘Default Web Site_CGI Anforderungen’=0 ‘Default Web Site_Anforderungen aller Methoden’=1978

Do you have any idea?


#2

You might take a look here although I’m unsure whether this has been tested before…


(Christian) #3

I have tried much but icinga is not recognizing my multiline perfdata. Do you have any idea?

I have build the same like it is written there. But icinga is just using “testdata=1”

Ok;| testdata=1
longerok; | ‘Default Web Site_GET’=0
’Default Web Site_POST’=2015
’Default Web Site_HEAD’=0
’Default Web Site_PROPFIND’=0
’Default Web Site_PROPPATCH’=0
’Default Web Site_OPTIONS’=0
’Default Web Site_COPY’=0
’Default Web Site_DELETE’=0
’Default Web Site_MOVE’=0
’Default Web Site_PUT’=0
’Default Web Site_TRACE’=0
’Default Web Site_SEARCH’=0
’Default Web Site_LOCK’=0
’Default Web Site_UNLOCK’=0
’Default Web Site_MKCOL’=0
’Default Web Site_Other’=0
’Default Web Site_Aktuelle Verbindungen’=0
’Default Web Site_Maximale Anzahl Verbindungen’=2
’Default Web Site_Verbindungsversuche Insgesamt’=1983
’Default Web Site_Fehler Nicht gefunden’=0
’Default Web Site_Sperrfehler’=0
’Default Web Site_ISAPI Erweiterungsanforderungen’=0
’Default Web Site_CGI Anforderungen’=0
’Default Web Site_Anforderungen aller Methoden’=2015

And if I am doing this, just ‘Default Web Site_GET’=0 is used. The others are used for serviceoutput.

Ok | ‘Default Web Site_GET’=0
’Default Web Site_POST’=2015
’Default Web Site_HEAD’=0
’Default Web Site_PROPFIND’=0
’Default Web Site_PROPPATCH’=0
’Default Web Site_OPTIONS’=0
’Default Web Site_COPY’=0
’Default Web Site_DELETE’=0
’Default Web Site_MOVE’=0
’Default Web Site_PUT’=0
’Default Web Site_TRACE’=0
’Default Web Site_SEARCH’=0
’Default Web Site_LOCK’=0
’Default Web Site_UNLOCK’=0
’Default Web Site_MKCOL’=0
’Default Web Site_Other’=0
’Default Web Site_Aktuelle Verbindungen’=0
’Default Web Site_Maximale Anzahl Verbindungen’=2
’Default Web Site_Verbindungsversuche Insgesamt’=1983
’Default Web Site_Fehler Nicht gefunden’=0
’Default Web Site_Sperrfehler’=0
’Default Web Site_ISAPI Erweiterungsanforderungen’=0
’Default Web Site_CGI Anforderungen’=0
’Default Web Site_Anforderungen aller Methoden’=2015


(Christian) #4

I was able to fix my problem by changing some values in my powershell script:

$console = $host.UI.RawUI
$buffer = $console.BufferSize
$buffer.Width = 2000
$buffer.Height = 2000
$console.BufferSize = $buffer

Thanks!


(Michael Friedrich) #5

Ah cool, glad you’ve solved it by yourself :muscle: