[check_postgres] parsing issue on windows in check_last_vacuum_analyze

Luke Koops luke.koops at entrust.com
Thu Aug 27 22:19:38 UTC 2009


This is the last one I'm going to report since I am only using 25% of the actions.

this doesn't work
  SLURP: while ($db->{slurp} =~ /(\S+)\s+\| (\S+)\s+\|\s+(\-?\d+) \| (.+)\s*$/gm) {

The + is greedy which makes the \s* in (.+)\s* redundant.  .+ will eat up all of the characters up to the LF, including the CR.  Replace the . with [^[:cntrl:]]  It will eat up anything that is not a control character.

this works on Windows and should be fine on Unix too.
  SLURP: while ($db->{slurp} =~ /(\S+)\s+\| (\S+)\s+\|\s+(\-?\d+) \| ([^[:cntrl:]]+)\s*$/gm) {
Luke Koops
Phone 613-270-2674
Mobile 613-791-3141
Toll free 1-866-517-4479 x2674

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mail.endcrypt.com/pipermail/check_postgres/attachments/20090827/0539edad/attachment.html 


More information about the Check_postgres mailing list