Пример #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'] = 'ntpd';
$obj = new CollectdGraphDefault($config);
$obj->setDataSourceNames(array('ping' => 'Ping Time', 'ping_stddev' => 'Ping Std. Deviation', 'ping_droprate' => 'Ping Drop Rate'));
switch ($_GET['type']) {
    case 'delay':
        $obj->setTitle('Delay')->setVertical('Seconds');
        break;
    case 'frequency_offset':
        $obj->setTitle('Frequency Offset')->setVertical('ppm');
        break;
    case 'time_dispersion':
        $obj->setTitle('Time Dispersion')->setVertical('Seconds');
        break;
    case 'time_offset':
        $obj->setTitle('Time Offset')->setVertical('Seconds');
        break;
    default:
        break;
}
$obj->setFormat('%5.1lf%s');
$graphs[$config['plugin']][] = $obj->rrd_graph();
Пример #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'] = 'contextswitch';
$obj = new CollectdGraphDefault($config);
$obj->setDataSources(array('value'));
$obj->setDataSourceNames(array('value' => 'Context Switches'));
$obj->setColors(array('value' => '000F00'));
$obj->setTitle('Context Switches');
$obj->setVertical('Switches per second');
$obj->setFormat('%4.0lf');
$graphs[$config['plugin']][] = $obj->rrd_graph();
Пример #3
0
<?php

namespace Spechal\Lcgp;

$config = \Config::get('lcgp::collectd');
// host comes from the controller that load the plugin
$config['host'] = $host;
$config['plugin'] = 'users';
$obj = new CollectdGraphDefault($config);
$obj->setDataSourceNames(array('value' => 'Users'));
$obj->setColors(array('value' => '0000F0'));
$obj->setTitle('Users')->setVertical('Logged in')->setFormat('%.1lf');
$graphs[$config['plugin']][] = $obj->rrd_graph();
Пример #4
0
        $obj->setOrder(array('evictions', 'hits', 'misses'));
        $obj->setColors(array('evictions' => '00E000', 'hits' => '0000FF', 'misses' => 'FFB000'));
        $obj->setTitle('Operations')->setVertical('Commands');
        break;
    case 'percent':
        $obj = new CollectdGraphDefault($config);
        $obj->setDataSources(array('value'));
        $obj->setDataSourceNames(array('value' => 'Percent'));
        $obj->setColors(array('value' => '00B000'));
        $obj->setTitle('Hit/Miss Ratio')->setVertical('Percent');
        break;
    case 'ps_count':
        $obj = new CollectdGraphDefault($config);
        $obj->setDataSources(array('threads'));
        $obj->setDataSourceNames(array('threads' => 'Threads'));
        $obj->setColors(array('threads' => '00B000'));
        $obj->setTitle('Thread Count')->setVertical('Number of threads');
        break;
    case 'ps_cputime':
        $obj = new CollectdGraphDefault($config);
        $obj->setDataSources(array('user', 'syst'));
        $obj->setDataSourceNames(array('user' => 'User', 'syst' => 'System'));
        $obj->setOrder(array('user', 'syst'));
        $obj->setColors(array('user' => '00E000', 'syst' => '0000FF'));
        $obj->setTitle('CPU Time')->setVertical('Time');
        break;
    default:
        break;
}
$obj->setFormat("%5.1lf");
$graphs[$config['plugin']][] = $obj->rrd_graph();
Пример #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'] = 'apache';
$obj = new CollectdGraphDefault($config);
$obj->setDataSources(array('value'));
switch ($_GET['type']) {
    case 'apache_bytes':
        $obj->setDataSourceNames(array('value' => 'Bytes'));
        $obj->setTitle('Traffic')->setVertical('Bytes per second');
        $obj->setColors(array('value' => '0000FF'));
        break;
    case 'apache_connections':
        $obj->setDataSourceNames(array('value' => 'Connections per second'));
        $obj->setTitle('Connections')->setVertical('Connections per second');
        $obj->setColors(array('value' => '00B000'));
        break;
    case 'apache_idle_workers':
        $obj->setDataSourceNames(array('value' => 'Workers'));
        $obj->setTitle('Idle Workers')->setVertical('Workers');
        $obj->setColors(array('value' => '0000FF'));
        break;
    case 'apache_requests':
        $obj->setDataSourceNames(array('value' => 'Requests per second'));
        $obj->setTitle('Requests')->setVertical('Requests per second');
        $obj->setColors(array('value' => '00B000'));
        break;
Пример #6
0
$config['host'] = $host;
$config['plugin'] = 'redis';
switch ($_GET['type']) {
    case 'memory':
        $obj = new CollectdGraphDefault($config);
        $obj->setTitle('Memory Usage')->setVertical('Bytes');
        break;
    case 'current_connections':
        $obj = new CollectdGraphStacked($config);
        $obj->setDataSourceNames(array('clients' => 'Clients', 'slaves' => 'Slaves'));
        $obj->setOrder(array('clients', 'slaves'));
        $obj->setColors(array('clients' => '00E000', 'slaves' => '0000FF'));
        $obj->setTitle('Connections')->setVertical('Connections');
        break;
    case 'total_connections':
        $obj = new CollectdGraphDefault($config);
        $obj->setTitle('Total Connections')->setVertical('Total Connections');
        break;
    case 'volatile_changes':
        $obj = new CollectdGraphDefault($config);
        $obj->setTitle('Volatile Changes')->setVertical('Volatile Changes');
        break;
    case 'total_operations':
        $obj = new CollectdGraphDefault($config);
        $obj->setTitle('Total Operations')->setVertical('Total Operations');
        break;
    default:
        break;
}
$obj->setFormat("%5.1lf");
$graphs[$config['plugin']][] = $obj->rrd_graph();
Пример #7
0
<?php

namespace Spechal\Lcgp;

$config = \Config::get('lcgp::collectd');
// host comes from the controller that load the plugin
$config['host'] = $host;
$config['plugin'] = 'entropy';
$obj = new CollectdGraphDefault($config);
$obj->setDataSources(array('value'));
$obj->setDataSourceNames(array('value' => 'Entropy Bits'));
$obj->setColors(array('value' => '000F00'));
$obj->setTitle('Available Entropy');
$obj->setVertical('Bits');
$obj->setFormat('%4.0lf');
$graphs[$config['plugin']][] = $obj->rrd_graph();
Пример #8
0
<?php

namespace Spechal\Lcgp;

$config = \Config::get('lcgp::collectd');
// host comes from the controller that load the plugin
$config['host'] = $host;
$config['plugin'] = 'varnish';
$obj = new CollectdGraphDefault($config);
$obj->setTitle(ucfirst($obj->getArg('plugin_instance')))->setVertical('Hits')->setFormat('%5.1lf%s');
$graphs[$config['plugin']][] = $obj->rrd_graph();
Пример #9
0
<?php

namespace Spechal\Lcgp;

$config = \Config::get('lcgp::collectd');
// host comes from the controller that load the plugin
$config['host'] = $host;
$config['plugin'] = 'load';
$obj = new CollectdGraphDefault($config);
$obj->setDataSources(array('shortterm', 'midterm', 'longterm'));
$obj->setDataSourceNames(array('shortterm' => '1 min', 'midterm' => '5 min', 'longterm' => '15 min'));
$obj->setColors(array('shortterm' => '00FF00', 'midterm' => '0000FF', 'longterm' => 'FF0000'));
$obj->setTitle('Load')->setVertical('System Load')->setFormat('%.2lf');
$graphs[$config['plugin']][] = $obj->rrd_graph();