maketank-scripts from ansible

This commit is contained in:
2025-08-25 10:40:17 +02:00
parent 8ec81febba
commit 30ce409c4e
15 changed files with 281 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
#!/usr/bin/ruby
out = %x{/usr/sbin/logtail2 /var/log/mail.info |/usr/sbin/pflogsumm |/bin/grep -v "Grand Totals"|/usr/bin/head -22 |/usr/bin/awk '/\d+/ {print}'}.chomp
out.each_line { |line|
line.delete!('"')
line.strip!
line.chomp!
str = line.split(' ')
met = str[1]
val = str[0].delete('^0-9')
cmd = "/usr/bin/gmetric -x 300 -d 30000 -g mail -t uint16 -D \"Postfix #{met}\" -n postfix_#{met} -v #{val}"
puts cmd
%x{#{cmd}}
}