diff options
Diffstat (limited to 'plugin/processes.php')
| -rw-r--r-- | plugin/processes.php | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/plugin/processes.php b/plugin/processes.php new file mode 100644 index 0000000..445e1e4 --- /dev/null +++ b/plugin/processes.php | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | # Collectd CPU plugin | ||
| 4 | |||
| 5 | require_once $CONFIG['webdir'].'/conf/config.php'; | ||
| 6 | require_once $CONFIG['webdir'].'/type/GenericStacked.class.php'; | ||
| 7 | |||
| 8 | ## LAYOUT | ||
| 9 | # processes/ | ||
| 10 | # processes/ps_state-paging.rrd | ||
| 11 | # processes/ps_state-blocked.rrd | ||
| 12 | # processes/ps_state-zombies.rrd | ||
| 13 | # processes/ps_state-stopped.rrd | ||
| 14 | # processes/ps_state-running.rrd | ||
| 15 | # processes/ps_state-sleeping.rrd | ||
| 16 | |||
| 17 | # grouped | ||
| 18 | require_once $CONFIG['webdir'].'/inc/collectd.inc.php'; | ||
| 19 | $tinstance = collectd_plugindetail($host, $plugin, 'ti'); | ||
| 20 | |||
| 21 | $obj = new Type_GenericStacked; | ||
| 22 | $obj->datadir = $CONFIG['datadir']; | ||
| 23 | $obj->path_format = '{host}/{plugin}/{type}-{tinstance}.rrd'; | ||
| 24 | $obj->args = array( | ||
| 25 | 'host' => $host, | ||
| 26 | 'plugin' => $plugin, | ||
| 27 | 'pinstance' => $pinstance, | ||
| 28 | 'type' => $type, | ||
| 29 | 'tinstance' => $tinstance, | ||
| 30 | ); | ||
| 31 | $obj->data_sources = array('value'); | ||
| 32 | $obj->ds_names = array( | ||
| 33 | 'paging' => 'Paging ', | ||
| 34 | 'blocked' => 'Blocked ', | ||
| 35 | 'zombies' => 'Zombies ', | ||
| 36 | 'stopped' => 'Stopped ', | ||
| 37 | 'running' => 'Running ', | ||
| 38 | 'sleeping' => 'Sleeping', | ||
| 39 | ); | ||
| 40 | $obj->colors = array( | ||
| 41 | 'paging' => 'ffb000', | ||
| 42 | 'blocked' => 'ff00ff', | ||
| 43 | 'zombies' => 'ff0000', | ||
| 44 | 'stopped' => 'a000a0', | ||
| 45 | 'running' => '00e000', | ||
| 46 | 'sleeping' => '0000ff', | ||
| 47 | ); | ||
| 48 | $obj->width = $width; | ||
| 49 | $obj->heigth = $heigth; | ||
| 50 | $obj->seconds = $seconds; | ||
| 51 | |||
| 52 | $obj->rrd_title = "Processes on $host"; | ||
| 53 | $obj->rrd_vertical = 'Processes'; | ||
| 54 | $obj->rrd_format = '%5.1lf%s'; | ||
| 55 | |||
| 56 | $obj->rrd_graph(); | ||
| 57 | |||
| 58 | ?> | ||
