Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- # Collectd Exec plugin
- require_once 'conf/common.inc.php';
- require_once 'type/Default.class.php';
- require_once 'inc/collectd.inc.php';
- ## LAYOUT
- # exec-*/temperature-<gpu>.rrd
- # exec-*/fanspeed-<gpu>.rrd ... and so on
- $obj = new Type_Default($CONFIG);
- $obj->ds_names = array(
- 'value' => 'Value'
- );
- $obj->width = $width;
- $obj->heigth = $heigth;
- switch($obj->args['type']) {
- case 'fanspeed':
- $obj->rrd_title = sprintf('Fanspeed (%s)', $obj->args['pinstance']);
- $obj->rrd_vertical = 'Percent';
- $obj->rrd_format = '%5.1lf';
- break;
- case 'temperature':
- $obj->rrd_title = sprintf('Temperature (%s)', $obj->args['pinstance']);
- $obj->rrd_vertical = 'Celsius';
- $obj->rrd_format = '%5.1lf%s';
- break;
- case 'gauge':
- $obj->rrd_title = sprintf('GPU Load (%s)', $obj->args['pinstance']);
- $obj->rrd_vertical = 'Percent';
- $obj->rrd_format = '%5.1lf';
- break;
- case 'threads':
- $obj->rrd_title = sprintf('MHash/s (%s)', $obj->args['pinstance']);
- $obj->rrd_vertical = 'Mhash/s';
- $obj->rrd_format = '%5.1lf';
- break;
- }
- collectd_flush($obj->identifiers);
- $obj->rrd_graph();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement