aboutsummaryrefslogtreecommitdiff
path: root/scripts/munin.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2010-12-28 22:53:06 +0100
committerChristian Weiske <cweiske@cweiske.de>2010-12-28 22:53:06 +0100
commitcd3b46894c6f014735a7f278a60b9bd234a11ba0 (patch)
tree58a9637886ee7a39da1e615c776bf2a7da38e5c1 /scripts/munin.php
parent04776d8e9a6eeb0371cdb7d61074850e3bf45994 (diff)
downloadlinksys-wrt3g-tools-cd3b46894c6f014735a7f278a60b9bd234a11ba0.tar.gz
linksys-wrt3g-tools-cd3b46894c6f014735a7f278a60b9bd234a11ba0.zip
add help to munin plugin
Diffstat (limited to 'scripts/munin.php')
-rwxr-xr-xscripts/munin.php45
1 files changed, 33 insertions, 12 deletions
diff --git a/scripts/munin.php b/scripts/munin.php
index 5fc2526..4872e90 100755
--- a/scripts/munin.php
+++ b/scripts/munin.php
@@ -1,28 +1,37 @@
#!/usr/bin/env php
<?php
/**
-* munin node output for the router status
-*
-* PHP version 5
-*
-* @category Tools
-* @package linksys-wrt3g-tools
-* @author Christian Weiske <cweiske@cweiske.de>
-* @license AGPL v3
-* @link http://cweiske.de/linksys-wrt3g-tools.htm
-*/
+ * Munin node plugin to monitor the router status.
+ * Part of Linksys WRT3G tools
+ *
+ * PHP version 5
+ *
+ * @category Tools
+ * @package linksys-wrt3g-tools
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @license AGPL v3
+ * @link http://cweiske.de/linksys-wrt3g-tools.htm
+ * @link http://munin-monitoring.org/wiki/ConcisePlugins
+ */
require_once 'Wrt3g.php';
if (isset($argv[1]) && $argv[1] == 'autoconf') {
- echo "yes\n";
+ $router = new Wrt3g();
+ $router->loadConfig();
+ if ($router->config->host === null) {
+ echo "no (no host configured)\n";
+ } else {
+ echo "yes\n";
+ }
exit();
+
} else if (isset($argv[1]) && $argv[1] == 'config') {
echo <<<TXT
graph_title WRT3G router status
graph_args --base 1000 -l 0 --upper-limit 7
graph_vlabel Status values
graph_category network
-graph_info This graph shows the status of WRT3G router
+graph_info This graph shows the status of a WRT3G router
conn_connected.label Connected
conn_connected.info Router is connected
conn_connected.draw LINE2
@@ -44,6 +53,18 @@ type_umts.draw LINE2
TXT;
exit();
+} else if (isset($argv[1])
+ && ($argv[1] == 'help' || $argv[1] == '--help' || $argv[1] == '-h')
+) {
+ echo <<<TXT
+munin-node plugin to monitor a linksys wrt3g router
+Commands:
+ autoconf - Check if the plugin would work
+ config - Show munin config values
+ <nothing> - Print status
+
+TXT;
+ exit();
}