<?php
//from: http://de.dyn.com/blog/power-outages-using-dyndns-pro-to-get-updates-faster-than-your-power-company-can/
//Script to get server uptime
$shellcommand = shell_exec('uptime');
$uptime = explode(' up ', $shellcommand);
$uptime = explode(',', $uptime[1]);
$uptime = $uptime[0].', '.$uptime[1];
// echo ('Server uptime: ' . $uptime . '');
//ENDE Original
//Last ermitteln
$load = explode('average: ', $shellcommand);
$load = $load[1];
//externe IP ermitteln
$ip = shell_exec('showdsldstat');
$ip = explode('0: IPv4: ip ', $ip); //in den Hochkommas anpassen (z.B. '0: ip ')
$ip = explode(' peer ', $ip[1]); //in den Hochkommas anpassen (z.B. ' mask ')
$ip = $ip[0];
//WLAN Status ermitteln
$wlan = shell_exec('ctlmgr_ctl r wlan settings/ap_enabled');
if ($wlan == 0) {
$wlan = "Wlan ist AUS";
}
else {
$wlan = "Wlan ist AN";
}
//Ausgabe für Snom
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<SnomIPPhoneText>";
echo "<Text>";
echo ('Fritz!Box uptime:<br/>' . $uptime . '<br/>');
echo "load average:<br/>";
echo $load;
echo "<br/>ext. IP-Adresse:<br/>" .$ip;
echo "<br/>" .$wlan;
echo "</Text>";
// echo "<Fetch mil="5000">snom://mb_exit</Fetch>"; //klappt nicht
echo "<Fetch mil=/"5000/">snom://mb_exit</Fetch>"; //so geht's
echo "</SnomIPPhoneText>";
?>