diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-04-20 18:57:27 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-04-20 18:57:27 +0200 |
commit | 63f106a2508ce494236535dc7dcbef649fdb5867 (patch) | |
tree | 213d78133d33ca4000678c1b7c8447ffeb621bca | |
parent | b448f0fcb12c02040d23c24517305065fbfc5f72 (diff) | |
download | pleroma-63f106a2508ce494236535dc7dcbef649fdb5867.tar.gz |
pleroma_healthcheck: Avoid div by 0
-rwxr-xr-x | installation/munin-plugin/pleroma_healthcheck | 6 |
1 files changed, 5 insertions, 1 deletions
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"; |