* * Rewrite/Makeover to update the interface and add dlr support * Alejandro Guerrieri * * Copyright (c) 2003-2009 Kannel Group. * */ require_once("config.php"); require_once("xmlfunc.php"); require_once("xmltoarray.php"); $depth = array(); $status = array(); /* set php internal error reporting level */ error_reporting(0); /* Refresh variables */ $timeout = get_timeout(); $t_down = ceil($timeout / 2); $t_up = ceil($timeout * 2); $purl = parse_url($_SERVER['REQUEST_URI']); $base_uri = $purl[path]; ?> Kannel Status

Kannel Status Monitor

Current date and time:
Refresh rate:
s | s | s

Configured instances

$config) { //echo "
Name Status Started Uptime SMS (MO) DLR (MO) SMS (MT) DLR (MT) Commands
\n"; /* get the status.xml URL of one config */ $url = $config["base_url"]."/status.xml?password=".$config["status_passwd"]; $xml_data = ""; /* open the file description to the URL */ if (($fp = fopen($url, "r"))) { $bgcolor = 'green'; /* read the XML input */ while (!feof($fp)) { $xml_data .= fread($fp, 200000); } fclose($fp); $xml_obj = new XmlToArray($xml_data); $status[$inst] = cleanup_array($xml_obj->createArray()); for ($i=0;$i < sizeof($status[$inst]['smscs']); $i++) { clean_branch($status[$inst]['smscs'][$i], ''); } /* get the status of this bearerbox */ list ($st, $started, $uptime) = parse_uptime($status[$inst]['status']); /* get the info of this bearerbox into a button, to save some screen real-estate*/ $ver = preg_replace("/\n+/", '\\n', $status[$inst]['version']); $ver = preg_replace("/[\'\`]/", "\'", $ver); $ver = 'Url: '.$config["base_url"].'\n\n'.$ver; $boxstatus = array ( 'name' => ''.$config['name'].'', 'bgcolor' => 'green', 'status' => $st, 'started' => $started, 'uptime' => $uptime, ); } else { $boxstatus = array ( 'name' => $config['name'], 'bgcolor' => 'red', 'status' => 'error', 'started' => '-', 'uptime' => '-', ); } ?>
"; ?>

Overall SMS traffic

$config) { $cols = array( get_path($status[$inst], 'sms/received/total'), get_path($status[$inst], 'dlr/received/total'), get_path($status[$inst], 'sms/inbound'), get_path($status[$inst], 'dlr/inbound'), get_path($status[$inst], 'sms/sent/total'), get_path($status[$inst], 'dlr/sent/total'), get_path($status[$inst], 'sms/outbound'), get_path($status[$inst], 'dlr/outbound'), get_path($status[$inst], 'sms/received/queued'), get_path($status[$inst], 'sms/sent/queued'), ); for ($i=0;$i<10;$i++) { $sums[$i] += $cols[$i]; } ?>
Instance Received (MO) Received (DLR) Inbound (MO) Inbound (DLR) Sent (MT) Sent (DLR) Outbound (MT) Outbound (DLR) Queued (MO) Queued (MT)
Total

Box connections

$config) { /* drop an error in case we have no boxes connected */ if (!is_array($status[$inst]['boxes']) || sizeof($status[$inst]['boxes']) < 0) { ?> 0) ? " class=\"sep\"":''; /* loop the boxes */ foreach ($status[$inst]['boxes'] as $box) { list ($st, $started, $uptime) = parse_uptime($box['status']); ?> >
Instance Type ID IP Queued (MO) Started Uptime SSL
No boxes connected to this bearerbox!
msgs

SMSC connections

$config) { $smsc_status = count_smsc_status($status[$inst]['smscs']); $cols = array( array_sum($smsc_status), $smsc_status['online'], $smsc_status['disconnected'], $smsc_status['connecting'], $smsc_status['re-connecting'], $smsc_status['dead'], $smsc_status['unknown'], ); for ($i=0;$i<7;$i++) { $sums[$i] += $cols[$i]; } ?>
Instance Links Online Disconnected Connecting Re-Connecting Dead Unknown
Total

SMSC connection details

$config) { $sep = ($inst > 0) ? " class=\"sep\"":''; foreach ($status[$inst]['smscs'] as $smsc) { list ($st, $uptime) = explode(" ", $smsc['status']); $uptime = ($uptime) ? get_uptime($uptime):'-'; ?> >
Instance SMSC-ID Status Uptime Received (MO) Received (DLR) Sent (MT) Sent (DLR) Failed (MT) Queued (MT) Admins
[]
/stop-smsc?smsc=', '', ''); return false;">stop | /start-smsc?smsc=', '', ''); return false;">start
/remove-smsc?smsc=', '', ''); return false;">remove | /add-smsc?smsc=', '', ''); return false;">add
0) { echo "&details=1"; } else { echo "?details=1"; } echo "\">SMSC connection details\n"; } ?>