aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/irq.php
diff options
context:
space:
mode:
authorPim van den Berg2009-09-20 13:36:25 +0200
committerPim van den Berg2009-09-20 13:45:26 +0200
commitcd94ef34134d8f06af83ec97119018b4e80346a0 (patch)
treeb01a57617cb5528554b1909583bdf110d8acb631 /plugin/irq.php
downloadapt-panopticon_cgp-cd94ef34134d8f06af83ec97119018b4e80346a0.zip
apt-panopticon_cgp-cd94ef34134d8f06af83ec97119018b4e80346a0.tar.gz
apt-panopticon_cgp-cd94ef34134d8f06af83ec97119018b4e80346a0.tar.bz2
apt-panopticon_cgp-cd94ef34134d8f06af83ec97119018b4e80346a0.tar.xz
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.
Diffstat (limited to 'plugin/irq.php')
-rw-r--r--plugin/irq.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/plugin/irq.php b/plugin/irq.php
new file mode 100644
index 0000000..2759c0e
--- /dev/null
+++ b/plugin/irq.php
@@ -0,0 +1,40 @@
1<?php
2
3# Collectd IRQ plugin
4
5require_once $CONFIG['webdir'].'/conf/config.php';
6require_once $CONFIG['webdir'].'/type/GenericStacked.class.php';
7
8## LAYOUT
9# irq/
10# irq/irq-XX.rrd
11
12# grouped
13require_once $CONFIG['webdir'].'/inc/collectd.inc.php';
14$tinstance = collectd_plugindetail($host, $plugin, 'ti');
15sort($tinstance);
16
17$obj = new Type_GenericStacked;
18$obj->datadir = $CONFIG['datadir'];
19$obj->path_format = '{host}/{plugin}/{type}-{tinstance}.rrd';
20$obj->args = array(
21 'host' => $host,
22 'plugin' => $plugin,
23 'pinstance' => $pinstance,
24 'type' => $type,
25 'tinstance' => $tinstance,
26);
27$obj->data_sources = array('value');
28$obj->ds_names = NULL;
29$obj->colors = NULL;
30$obj->width = $width;
31$obj->heigth = $heigth;
32$obj->seconds = $seconds;
33
34$obj->rrd_title = "Interrupts on $host";
35$obj->rrd_vertical = 'IRQs/s';
36$obj->rrd_format = '%6.1lf';
37
38$obj->rrd_graph();
39
40?>