diff --git a/renderer/templates/metric/health.uc b/renderer/templates/metric/health.uc index ffbbc14..b60e5fb 100644 --- a/renderer/templates/metric/health.uc +++ b/renderer/templates/metric/health.uc @@ -1,4 +1,8 @@ -{% if (!health) return %} +{% + services.set_enabled("uhealth", true); + if (!health) + return; +%} # Health configuration set ustats.health.interval={{ health.interval }} diff --git a/renderer/ucentral.uc b/renderer/ucentral.uc index 90e7ad4..557ea83 100755 --- a/renderer/ucentral.uc +++ b/renderer/ucentral.uc @@ -33,6 +33,8 @@ try { 'rm /tmp/dnsmasq.conf', 'cp /etc/config-shadow/wireless /etc/config/wireless', '/etc/init.d/wpad restart', + '/etc/init.d/uhealth stop', + 'touch /tmp/ucentral.health', 'touch /tmp/dnsmasq.conf' ]) system(cmd); diff --git a/system/health.uc b/system/health.uc index 553b98e..ba14090 100755 --- a/system/health.uc +++ b/system/health.uc @@ -5,6 +5,11 @@ let fs = require("fs"); let uci = require("uci"); let ubus = require("ubus"); +if (length(fs.stat('/tmp/ucentral.health'))) + sleep(75); + +fs.unlink('/tmp/ucentral.health'); + state = { unit: {}, interfaces: {}