[asterisk-users] Re: Asterisk Manager

Maps mapsair at hotmail.com
Mon Oct 30 07:25:41 MST 2006


Dear Michiel and Supporters!

Thank you for your reply!

Here is the complete code for my monitor.php
####################################

<html>

<head>
<title>Asterisk Status</title>
<link href="common/classic.css" rel="stylesheet" type="text/css">
</head>

<body>

<h2>Asterisk Status: <? echo `hostname`; echo " (".$SERVER_ADDR.")"; ?></h2>

<?

$arr = array(
        "Uptime" => "asterisk -r -x 'show uptime'",
        "Database Connection Status" => "asterisk -r -x 'realtime mysql
status'",
        "Active Channel(s)" => "asterisk -r -x 'sip show channels'",
        "Working Queues" => "asterisk -r -x 'show queues'",
        "Registered Phones" => "asterisk -r -x 'sip show peers'",
        "Zaptel driver info" => "asterisk -r -x 'zap show channels'",
);

foreach ($arr as $key => $value) {
?>
<br>
<table class="box">
        <tr class="boxheader">
                <td class="boxheader"><? echo $key; ?></td>
        </tr>
        <tr class="boxbody">
                <td>
                <table border="0" >
                        <tr>
                                <td>
                                <pre><? echo passthru($value); ?></pre>
                                </font></td>
                        </tr>
                </table>
                </td>
        </tr>
</table>
<?
}
?>

</body>
</html>
# End of monitor.php file ######################################

The manager.conf as I have posted previously.








----- Original Message ----- 
From: "Michiel van Baak" <michiel at vanbaak.info>
To: <asterisk-users at lists.digium.com>
Sent: Wednesday, October 25, 2006 1:37 PM
Subject: Re: [asterisk-users] Re: Asterisk Manager


> On 13:12, Wed 25 Oct 06, Maps wrote:
> > Dear Friends and Supporters!
> >
> > I try to write a php application to monitor the asterisk, but when I
open the .php to access to asterisk to retrieve the information about the
queues status, sip show peers, realtime mysql status etc...  However, It
just return to me "Unable to connect to remote asterisk (does
/var/run/asterisk.ctl exist?)"
> >
> > Asterisk is current running with the a file in /var/run/asterisk.ctl for
the user asterisk.  I have set asterisk to be the owner of the folder
/var/run, and start asterisk with user is asterisk.  HTTPD is run under
asterisk user.  My manager.conf has an entry.
> > [admin]
> > secret = password
> > deny=0.0.0.0/0.0.0.0
> > permit=127.0.0.1/255.255.255.0
> > read = system,call,log,verbose,command,agent,user
> > write = system,call,log,verbose,command,agent,user
> >
> > However, my php still unable to retrieve the information for asterisk.
> > Did I miss somethings?
>
> How are you connecting to asterisk?
> Maybe you can paste some code so we can actually see why it
> is not working.
>
> -- 
>
> Michiel van Baak
> michiel at vanbaak.eu
> http://michiel.vanbaak.eu
> GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x71C946BD
>
> "Why is it drug addicts and computer afficionados are both called users?"
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.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