Skip to content

Commit

Permalink
NAS-129384 / 24.10 / Fix netdata spamming logs (#13860)
Browse files Browse the repository at this point in the history
* Fix netdata spamming logs

* make netdata plugin run after 60 sec
  • Loading branch information
Qubad786 authored Jun 13, 2024
1 parent 88944f6 commit e697d43
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/freenas/usr/lib/netdata/charts.d/nut_ups.chart.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
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"
}

nut_get() {
if [ $1 == "ix-dummy-ups" ]; then
return 0;
fi

run -t $nut_timeout upsc "$1"

if [ "${nut_clients_chart}" -eq "1" ]; then
printf "ups.connected_clients: "
run -t $nut_timeout upsc -c "$1" | wc -l
fi
}

nut_ups_check() {

# this should return:
Expand All @@ -13,10 +29,15 @@ nut_ups_check() {
local x

require_cmd upsc || return 1

nut_ups="$(nut_get_all)"
nut_names=()
nut_ids=()

if [ $(ps -aux | grep upsmon | wc -l) -le 1 ]; then
nut_ids["ix-dummy-ups"]="$(fixid "ix-dummy-ups")"
return 0
fi

nut_ups="$(nut_get_all)"
for x in $nut_ups; do
nut_get "$x" > /dev/null
# shellcheck disable=SC2181
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
home = ${netdata_cache_dataset}
lib = ${netdata_state_location}

[logs]
access = off

[plugins]
proc = yes
diskspace = no
Expand Down

0 comments on commit e697d43

Please sign in to comment.