Compare commits

..

3 commits

Author SHA1 Message Date
mwiegand
c8b7e34732 apcaccess telegraf: only one call 2022-08-11 12:37:28 +02:00
mwiegand
bb6eeba6fb readme 2022-08-11 12:37:13 +02:00
mwiegand
6c2d4ca69f pressure stall telegraf 2022-08-11 12:37:05 +02:00
4 changed files with 27 additions and 9 deletions

View file

@ -33,3 +33,5 @@ then
journalctl INVOCATION_ID="$InvocationID" --output cat journalctl INVOCATION_ID="$InvocationID" --output cat
fi fi
``` ```
telegraf: execd for daemons

View file

@ -2,7 +2,9 @@
date=$(date --utc +%s%N) date=$(date --utc +%s%N)
for metric in TIMELEFT LOADPCT BCHARGE METRICS=$(apcaccess)
for METRIC in TIMELEFT LOADPCT BCHARGE
do do
echo "apcupsd $metric=$(apcaccess -p $metric | cut -d' ' -f1) $date" echo "apcupsd $METRIC=$(grep $METRIC <<< $METRICS | cut -d ':' -f 2 | xargs | cut -d ' ' -f 1 ) $date"
done done

View file

@ -20,6 +20,11 @@ files = {
'source': f"https://dl.sublimity.de/telegraf-procio/telegraf-procio-{node.metadata.get('system/architecture')}-latest", 'source': f"https://dl.sublimity.de/telegraf-procio/telegraf-procio-{node.metadata.get('system/architecture')}-latest",
'mode': '0755', 'mode': '0755',
}, },
'/usr/local/share/telegraf/pressure_stall': {
'content_type': 'download',
'source': f"https://dl.sublimity.de/telegraf-pressure-stall/telegraf-pressure-stall-{node.metadata.get('system/architecture')}-latest",
'mode': '0755',
},
} }
svc_systemd['telegraf'] = { svc_systemd['telegraf'] = {

View file

@ -52,13 +52,22 @@ defaults = {
'swap': {h({})}, 'swap': {h({})},
'system': {h({})}, 'system': {h({})},
'net': {h({})}, 'net': {h({})},
'exec': {h({ 'exec': {
'commands': [ h({
f'sudo /usr/local/share/telegraf/procio', 'commands': [
], f'sudo /usr/local/share/telegraf/procio',
'data_format': 'influx', ],
'interval': '20s', 'data_format': 'influx',
})}, 'interval': '20s',
}),
h({
'commands': [
f'/usr/local/share/telegraf/pressure_stall',
],
'data_format': 'influx',
'interval': '10s',
}),
},
}, },
}, },
}, },