Send MAC addresses via 'reporter'.
This commit is contained in:
parent
3a14705d42
commit
36ee4039bf
1 changed files with 4 additions and 3 deletions
7
roles/lmn_fvs/files/reporter
Normal file → Executable file
7
roles/lmn_fvs/files/reporter
Normal file → Executable file
|
@ -10,15 +10,16 @@ sendto="collector.steinbeis.schule 1234"
|
||||||
|
|
||||||
cmds=(
|
cmds=(
|
||||||
'uname -a'
|
'uname -a'
|
||||||
'uptime'
|
|
||||||
'w'
|
|
||||||
'ls -d --full-time /home/ansible/.ansible/tmp/'
|
'ls -d --full-time /home/ansible/.ansible/tmp/'
|
||||||
|
'ip link | sed -nE -e "s/^[2-9]: (\S+): .+/\1/p" -e "s/.+ether ([0-9a-f:]+) .+/\1/p" | paste -d " " - -'
|
||||||
'ip route list default'
|
'ip route list default'
|
||||||
)
|
)
|
||||||
|
# 'w'
|
||||||
|
# 'uptime'
|
||||||
# 'ip addr show'
|
# 'ip addr show'
|
||||||
# 'apt list --upgradeable -o Apt::Cmd::Disable-Script-Warning=true'
|
# 'apt list --upgradeable -o Apt::Cmd::Disable-Script-Warning=true'
|
||||||
|
|
||||||
r="$HOSTNAME: ------- $(date --rfc-3339=seconds) -------
|
r="$HOSTNAME: ------- $(date --rfc-3339=seconds) -------
|
||||||
$(for c in "${cmds[@]}" ; do echo "$c"; $c | sed 's/^/ /' ; done | sed "s/^/$HOSTNAME: /")
|
$(for c in "${cmds[@]}" ; do echo "$c"; eval "$c" | sed 's/^/ /' ; done | sed "s/^/$HOSTNAME: /")
|
||||||
## -------------------------------------------------"
|
## -------------------------------------------------"
|
||||||
echo "$r" | nc -w 1 -u $sendto
|
echo "$r" | nc -w 1 -u $sendto
|
||||||
|
|
Loading…
Add table
Reference in a new issue