scripts/log_accessing_server_scripts

35 lines
1.5 KiB
Plaintext

dlbot
userlist:
journalctl -u dlbot | grep "chat_id=" | cut -s -d "=" -f 2 | cut -d "&" -f 1 | sort | uniq
user count:
journalctl -u dlbot | grep "chat_id=" | cut -s -d "=" -f 2 | cut -d "&" -f 1 | sort | uniq | wc -l
malformed links:
journalctl -u dlbot | grep "&text=Link+malformed." | wc -l
exception count
journalctl -u dlbot | grep "Exception" | grep -v "Caused by" | wc -l
exception type count
journalctl -u dlbot -o cat | grep "Exception" | grep -v "Caused by" | cut -d " " -f 1 | cut -d ":" -f 1 | sed 's/^.*\.//g' | sort | uniq -c | sort -hr
nsfwbot
unknown links:
journalctl -u nsfwbot -o cat | grep "unknown linktype: " | sort | uniq
dbsize over time:
journalctl -u nsfwbot | grep "&text=Known+Images%3A+" | cut -s -d % -f 2 | cut -c 4-
version2 (csv output):
journalctl -u nsfwbot | grep "&text=Known+Images%3A+" | cut -d m -f 1,4 | cut -d % -f 1,2 | sed 's/ mages%3A+/; /g'
version3 (csv with nice date format):
journalctl -o short-iso -u nsfwbot | grep "&text=Known+Images%3A+" | cut -d m -f 1,4 | cut -d % -f 1,2 | sed 's/ mages%3A+/; /g' | sed -E 's/T.*;/;/g'
mac.log:
links anz messungen, rechts: anzahl gemessener mac adressen
cat mac.log | cut -d - -f 2 | grep -n -o ';' | sort -n | uniq -c | cut -d : -f 1 | sort -n | cut -d ' ' -f 6 | uniq -c
links: anz macs, rechts: zeilen nr
cat mac.log | cut -d - -f 2 | grep -n -o ';' | sort -n | uniq -c | cut -d : -f 1 | sort -n
read TX / RX packets
while [ true ]; do (echo -n "RX: " && cat /proc/net/dev | grep "enp" | sed -e "s/[[:space:]]\+/ TX: /g" | cut -d ' ' -f 5,20,21) | tr '\n' '\r'; sleep 0.05; done