From 63f106a2508ce494236535dc7dcbef649fdb5867 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 20 Apr 2020 18:57:27 +0200 Subject: pleroma_healthcheck: Avoid div by 0 --- installation/munin-plugin/pleroma_healthcheck | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/installation/munin-plugin/pleroma_healthcheck b/installation/munin-plugin/pleroma_healthcheck index cc498d201..7058a2f94 100755 --- a/installation/munin-plugin/pleroma_healthcheck +++ b/installation/munin-plugin/pleroma_healthcheck @@ -153,7 +153,11 @@ if ($response->is_success) { print "job_queue_", $k, "_success.min 0\n"; print "job_queue_", $k, "_success.max 100\n"; } else { - print "job_queue_", $k, "_success.value ", ($v->{'success'}/$v->{'processed_jobs'})*100, "\n"; + if ($v->{'processed_jobs'} == 0) { + print "job_queue_", $k, "_success.value 0\n"; + } else + print "job_queue_", $k, "_success.value ", ($v->{'success'}/$v->{'processed_jobs'})*100, "\n"; + } } #print "job_queue_", $k, "_failed.label job queue ", $k, " failure%\n"; -- cgit v1.2.3