Re: [Nagios-devel] ADAPTIVE CHECK CHANGE_SVC_CHECK_COMMAND

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] ADAPTIVE CHECK CHANGE_SVC_CHECK_COMMAND

Post by Guest »

This is a multi-part message in MIME format.
--------------080300010407040209070608
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 14.01.2013 13:20, Javier Garces Asensio wrote:
> I wanted to use a check with warning and critical values specific
> in hours of production and other values outside production hours

That yells "wrapper script" to me.

The attached one lacks proper documentation, syntax help etc., so here's
a bunch of examples (essentially the same call, but with three different
sets of limits applied due to the advancing time, and three different
service states returned because of that):


> # date ; /usr/local/nagios/libexec/check_varlimits --varlimits-debug \
> > check_http @144020=3D0.01+0.3@144030=3D0.01+0.03@144040=3D0.5+0.7 -H =
www.google.de
> Mo 14. Jan 14:40:29 CET 2013
> Current time: 144029
> Parsing spec: @144020=3D0.01+0.3@144030=3D0.01+0.03@144040=3D0.5+0.7
> Remaining spec: @144020=3D0.01+0.3@144030=3D0.01+0.03@144040=3D0.5+0=
.7
> Inspecting frame: 144020=3D0.01+0.3
> Frame starts at 144020, warn=3D'0.01', crit=3D'0.3'
> Frame applies, limits set to '--warning 0.01 --critical 0.3'
> Remaining spec: @144030=3D0.01+0.03@144040=3D0.5+0.7
> Inspecting frame: 144030=3D0.01+0.03
> Frame starts at 144030, warn=3D'0.01', crit=3D'0.03'
> Frame hasn't started yet.
> Remaining spec: @144040=3D0.5+0.7
> Inspecting frame: 144040=3D0.5+0.7
> Frame starts at 144040, warn=3D'0.5', crit=3D'0.7'
> Frame hasn't started yet.
> Applied limits: '--warning 0.01 --critical 0.3'
> HTTP WARNING: HTTP/1.1 200 OK - 11359 bytes in 0.079 second response ti=
me |time=3D0.078892s;0.010000;0.300000;0.000000 size=3D11359B;;;0


> # date ; /usr/local/nagios/libexec/check_varlimits check_http \
> > @144020=3D0.01+0.3@144030=3D0.01+0.03@144040=3D0.5+0.7 -H www.google.=
de
> Mo 14. Jan 14:40:37 CET 2013
> HTTP CRITICAL: HTTP/1.1 200 OK - 11371 bytes in 0.074 second response t=
ime |time=3D0.074063s;0.010000;0.030000;0.000000 size=3D11371B;;;0


> # date ; /usr/local/nagios/libexec/check_varlimits check_http \
> > @144020=3D0.01+0.3@144030=3D0.01+0.03@144040=3D0.5+0.7 -H www.google.=
de
> Mo 14. Jan 14:40:44 CET 2013
> HTTP OK: HTTP/1.1 200 OK - 11379 bytes in 0.074 second response time |t=
ime=3D0.073810s;0.500000;0.700000;0.000000 size=3D11379B;;;0


Of course, if your production hours are fixed long-term (except for
moving holidays?), you can simplify things by hardcoding the timeframes
into the wrapper, instead of trying to parse a spec on the fly.

Regards,
J. Bern
--=20
*NEU* - NEC IT-Infrastruktur-Produkte im :
Server--Storage--Virtualisierung--Management SW--Passion for Performance
Jochen Bern, Systemingenieur --- LINworks GmbH
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP =3D D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C2=
7
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Gesch=C3=A4ftsf=C3=BChrer Metin Dogan, Oliv=
er Michel

--------------080300010407040209070608
Content-Type: text/plain;
name="check_varlimits"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="check_varlimits"

IyEvYmluL3NoCgpERUJVRz1mYWxzZQppZiBbICIkMSIgPSAiLS12YXJsaW1pdHMtZGVidWci
IF07IHRoZW4KICAgREVCVUc9dHJ1ZQogICBzaGlmdApmaQoKIyAkMSBub3cgY29udGFpbnMg
dGhlIGFjdHVhbCBwbHVnaW4gdG8gZXhlYwoKY2FzZSAkMSBpbgogICAqLyopCiAgICAgIFNV
Ql9QTFVHSU49IiQxIiA7OwogICAqKQogICAgICBTVUJfUExVR0lOPSJgZGlybmFtZSAkMGAv
JDEiIDs7CmVzYWMKCmlmIFsgISAteCAkU1VCX1BMVUdJTiBdOyB0aGVuCiAgIGVjaG8gIlVO
S05PV046IENhbm5vdCBmaW5kL2V4ZWN1dGUgcGx1Z2luICRTVUJfUExVR0lOIgogICBleGl0
IDMKZmkKCnNoaWZ0CgojICQxIG5vdyBjb250YWlucyB0aGUgbGltaXRzLXBlci1kYXl0aW1l
IHNwZWNzLgoKIyBPdmVyYWxsIHN5bnRheDoJQGZyYW1lW0BmcmFtZS4uLl0KIyB3aGVyZSAi
ZnJhbWUiOglISFtNTVtTU11dPVtbd2FybitdY3JpdF0KIyBhbmQgdGhlIHRpbWUgZ2l2ZW4g
aXMgd2hlbiB0aGUgc3RhdGVkIGxpbWl0cyBzaG91bGQgKnN0YXJ0KiBiZWluZyBhcHBsaWVk
CiMgKHVudGlsIHRoZSBuZX

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: Jochen.Bern@LINworks.de
Locked