![]() |
Paul Kraus a �crit: > I do not have an errorstats.sh file on my machine and I get a permission > denied on xferfaxlog. I am running this command as root. oops, sorry I forgot that errorstats.sh was not in the standard hylafax... (I don't say that it lacks)
#!/bin/sh echo DEFANGED.14 exit #!/bin/sh echo DEFANGED.6131 exit #!/bin/sh echo DEFANGED.15 exit #!/bin/sh # # Robert Colquhoun <rjc@trump.net.au> 09 Feb 98 # errorstats.sh - Script to parse error data out of xferlog # # Hi Everyone, # I've hacked out a little script(attached below) to provide a error report # by modem - it should be able to run on any modem not just Sportsters. # # Instructions : cut and paste the script below, call it errorstats and run # ./errorstats.sh /var/spool/hylafax/etc/xferfaxlog # or wherever the location of your xferfaxlog file is # # echo count $# if [ $# -gt 0 ]; then XFERLOG=$1 else XFERLOG=./xferfaxlog fi awk -F "\t" ' function doline(a, b, c) { printf "%-60.60s %5i %8.1f\n", a, b, c } { if ( $4 != "" ) total[$4] += 1 if ( $11 == "0") { errname[$14] = 0 errcount[$4,$14] += 1 } } END { for (m in total) { printf "Modem: %s\n",m printf "%-68.68s %6i\n\n","Total faxes sent:",total[m] printf "%-60.60s %5s %10s\n","Error", "No","Rate/1000" printf "---------------------------------------" printf "---------------------------------------\n" tot = 0 for (n in errname) { if ( errcount[m, n] > 0 ) { name = n gsub("\"","",name) rate = errcount[m, n] * 1000 / total[m] tot += errcount[m, n] doline(name, errcount[m, n], rate) } } printf "---------------------------------------" printf "---------------------------------------\n" doline("Total", tot, tot * 1000 / total[m]) printf "\n" } }' < $XFERLOG