blackbox_exporter icon indicating copy to clipboard operation
blackbox_exporter copied to clipboard

Allow setting fail_if_body_matches_regexp dynamically

Open robasp opened this issue 1 year ago • 2 comments

Hi all

I know dynamic probes is a feature that has been requested multiple times in the past. I also understand that there are security concerns about this feature.

Nevertheless, would it be possible for the parameters fail_if_body_matches_regexp & fail_if_body_not_matches_regexp to be set dynamically per target? At the moment, if i want to probe 100 targets with different HTML body, i would need 100 modules that only differ in the fail_if_body_matches_regexp & fail_if_body_not_matches_regexp fields.

Would that be possible or are there security concerns as well?

Thanks and best regards Robin

robasp avatar Mar 21 '24 13:03 robasp

Hi there, I need the same thing and thinking about implementing it. I've briefly checked the code and it shouldn't take much time. Before I commit thought, anyone can point out stuff I may not know about?

cyphysical avatar May 27 '24 09:05 cyphysical

I've created a quick implementation of it, looking forward for comments: https://github.com/prometheus/blackbox_exporter/pull/1247

cyphysical avatar May 27 '24 09:05 cyphysical