diff --git a/resmon b/resmon index ac04326a3a5fb962b0b9ebce4233e73d4b13a051..da6f4a670656960f84dcf9c1fa39f8c17ffe048c 100755 --- a/resmon +++ b/resmon @@ -99,6 +99,13 @@ $status->serve_http_on($config->{interface}, $config->{port}, if($config->{port}); while(1) { + my $child_status = waitpid ($status->{child}, WNOHANG); + if ($child_status == -1) { + die "Error occured: ", $? >> 8; + } + elsif ($child_status) { + die "HTTP server ended with ", $? >> 8; + } while(my($module_name, $mod_configs) = each %{$config->{Module}}) { while(my($check_name, $monitor_obj) = each %$mod_configs) { my $check_metrics = {};