From 28ee04c6d75f2a11cae48758187f9041424a85ea Mon Sep 17 00:00:00 2001 From: Yann Papouin Date: Tue, 27 Apr 2021 16:30:54 +0200 Subject: [PATCH] New setting to be compatible with external services monitoring cron jobs and similar periodic processes --- status/edit_sched.cgi | 1 + status/lang/en | 1 + status/lang/fr | 1 + status/monitor.pl | 5 +++++ 4 files changed, 8 insertions(+) diff --git a/status/edit_sched.cgi b/status/edit_sched.cgi index 579b368a2..8868e4a77 100755 --- a/status/edit_sched.cgi +++ b/status/edit_sched.cgi @@ -47,6 +47,7 @@ print &ui_table_row($text{'sched_warn'}, &ui_radio("warn", int($config{'sched_warn'}), [ [ 1, $text{'sched_warn1'} ], [ 0, $text{'sched_warn0'} ], + [ 3, $text{'sched_warn3'} ], [ 2, $text{'sched_warn2'} ] ]), 3); # Send email to diff --git a/status/lang/en b/status/lang/en index 466f435ea..ca906dc92 100644 --- a/status/lang/en +++ b/status/lang/en @@ -160,6 +160,7 @@ sched_offset=with offset sched_warn=Send email when sched_warn1=When a service changes status sched_warn0=When a service goes down +sched_warn3=As long as the service is up sched_warn2=Any time service is down sched_single=Send one email per service? sched_hours=Run monitor during hours diff --git a/status/lang/fr b/status/lang/fr index 5cbc89481..49ceb1608 100644 --- a/status/lang/fr +++ b/status/lang/fr @@ -160,6 +160,7 @@ sched_offset=avec un décalage sched_warn=Envoyer un message électronique quand sched_warn1=Un service change d'état sched_warn0=Un service s'arrête +sched_warn3=Tant que le service est actif sched_warn2=Chaque fois qu'un service s'arrête sched_single=Envoyer un message électronique par service ? sched_hours=Exécuter le moniteur aux heures suivantes diff --git a/status/monitor.pl b/status/monitor.pl index 4bce7dacd..4d05699a0 100755 --- a/status/monitor.pl +++ b/status/monitor.pl @@ -168,6 +168,11 @@ foreach $serv (@services) { $suffix = "isdown"; $out = &run_on_command($serv, $serv->{'ondown'}, $r); } + elsif ($warn == 3 && $up == 1) { + # Service is up now + $suffix = "isup"; + $out = &run_on_command($serv, $serv->{'onup'}, $r); + } # If something happened, notify people if ($suffix &&