Skip to content

Commit 73cd19b

Browse files
committed
Fix for #3015 - Proper reply on read_system if rsyslog is unreachable
1 parent 98ddc35 commit 73cd19b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/server/bg_services/server_monitor.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@ function run() {
2626
dbg.log0('SERVER_MONITOR: BEGIN');
2727
monitoring_status = {
2828
dns_status: "UNKNOWN",
29-
ph_status: "UNKNOWN",
29+
ph_status: {
30+
status: "UNKNOWN",
31+
test_time: moment().unix()
32+
},
33+
remote_syslog_status: {
34+
status: "UNKNOWN",
35+
test_time: moment().unix()
36+
}
3037
};
3138
if (!system_store.is_finished_initial_load) {
3239
dbg.log0('waiting for system store to load');
@@ -236,7 +243,6 @@ function _check_remote_syslog() {
236243
dbg.log2('_check_remote_syslog');
237244
let system = system_store.data.systems[0];
238245
if (_.isEmpty(system.remote_syslog_config)) return;
239-
monitoring_status.remote_syslog_status = "UNKNOWN";
240246
if (_.isEmpty(system.remote_syslog_config.address)) return;
241247
monitoring_status.remote_syslog_status = {
242248
test_time: moment().unix()
@@ -246,7 +252,7 @@ function _check_remote_syslog() {
246252
monitoring_status.remote_syslog_status.status = "OPERATIONAL";
247253
})
248254
.catch(err => {
249-
monitoring_status.remote_syslog_status = "UNREACHABLE";
255+
monitoring_status.remote_syslog_status.status = "UNREACHABLE";
250256
dbg.warn('Error when trying to check remote syslog status.', err.stack || err);
251257
});
252258
}

0 commit comments

Comments
 (0)