[asterisk-users] Peak number of calls?

Mojo with Horan & Company, LLC mojo at horanappraisals.com
Wed Jan 23 17:52:52 CST 2008


Steve Edwards wrote:
> Or, as a quick & dirty...
>          DATE=$(date +%F-%H-%M-%S)
>          COUNT=$(sudo /usr/sbin/asterisk -r -x "sip show channels" | wc -l)
>          echo $DATE $COUNT >>/tmp/channel-counts
>
> in a shell script executed every second in cron.
>   
every *second* from cron?  how the heck would I you do that?  sub-minute 
accuracy from cron is something I don't know how to do.

Maybe it's a different version of cron...?

The only way I would achieve that would be to run something every minute 
that self-perpetuated for the rest of that minute... 

for x in `seq 1 58`; 
do
 ( DATE=$(date +%F-%H-%M-%S)
   COUNT=$(sudo /usr/sbin/asterisk -r -x "sip show channels" | wc -l)
   echo $DATE $COUNT >>/tmp/channel-counts
 ) &
 sleep 1s
done

which is honestly very messy.

I promise I'm not being sarcastic.  I actually *am* curious if there are versions of cron that will go sub-minute.

Moj





More information about the asterisk-users mailing list