diff --git a/src/freenas/usr/lib/netdata/charts.d/nut_ups.chart.sh b/src/freenas/usr/lib/netdata/charts.d/nut_ups.chart.sh index 5e7a6086b955c..fb8db8e8a102c 100644 --- a/src/freenas/usr/lib/netdata/charts.d/nut_ups.chart.sh +++ b/src/freenas/usr/lib/netdata/charts.d/nut_ups.chart.sh @@ -1,14 +1,12 @@ source /usr/lib/netdata/charts.d/nut.chart.sh -nut_ups_update_every=60 - nut_get_all() { - run -t $nut_timeout upsc -l || echo "ix-dummy-ups" + run -t $nut_timeout upsc -l || echo "skip-get-values" } nut_get() { - if [ $1 == "ix-dummy-ups" ]; then + if [ $1 == "skip-get-values" ]; then return 0; fi @@ -33,7 +31,6 @@ nut_ups_check() { nut_ids=() if [ ! -f /run/nut/upsmon.pid ]; then - nut_ids["ix-dummy-ups"]="$(fixid "ix-dummy-ups")" return 0 fi @@ -73,6 +70,10 @@ nut_ups_update() { # do all the work to collect / calculate the values # for each dimension # remember: KEEP IT SIMPLE AND SHORT + if [ ! -f /run/nut/upsmon.pid ]; then + return 0 + fi + nut_ups_check nut_ups_create nut_update $@ diff --git a/src/middlewared/middlewared/etc_files/local/nut/ups_config.py b/src/middlewared/middlewared/etc_files/local/nut/ups_config.py index c68d4f175a34d..a635791c95662 100644 --- a/src/middlewared/middlewared/etc_files/local/nut/ups_config.py +++ b/src/middlewared/middlewared/etc_files/local/nut/ups_config.py @@ -16,7 +16,7 @@ def generate_ups_config(middleware): ups_group = middleware.call_sync('group.query', [['group', '=', UPS_USER]], {'get': True}) os.chown(UPS_VARPATH, 0, ups_group['gid']) - os.chmod(UPS_VARPATH, 0o770) + os.chmod(UPS_VARPATH, 0o775) def render(service, middleware):