Add Ansible playbooks for MeshCore monitoring node deployment
Roles: base (apt, tailscale, motd), meshcore_cli (pipx), meshcore_capture (agessaman/meshcore-packet-capture + .env.local template), scripts (voltage, bandwidth). Host vars contain per-device serial ports; group vars hold shared MQTT broker config. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
vnstat
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# fetch status
|
||||
STATUS=$(vcgencmd get_throttled | cut -d "=" -f 2)
|
||||
|
||||
# decode - https://www.raspberrypi.com/documentation/computers/os.html#get_throttled
|
||||
echo "vcgencmd get_throttled ($STATUS)"
|
||||
IFS=","
|
||||
for BITMAP in \
|
||||
00,"currently under-voltage" \
|
||||
01,"ARM frequency currently capped" \
|
||||
02,"currently throttled" \
|
||||
03,"soft temperature limit reached" \
|
||||
16,"under-voltage has occurred since last reboot" \
|
||||
17,"ARM frequency capping has occurred since last reboot" \
|
||||
18,"throttling has occurred since last reboot" \
|
||||
19,"soft temperature reached since last reboot"
|
||||
do set -- $BITMAP
|
||||
if [ $(($STATUS & 1 << $1)) -ne 0 ] ; then echo " $2" ; fi
|
||||
done
|
||||
|
||||
echo "vcgencmd measure_volts:"
|
||||
for S in core sdram_c sdram_i sdram_p ; do printf '%9s %s\n' "$S" "$(vcgencmd measure_volts $S)" ; done
|
||||
|
||||
echo "Temperature: $(vcgencmd measure_temp)"
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Deploy voltage.sh
|
||||
copy:
|
||||
src: voltage.sh
|
||||
dest: "{{ ansible_env.HOME }}/voltage.sh"
|
||||
mode: "0755"
|
||||
become: false
|
||||
|
||||
- name: Deploy bandwidth.sh
|
||||
copy:
|
||||
src: bandwidth.sh
|
||||
dest: "{{ ansible_env.HOME }}/bandwidth.sh"
|
||||
mode: "0755"
|
||||
become: false
|
||||
Reference in New Issue
Block a user