diff options
Diffstat (limited to '')
| -rw-r--r-- | detail.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/detail.php b/detail.php new file mode 100644 index 0000000..e12334d --- /dev/null +++ b/detail.php | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | require_once 'inc/html.inc.php'; | ||
| 4 | require_once 'inc/collectd.inc.php'; | ||
| 5 | |||
| 6 | $host = $_GET['h']; | ||
| 7 | $plugin = $_GET['p']; | ||
| 8 | $pinstance = $_GET['pi']; | ||
| 9 | $type = $_GET['t']; | ||
| 10 | $tinstance = $_GET['ti']; | ||
| 11 | $width = $_GET['x']; | ||
| 12 | $heigth = $_GET['y']; | ||
| 13 | $seconds = $_GET['s']; | ||
| 14 | |||
| 15 | html_start(); | ||
| 16 | |||
| 17 | printf('<h1><a href="%s">«</a> %s</h1>'."\n", | ||
| 18 | $CONFIG['weburl'].'/host.php?h='.htmlentities($host), $host | ||
| 19 | ); | ||
| 20 | |||
| 21 | $term = array( | ||
| 22 | '2hour' => 3600*2, | ||
| 23 | '6hour' => 3600*6, | ||
| 24 | 'day' => 86400, | ||
| 25 | 'week' => 86400*7, | ||
| 26 | 'month' => 86400*31, | ||
| 27 | 'quarter'=> 86400*31*3, | ||
| 28 | 'year' => 86400*365, | ||
| 29 | ); | ||
| 30 | |||
| 31 | $args = $_GET; | ||
| 32 | foreach($term as $key => $s) { | ||
| 33 | $args['s'] = $s; | ||
| 34 | printf('<a href="%s/%s">%s</a>'."\n", | ||
| 35 | $CONFIG['weburl'], build_url('detail.php', $args), $key); | ||
| 36 | } | ||
| 37 | |||
| 38 | print "<br>\n"; | ||
| 39 | |||
| 40 | $plugins = collectd_plugins($host); | ||
| 41 | |||
| 42 | if(!$plugins) { | ||
| 43 | echo "Unknown host\n"; | ||
| 44 | return false; | ||
| 45 | } | ||
| 46 | |||
| 47 | # show graph | ||
| 48 | printf('<img src="%s/%s">'."\n", $CONFIG['weburl'], build_url('graph.php', $_GET)); | ||
| 49 | |||
| 50 | html_end(); | ||
| 51 | |||
| 52 | ?> | ||
