If you have php installed this script can get you started. You can either make 
some additions (send an email) and cron it or leave it as and point an external 
monitor at the web page doing a content check.

The output if everything is OK is as follows:

Zap Lines OK

If there is an issue:

Issue Detected
-----

Response: Follows
Privilege: Command
Description                              Alarms     IRQ        bpviol     CRC4
Digium Wildcard TE110P T1/E1 Card 0      ERROR         0          0          0
--END COMMAND--
Server: localhost

Script:
<pre>
<?
        //////////////////////////////////////////////////////////////
        // This is a quick script that allows the external monitoring
        // to check that all is ok.
        //
        // [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>
        ////////////////////////////////////////////////////////////
       $s = stream_socket_client('tcp://127.0.0.1:5038',$e,$es,5);
        if (!$s)
        {
                die('<pre>Error: '.$es.'</pre>');
        }
        stream_set_timeout($s,2,0);
        fwrite($s,"Action: Command\r\n");
        fwrite($s,"Command: zap show status\r\n");
        fwrite($s,"\r\n");
        $Response="";
        while(!strstr($Response,'END COMMAND'))
        {
                $Chunk = fread($s,512);
                $Response .= $Chunk;
        }
        fclose($s);
        if(stristr($Response,"OK") === FALSE)
        {
                print("Issue detected");
                print("-----");
                print($Response);
        }
        else
        {
                print("Zap Lines OK");
        }
?>
</pre>
________________________________
From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Jacobus van Niekerk 
[EMAIL PROTECTED]
Sent: 09 September 2008 13:50
To: [email protected]
Subject: [asterisk-users] Asterisk and Network Monitoring

Dear Asterisk Users

I'm looking for a solution that can be used to monitor Asterisk and the
Telco lines aswell as the network (Servers, WAN & LAN links, Router &
Switches)

Thanks


_______________________________________________
-- Bandwidth and Colocation Provided by 
http://www.api-digital.com<http://www.api-digital.com/> --

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net<http://www.astricon.net/>

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to