mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-24 09:57:09 +00:00
[tr_ratios] include awk scripts; awk instead of gawk
since we cannot rely on the location of the two included awk scripts, we just include them literally
This commit is contained in:
parent
8777efd66c
commit
1a25481e2c
3 changed files with 18 additions and 20 deletions
|
@ -8,8 +8,24 @@ if [ "$1" = "config" ]; then
|
|||
echo "graph_vlabel Seed ratio %"
|
||||
echo "graph_category torrent"
|
||||
echo "graph_info This plugin shows your transmission ratios per torrent"
|
||||
transmission-remote -n "$user:$pass" -l | gawk -f /usr/share/munin/plugins/tr_ratios_labels | iconv -f utf-8 -t ascii//translit
|
||||
transmission-remote -n "$user:$pass" -l | awk '
|
||||
BEGIN { FIELDWIDTHS = "7 4 13 10 7 9 7 13 40" }
|
||||
NR > 1 {
|
||||
split($1,torrentid," ")
|
||||
if (torrentid[1] != "Sum:") {
|
||||
print "ID" torrentid[1] ".label " $9
|
||||
}
|
||||
}' | iconv -f utf-8 -t ascii//translit
|
||||
exit 0
|
||||
fi
|
||||
|
||||
transmission-remote -n "$user:$pass" -l | gawk -f /usr/share/munin/plugins/tr_ratios_data
|
||||
transmission-remote -n "$user:$pass" -l | awk '
|
||||
BEGIN { FIELDWIDTHS = "7 4 13 10 7 9 7 13 40" }
|
||||
NR > 1 {
|
||||
split($1,torrentid," ")
|
||||
if (torrentid[1] != "Sum:") {
|
||||
split($7,ratio," ")
|
||||
ratio[1] = ratio[1] * 100
|
||||
print "ID" torrentid[1] ".value " ratio[1]
|
||||
}
|
||||
}'
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
BEGIN { FIELDWIDTHS = "7 4 13 10 7 9 7 13 40" }
|
||||
NR > 1 {
|
||||
split($1,torrentid," ")
|
||||
if(torrentid[1] != "Sum:") {
|
||||
split($7,ratio," ")
|
||||
ratio[1] = ratio[1] * 100
|
||||
print "ID" torrentid[1] ".value " ratio[1]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
BEGIN { FIELDWIDTHS = "7 4 13 10 7 9 7 13 40" }
|
||||
NR > 1 {
|
||||
split($1,torrentid," ")
|
||||
if(torrentid[1] != "Sum:") {
|
||||
print "ID" torrentid[1] ".label " $9
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue