berthubert / simplomon

Very simple monitoring system with a single configuration file
MIT License
97 stars 12 forks source link

Add matching response body against a regex to https checker #32

Closed wandernauta closed 3 months ago

wandernauta commented 3 months ago

The checker now fails if the response body does not contain a match for the given regular expression. This uses the default std::regex grammar ("modified ECMAScript"), with default options (so case sensitive).

If minBytes and regex are both given, minBytes is checked first. It is allowed, but probably not that useful, to combine regex and method="HEAD" for the same checker.

Issue #20 is related, but this does not add anything related to reading local files. It could, if the libcurl configuration was changed to allow the FILE 'protocol'...

https{url="file:///etc/resolv.conf", regex="nameserver 127.0.0.1"}

...but at that point, the name https for this checker would be a bit confusing.

berthubert commented 3 months ago

merged, thanks!