[asterisk-users] Monitoring
federico fetto
federico at egwn.net
Wed Nov 19 07:41:35 CST 2008
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
More information about the asterisk-users
mailing list