Commit df624485 authored by Olav Kvittem's avatar Olav Kvittem

Robustified start of sipp-bb with sipp-start-bb


git-svn-id: file:///home/svn/sipshaman/trunk@26 9383e1fa-a92b-456e-b4ec-45f0d4f7abeb
parent dee67285
......@@ -103,14 +103,8 @@ foreach $tasklog(@ARGV){
while(<CSV>){
$log.=$_;
if (/^[\d-]+[\d:]+\s+\d+/){ # date time unixtime
($sdate,$etime,$unixtime,$elapsed, $callsout, $success, $failed, $rest)=split;
($sdate,$stime,$unixtime,$elapsed, $callsout, $success, $failed, $retrans, $responsetime, $callLength, $rest)=split;
if ($success>0){
my ($hh, $mm, $ss)=split(/:/, $elapsed);
my $esec=3600*$hh+60*$mm+$ss;
my $dt=DateTime->from_epoch(epoch => $unixtime, time_zone => $tz);
$dt->subtract(seconds => $esec);
$stime=$dt->hms;
$sdate=$dt->ymd;
$calls=$success+$failed;
$status=100*$success/$calls; # success rate in %
......
......@@ -9,9 +9,18 @@ else
source /etc/sipshaman/sipshaman.cf
fi
hdir=`date +$DATA/%Y/%m/%d/%H`
cd $hdir
while test 1=1 ; do
ps -ef | egrep -q "$BIN/qstream-[s]ipp-check .*-bb $BB_HOST" -
$BIN/qstream-sipp-check $* -bb $BB_HOST -f -die 59 task.log
if test $? = 1 ; then # not found
hdir=`date +$DATA/%Y/%m/%d/%H`
cd $hdir
lifemin="$((60-`date +%M|sed -e s/^0//`))" # die at top of hour
$BIN/qstream-sipp-check $* -bb $BB_HOST -f -die $lifemin task.log
fi
sleep 3
done
......@@ -48,7 +48,7 @@ fi
$BIN/sipp $proxy:$SIP_PROXY_PORT -s sipp -i $iaddr -p $port -mp $mport -recv_timeout $idle_time -l 1 -m 1 -sf $CONF/$RESPONDER_SCENARIO -trace_stat -trace_logs -trace_err -trace_msg -rp 600000 -r 1 -bg -nofork 2>> sipp.err >> sipp.log &
pid=$!
echo $y-$m-$d `date +%T` $pid $port $mport sipp@$iaddr $REPORT_TAG `hostname --fqdn` 0 >> task.log
echo `date "+%F %T"` $pid $port $mport sipp@$iaddr $REPORT_TAG `hostname --fqdn` 0 >> task.log
wait $pid
......
#!/bin/bash
# start sipp-BB if not running
# usage $0 config-file...
# default config to start
if test $# -le 0; then
set /etc/sipshaman/sipshaman.cf
fi
for cf in $*; do
source $cf
ps axw | grep -q "sh .*/usr/bin/sipp-b[b].*$cf" -
if test $? -eq 1; then # not found and ok to run
$BIN/sipp-bb -cf $cf&
fi
done
\ No newline at end of file
......@@ -3,6 +3,7 @@
# usage $0 config-file...
# default config to start
if test $# -le 0; then
set /etc/sipshaman/sipshaman.cf
fi
......
......@@ -39,8 +39,8 @@ while read server service outproxy function machine calls; do
adr=$service@$server
server_ip=`echo $server| sed -e 's/:.*//'`
# echo server_ip $server_ip
echo $y-$m-$d `date +%T` $pid $port $mport $service@$server $function $machine `ping -c 10 -i 0.5 -q $server_ip | awk -F / '/^rtt /{print $5}'`>> task.log
time=$y-$m-$d-$h
echo `date "+%F %T"` $pid $port $mport $service@$server $function $machine `ping -c 10 -i 0.5 -q $server_ip | awk -F / '/^rtt /{print $5}'`>> task.log
# time=$y-$m-$d-$h
# perl -e "dbmopen(%tests, 'sip-test.dbm',0622); \$tests\{$time,$pid\}=$adr;dbmclose(%tests)"
port=$(($port+2))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment