[check_postgres] [PATCH] Add `pgagent_jobs` test.

Cédric Villemain cedric.villemain.debian at gmail.com
Thu Jan 19 21:32:01 UTC 2012


Le 19 janvier 2012 21:59, David E. Wheeler
<david.wheeler at pgexperts.com> a écrit :
> On Jan 19, 2012, at 11:49 AM, Cédric Villemain wrote:
>
>> I am unsure to understand the interest to get a WARNING, but what it
>> does require looks more something like that :
>>
>> check_postgres_pgagent_jobs --critical 0h:2h --warning 2h:4h
>> (and performance data must output in seconds : 3600s so that nagios
>> graphers can understand it)
>>
>> I think this range argument is not yet handled by check_postgres, but
>> should be, and fix your issue thanks to a side effect of a cleaner -w
>> and -c parsing.
>> Correct ?
>
> If it was independent parsing, that did not care if the warning window was larger than the critical window, then yes. As long as I could also do:
>
>    check_postgres_pgagent_jobs --critical 2h
>
> IOH, if no :, then assume it means 0h:2h.

mmh, I wrote too fast and made a mistake.
So to remove confusion, what the guidelines say is:

alert if < 0 or > 10, (outside the range of {0 .. 10})
 -c 10

alert if < 10, (outside {10 .. ∞})
 -c 10:

alert if < 10 or > 20, (outside the range of {10 .. 20})
 -c 10:20

alert if ≥ 10 and ≤ 20, (inside the range of {10 .. 20})
 -c @10:20

This is the generalised format for ranges:
[@]start:end

Notes:
 * start ≤ end
 * start and ":" is not required if start=0
 * if range is of format "start:" and end is not specified, assume end
is infinity
 * to specify negative infinity, use "~"
 * alert is raised if metric is outside start and end range (inclusive
of endpoints)
 * if range starts with "@", then alert if inside this range
(inclusive of endpoints)

> Is that something you plan to hack up?

I am going to look into it, maybe I'll find a pretty way to do it.
If I fail we can add a TODO to accept range, it might be useful in other checks.

for the current proposal, that should be (if I don't fail again...)
  -c 2h:  or -c @0h:2h  and -w @2h:4h

I think we should have check_postgres trying to follow that, is it a
big trouble for you to use this kind of arguments ?

-- 
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation


More information about the Check_postgres mailing list