[check_postgres] --exclude behavior doesn't seem to agree with the docs

Guillaume Lelarge guillaume at lelarge.info
Sun Sep 25 20:03:53 UTC 2011


On Fri, 2011-09-16 at 13:49 -0700, Jeff Frost wrote:
> On Sep 16, 2011, at 1:44 PM, Guillaume Lelarge wrote:
> 
> >> I believe what was happening is that I was using this:
> >> 
> >> check_postgres.pl --port=5444 -u postgres -db jefftest   --exclude='~^pg_'
> >> --exclude='sys.' --exclude='pg_catalog.'  --action=last_analyze
> >> 
> > 
> > Why do you prepend ^pg_ with ~ ? If I get rid of the tilde, it works for
> > me.
> 
> Oh! Because that is one of the examples in the documentation:
> 
> Exclude all items which start with the letters 'pg_', which contain the letters 'slon', or which are named 'sql_settings' or 'green'. Specifically check items with the letters 'prod' in their names, and always check the item named 'pg_relname':
> 
>  --exclude=~^pg_,~slon,sql_settings --exclude=green --include=~prod,pg_relname
> 
> 
> > 
> >> and I end up with this:
> >> 
> >> POSTGRES_LAST_ANALYZE CRITICAL: DB "jefftest" (host:jefftest) (port=5444)
> >> pg_catalog.pg_ts_dict: 03:39 November 19, 2010 (41 weeks 5 days 9 hours 24
> >> minutes)
> >> 
> >> but, if I remove the exclude with the regex, it works as expected.  Also, if I
> >> combine the 3 excludes into a single option like so:
> >> --exclude='~^pg_,sys.,pg_catalog.' it works as expected.
> >> 
> > 
> > Here, the tilde isn't an issue because all pg_* are in pg_catalog*.
> 
> 
> yes, it's not really blocking me, as I sorted out what arguments to use but I'm suggesting it might be a documentation issue since the example lists  ~^pg_ which doesn't appear to work as advertised.
> 

It seems you're right. I'm not a full expert on rational expressions
with perl, so I can't say for sure. I hope Greg will join in to share
his views on this matter.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com



More information about the Check_postgres mailing list