Example #1
0
<?php

namespace Spechal\Lcgp;

$config = \Config::get('lcgp::collectd');
// host comes from the controller that load the plugin
$config['host'] = $host;
$config['plugin'] = 'tcpconns';
$obj = new CollectdGraphStacked($config);
$obj->setTitle('TCP Connections (' . $obj->getArg('plugin_instance') . ')');
$obj->setVertical('#');
$obj->setFormat('%5.1lf');
$graphs[$config['plugin']][] = $obj->rrd_graph();
Example #2
0
<?php

namespace Spechal\Lcgp;

$config = \Config::get('lcgp::collectd');
// host comes from the controller that load the plugin
$config['host'] = $host;
$config['plugin'] = 'nfs';
$obj = new CollectdGraphStacked($config);
$obj->setDataSources(array('value'));
switch ($obj->getArg('type')) {
    case 'v2client':
        $this->setOrder(array('create', 'fsstat', 'getattr', 'link', 'lookup', 'mkdir', 'null', 'readdir', 'readlink', 'read', 'remove', 'rename', 'rmdir', 'root', 'setattr', 'symlink', 'wrcache', 'write'));
        break;
    case 'v3client':
        $this->setOrder(array('access', 'commit', 'create', 'fsinfo', 'fsstat', 'getattr', 'link', 'lookup', 'mkdir', 'mknod', 'null', 'pathconf', 'read', 'readdir', 'readdirplus', 'readlink', 'remove', 'rename', 'rmdir', 'setattr', 'symlink', 'write'));
        break;
    default:
        break;
}
$obj->setTitle('NFS Operations (' . $obj->getArg('plugin_instance') . ')')->setVertical('Operations')->setFormat('%5.2lf');
$graphs[$config['plugin']][] = $obj->rrd_graph();
Example #3
0
File: df.php Project: Spechal/l5cgp
<?php

namespace Spechal\Lcgp;

$config = \Config::get('lcgp::collectd');
// host comes from the controller that load the plugin
$config['host'] = $host;
$config['plugin'] = 'df';
$obj = new CollectdGraphStacked($config);
$obj->setOrder(array('reserved', 'free', 'used'));
$obj->setDataSourceNames(array('reserved' => 'Reserved', 'free' => 'Free', 'used' => 'Used'));
$obj->setColors(array('reserved' => 'AAAAAA', 'free' => '00FF00', 'used' => 'FF0000'));
$obj->setTitle('Free space (' . $obj->getArg('plugin_instance') . ')');
$obj->setVertical('Bytes');
$obj->setFormat('%5.1lf%sB');
$graphs[$config['plugin']][] = $obj->rrd_graph();
Example #4
0
<?php

namespace Spechal\Lcgp;

$config = \Config::get('lcgp::collectd');
// host comes from the controller that load the plugin
$config['host'] = $host;
$config['plugin'] = 'processes';
$obj = new CollectdGraphStacked($config);
switch ($obj->getArg('type')) {
    case 'ps_state':
        $obj->setDataSourceNames(array('paging' => 'Paging', 'blocked' => 'Blocked', 'zombies' => 'Zombies', 'stopped' => 'Stopped', 'running' => 'Running', 'sleeping' => 'Sleeping'));
        $obj->setColors(array('paging' => 'FFB000', 'blocked' => 'FF00FF', 'zombies' => 'FF0000', 'stopped' => 'A000A0', 'running' => '00E000', 'sleeping' => 'F0A000'));
        $obj->setTitle('Processes')->setVertical('Processes');
        break;
    case 'fork_rate':
        $obj->setDataSourceNames(array('value' => 'Forks'));
        $obj->setColors(array('value' => 'F0A000'));
        $obj->setTitle('Fork Rate')->setVertical('Forks per second');
        break;
    case 'ps_code':
        $obj->setDataSourceNames(array('value' => 'TRS'));
        $obj->setColors(array('value' => '0000FF'));
        $obj->setTitle('Text Resident Set (' . $obj->getArg('plugin_instance') . ')')->setVertical('Bytes');
        break;
    case 'ps_count':
        $obj->setDataSources(array('processes', 'threads'));
        $obj->setDataSourceNames(array('processes' => 'Processes', 'threads' => 'Threads'));
        $obj->setColors(array('processes' => '0000FF', 'threads' => 'FF0000'));
        $obj->setTitle('Processes / Threads (' . $obj->getArg('plugin_instance') . ')')->setVertical('Amount');
        break;
Example #5
0
<?php

namespace Spechal\Lcgp;

$config = \Config::get('lcgp::collectd');
// host comes from the controller that load the plugin
$config['host'] = $host;
$config['plugin'] = 'mysql';
$obj = new CollectdGraphStacked($config);
$obj->setFormat('%5.1lf%s');
#$obj->setDataSources(array('read', 'write'));
switch ($obj->getArg('type')) {
    case 'cache_result':
        $obj->setDataSourceNames(array('qcache-not_cached' => 'Not Cached', 'qcache-inserts' => 'Inserts', 'qcache-hits' => 'Hits', 'qcache-prunes' => 'Low Memory Prunes'));
        $obj->setColors(array('qcache-not_cached' => 'F0A000', 'qcache-inserts' => '0000FF', 'qcache-hits' => '00E000', 'qcache-prunes' => 'FF0000'));
        $obj->setTitle('Query Cache (' . $obj->getArg('plugin_instance') . ')')->setVertical('Queries per second');
        break;
    case 'cache_size':
        $obj->setDataSourceNames(array('qcache' => 'Queries'));
        $obj->setTitle('Query Cache Size (' . $obj->getArg('plugin_instance') . ')')->setVertical('Queries in cache');
        break;
    case 'mysql_commands':
        $obj->setTitle('Commands (' . $obj->getArg('plugin_instance') . ')')->setVertical('Issues per second');
        break;
    case 'mysql_handler':
        $obj->setOrder(array('commit', 'delete', 'read_first', 'read_key', 'read_next', 'read_prev', 'read_rnd', 'read_rnd_next', 'update', 'write', 'rollback'));
        $obj->setColors(array('commit' => 'FF0000', 'delete' => 'FF00E7', 'read_first' => 'CC00FF', 'read_key' => '3200FF', 'read_next' => '0065FF', 'read_prev' => '00FFF3', 'read_rnd' => '00FF65', 'read_rnd_next' => '33FF00', 'update' => 'CBFF00', 'write' => 'FF9800', 'rollback' => '000000'));
        $obj->setTitle('MySQL Handler (' . $obj->getArg('plugin_instance') . ')')->setVertical('Invocations');
        break;
    case 'mysql_locks':
        $obj->setColors(array('immediate' => 'FF0000', 'waited' => '00FF00'));
Example #6
0
<?php

namespace Spechal\Lcgp;

$config = \Config::get('lcgp::collectd');
// host comes from the controller that load the plugin
$config['host'] = $host;
$config['plugin'] = 'cpu';
$obj = new CollectdGraphStacked($config);
$obj->setOrder(array('idle', 'nice', 'user', 'wait', 'system', 'softirq', 'interrupt', 'steal'));
$obj->setDataSourceNames(array('idle' => 'Idle', 'nice' => 'Nice', 'user' => 'User', 'wait' => 'I/O Wait', 'system' => 'System', 'softirq' => 'SoftIRQ', 'interrupt' => 'Interrupt', 'steal' => 'Steal'));
$obj->setColors(array('idle' => 'E8E8E8', 'nice' => '00E000', 'user' => '0000FF', 'wait' => 'FFB000', 'system' => 'FF0000', 'softirq' => 'FF00FF', 'interrupt' => 'A000A0', 'steal' => '000000'));
$obj->setTitle('CPU-' . $obj->getArg('plugin_instance') . ' Usage');
$obj->setVertical('Jiffies');
$obj->setFormat('%5.2lf');
$obj->addRRDOption('-u 100');
$obj->setScale(0);
$graphs[$config['plugin']][] = $obj->rrd_graph();