4 * munin node output for the router status
9 * @package linksys-wrt3g-tools
10 * @author Christian Weiske <cweiske@cweiske.de>
12 * @link http://cweiske.de/linksys-wrt3g-tools.htm
14 require_once dirname(__FILE__) . '/../config.php';
15 require_once 'Wrt3g.php';
17 if (isset($argv[1]) && $argv[1] == 'autoconf') {
20 } else if (isset($argv[1]) && $argv[1] == 'config') {
22 graph_title WRT3G router status
23 graph_args --base 1000 -l 0 --upper-limit 7
24 graph_vlabel Status values
25 graph_category network
26 graph_info This graph shows the status of WRT3G router
27 conn_connected.label Connected
28 conn_connected.info Router is connected
29 conn_connected.draw LINE2
30 conn_connecting.label Connecting
31 conn_connecting.info Router is connecting
32 conn_connecting.draw LINE2
33 conn_disconnected.label Disconnected
34 conn_disconnected.info Router is disconnected
35 conn_disconnected.draw LINE2
36 notavailable.label Not available
37 notavailable.info Router cannot be reached
38 notavailable.draw LINE2
40 type_gprs.info Connection via GPRS
43 type_umts.info Connection via UMTS
53 $arStatus = $w->getStatus();
55 $conn = $arStatus['connection'];
56 if ($conn == 'disconnected') {
57 echo "conn_disconnected.value 1\n";
58 } else if ($conn == 'connecting') {
59 echo "conn_connecting.value 2\n";
60 } else if ($conn == 'connected') {
61 echo "conn_connected.value 3\n";
64 $type = strtolower($arStatus['type']);
65 if ($type == 'gprs') {
66 echo "type_gprs.value 4.5\n";
67 } else if ($type == 'umts') {
68 echo "type_umts.value 5\n";
70 } catch (Exception $e) {
71 echo "notavailable 0.5\n";