On May 18, 2010, at 1:38 PM, Edmunds wrote: > BTW > and content == '^OK$' > > works fine on PHP as Apache module, but doesn't work as expected if > PHP runs as fast-cgi (on otherwise identical configurations). So it > looks like the fcgid module is doing something monit is not expecting.
It is probably adding white-space chars such as new line. Regex are basically line oriented and new-line may cause problems. In any case instead of using OK[\r\n] I would recommend something like this to allow for optional white-space chars both in front and behind the OK but nothing else. Heck, this must work: and content == '^[ \r\n\t]*OK[ \r\n\t]*$' > On Tue, May 18, 2010 at 10:48 AM, Edmunds <[email protected]> wrote: >> Unfortunately this doesn't work and it fails as soon as I add ^ and/or >> $, it feels like monit doesn't recognize these as special characters, >> or php+apache combo adds something to the beginning and end of output, >> that is hidden by browsers (unlikely?) Unless you have content-type set to text/plain that is not at all unlikely since text/html viewed in the browser hide white-space chars such as new-line. >> >> I ended up with this test: >> and content == 'OK[\r\n]' >> >> i.e. the output should contain a line ending in OK, which I guess will >> have to do for now -- To unsubscribe: http://lists.nongnu.org/mailman/listinfo/monit-general
