check_asr (for VOIP app GNUGK)


This script is used to monitor and calculate ASR’s from the raw logfile of GNUGK ( It greps the raw log file (gatekeeper_acct.log) and calcualtes the success rate based off the gateway i.p ,. when i first started writing it i called it getto_asr now its renamed to ./check_asr .

#Written by Humberto Cabrera, simple script used to grep traffic of a
#specific gateway from a raw log and calculate the ASR
#free of use, for any questions humbe[at]


if ($#ARGV != 0) {
print “usage: ./check_asr ip_address\n”;



$check=cat $log | grep $gateway;

if ($check eq “”)
print “The IP $gateway, was not found in $log.\n”;

$total= cat $log | grep $gateway | wc -l;
$unconnected= cat $log | grep $gateway | grep unconnected | wc -l;

$asr=($total-$unconnected) * 100 / $total;
print “The current ASR for $gateway is $asr\n”;

if ($asr >= 40) {
exit $STATE_OK;
elsif (($asr) < 40 and ($asr) >= 31) {
elsif ($asr <= 30) {

Edited ]