From cd94ef34134d8f06af83ec97119018b4e80346a0 Mon Sep 17 00:00:00 2001
From: Pim van den Berg
Date: Sun, 20 Sep 2009 13:36:25 +0200
Subject: initial import of cgp
Collectd Graph Panel is a frontend for Collectd written in PHP.
The goal of CGP is to provide an easy-to-use frontend for Collectd,
starting with page that shows an overview of all the hosts you are
managing with Collectd.
In this initial import there is support for the plugins that are default
enabled in Collectd. The supported plugins are located in the plugin
directory.
---
detail.php | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 detail.php
(limited to 'detail.php')
diff --git a/detail.php b/detail.php
new file mode 100644
index 0000000..e12334d
--- /dev/null
+++ b/detail.php
@@ -0,0 +1,52 @@
+« %s'."\n",
+ $CONFIG['weburl'].'/host.php?h='.htmlentities($host), $host
+);
+
+$term = array(
+ '2hour' => 3600*2,
+ '6hour' => 3600*6,
+ 'day' => 86400,
+ 'week' => 86400*7,
+ 'month' => 86400*31,
+ 'quarter'=> 86400*31*3,
+ 'year' => 86400*365,
+);
+
+$args = $_GET;
+foreach($term as $key => $s) {
+ $args['s'] = $s;
+ printf('%s'."\n",
+ $CONFIG['weburl'], build_url('detail.php', $args), $key);
+}
+
+print "
\n";
+
+$plugins = collectd_plugins($host);
+
+if(!$plugins) {
+ echo "Unknown host\n";
+ return false;
+}
+
+# show graph
+printf(''."\n", $CONFIG['weburl'], build_url('graph.php', $_GET));
+
+html_end();
+
+?>
--
cgit v1.1