[asterisk-users] Monitoring

Jon Weisman jweisman at ibell.net
Wed Nov 19 09:10:30 CST 2008


is this for php? 


----- Original Message ----- 
From: "federico fetto" <federico at egwn.net>
To: <asterisk-users at lists.digium.com>
Sent: Wednesday, November 19, 2008 8:41 AM
Subject: Re: [asterisk-users] Monitoring


> On Wed, 19 Nov 2008 15:17:50 +0200
> "Hakan C" <ella4ever at gmail.com> wrote:
> 
>> Hey Jon,
>> 
>> You are asking something too specific.
>> If you want to monitor your PRI, its not so difficult to script.
>> 
>> <?
>> $checkPRI = exec("asterisk -rx 'pri show spans'");
>> if (ereg('/^Down/', $checkPRI, $match) {
>> echo "OMG, someone call the ambulance\r\n";
>> echo $match;
>> } else {
>> echo "working...";
>> }
>> ?>
> 
> Or better (imo):
> <?
> $checkPRI = exec("asterisk -rx 'pri show spans'");
> if (ereg('/^Up/', $checkPRI, $match) {
> echo "working...";
> } else {
> echo "OMG, someone call the ambulance\r\n";
> echo $match;
> }
> ?>
> 
> Bye
> Federico Fetto
> 
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>




More information about the asterisk-users mailing list