v0.9.1: One probe cannot agree with itself

Pegel refuses a config that asks more probes to agree than it has. The release job writes checksums after every build has finished.

pegel check now refuses a config whose agree is larger than the number of probes. In 0.9.0 such a config started without a word and could never alert, because one probe cannot agree with itself. Two people ran into it in the first three days, both on a Raspberry Pi with a single probe.

Fixed

  • A config with agree = 2 and one [[probe]] started and never fired an alert. pegel check and pegel run stop and name the line to fix.
  • Without any [[probe]], agree defaults to 1 again, as the notes of 0.9.0 said.
  • pegel probe retried a refused token every second. It waits 30 seconds between attempts now and logs why.

Changed

probes := max(1, len(cfg.Probes))
if cfg.Defaults.Agree > probes {
	return fmt.Errorf("%s line %d: agree = %d needs %d probes, found %d",
		cfg.Path, cfg.Line("defaults.agree"), cfg.Defaults.Agree, cfg.Defaults.Agree, probes)
}
$ pegel check --config pegel.toml
error: pegel.toml line 3: agree = 2 needs 2 probes, found 1

Comments

Buy Logbuch