[check_postgres] RFC: New Actions

David E. Wheeler david.wheeler at pgexperts.com
Mon Jan 24 20:10:32 UTC 2011


On Jan 20, 2011, at 5:44 PM, David E. Wheeler wrote:

>> Very interesting. I'm slightly wary of using those metacharacters. One alternative 
>> is to (also? only?) allow "English" equivalents:
>> 
>> --critical '15 sec or 20 items'
>> --critical '20 txns and 30 seconds'
> 
> Done. See attached patch. I wrote a bunch of tests of the validation function, too. If this meets muster for you, I'll also update the idle transaction patch to do something similar.

Thanks for accepting my patch. Getting back to this now:

> * Idle transaction count: Report error if more than x idle transactions more than x [time units] old.

I wasted 90 minutes last week writing a patch that adds a new function, validate_time_or_integer_with_oper(), that returns a code ref like validate_size_or_percent_with_oper() does. Unfortunately, however, it won't work for the txn_idle check, because we need to check "X transasctions all of which are idle for X time or longer", not if there x idle transactions and one or more idle for x time."

So I think what I need to do instead is something like:

  txn_idle --critical '10 for 10 minutes'
  txn_idle --warning  '50 for 30s'
  
So, just a different way to parse the option, splitting it on / for / instead of an operator. Thoughts?

Best,

David



More information about the Check_postgres mailing list