Beispiel #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'] = '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();
Beispiel #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'] = '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();
Beispiel #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'] = '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();
Beispiel #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'] = 'swap';
switch ($_GET['type']) {
    case 'swap':
        $obj = new CollectdGraphStacked($config);
        $obj->setOrder(array('free', 'cached', 'used'));
        $obj->setDataSourceNames(array('free' => 'Free', 'cached' => 'Cached', 'used' => 'Used'));
        $obj->setTitle('Swap Utilization')->setVertical('Bytes');
        $obj->setColors(array('free' => '00E000', 'cached' => '0000FF', 'used' => 'FF0000'));
        break;
    case 'swap_io':
        $obj = new CollectdGraphIO($config);
        $obj->setOrder(array('out', 'in'));
        $obj->setDataSourceNames(array('out' => 'Out', 'in' => 'In'));
        $obj->setTitle('Swapped I/O Pages')->setVertical('Pages');
        $obj->setColors(array('out' => '0000FF', 'in' => '00B000'));
        break;
    default:
        break;
}
$obj->setFormat('%5.1lf%s');
$graphs[$config['plugin']][] = $obj->rrd_graph();
Beispiel #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'] = '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;
Beispiel #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'] = 'vmem';
$obj = new CollectdGraphStacked($config);
switch ($_GET['type']) {
    case 'vmpage_faults':
        $obj->setDataSources(array('minflt', 'majflt'));
        $obj->setDataSourceNames(array('minflt' => 'Minor', 'mjrflt' => 'Major'));
        $obj->setTitle('Page Faults')->setVertical('');
        break;
    case 'vmpage_io':
        $obj->setOrder(array('in', 'out'));
        $obj->setDataSourceNames(array('memory-in' => 'Memory (in)', 'memory-out' => 'Memory (out)', 'swap-in' => 'Swap (in)', 'swap-out' => 'Swap (out)'));
        $obj->setTitle('Page I/O')->setVertical('');
        $obj->setColors(array('memory-in' => 'FF0000', 'memory-out' => '0000FF', 'swap-in' => 'FF00FF', 'swap-out' => 'FFFF00'));
        break;
    case 'vmpage_number':
        $obj->setDataSources(array('value'));
        $obj->setOrder(array('active_anon', 'active_file', 'anon_pages', 'bounce', 'dirty', 'file_pages', 'free_pages', 'inactive_anon', 'inactive_file', 'mapped', 'mlock', 'page_table_pages', 'slab_reclaimable', 'slab_unreclaimable', 'unevictable', 'unstable', 'writeback', '
                        writeback_temp'));
        $obj->setTitle('Pages')->setVertical('');
        break;
    default:
        break;
}
$obj->setFormat('%5.1lf%s');
Beispiel #7
0
 case 'memcached_items':
     $obj = new CollectdGraphDefault($config);
     $obj->setDataSources(array('value'));
     $obj->setDataSourceNames(array('value' => 'Items'));
     $obj->setColors(array('value' => '00B000'));
     $obj->setTitle('Items in cache')->setVertical('Items');
     break;
 case 'memcached_octets':
     $obj = new CollectdGraphDefault($config);
     $obj->setDataSources(array('rx', 'tx'));
     $obj->setDataSourceNames(array('rx' => 'Receive', 'tx' => 'Transmit'));
     $obj->setColors(array('rx' => '0000FF', 'tx' => '00B000'));
     $obj->setTitle('Network Traffic (' . $obj->getArg('plugin_instance') . ')')->setVertical('Bytes per second');
     break;
 case 'memcached_ops':
     $obj = new CollectdGraphStacked($config);
     $obj->setDataSourceNames(array('evictions' => 'Evictions', 'hits' => 'Hits', 'misses' => 'Misses'));
     $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'));
Beispiel #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'] = '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'));
Beispiel #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'] = '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();
Beispiel #10
0
        $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;
    case 'apache_scoreboard':
        $obj = new CollectdGraphStacked($config);
        $obj->setOrder(array('open', 'idle_cleanup', 'finishing', 'logging', 'closing', 'dnslookup', 'keepalive', 'sending', 'reading', 'starting', 'waiting', 'connect', 'hard_error', 'close', 'response_end', 'write', 'response_start', 'handle_request', 'read_post', 'request_end', 'read', 'request_start'));
        $obj->setDataSources(array('value'));
        $obj->setDataSourceNames(array('open' => 'Open', 'waiting' => 'Waiting', 'starting' => 'Starting', 'reading' => 'Reading', 'sending' => 'Sending', 'keepalive' => 'KeepAlive', 'dnslookup' => 'DNS Lookup', 'closing' => 'Closing', 'logging' => 'Logging', 'finishing' => 'Fiinshing', 'idle_cleanup' => 'Idle Cleanup', 'connect' => 'Connect', 'close' => 'Close', 'hard_error' => 'Hard Error', 'read' => 'Read', 'read_post' => 'Read Post', 'write' => 'Write', 'handle_request' => 'Handle Request', 'request_start' => 'Request Start', 'request_end' => 'Request End', 'response_start' => 'Response Start', 'response_end' => 'Response End'));
        $obj->setTitle('Scoreboard')->setVertical('Slots');
        $obj->setColors(array('open' => 'E0E0E0', 'waiting' => 'FFB000', 'starting' => 'FF00FF', 'reading' => '0000FF', 'sending' => '00E000', 'keepalive' => '0080FF', 'dnslookup' => 'FF0000', 'closing' => '000080', 'logging' => 'A000A0', 'finishing' => '008080', 'idle_cleanup' => 'FFFF00', 'connect' => 'E0E0E0', 'close' => '008080', 'hard_error' => 'FF0000', 'read' => 'FF00FF', 'read_post' => '00E000', 'write' => '000080', 'handle_request' => '0080FF', 'request_start' => 'FFB000', 'request_end' => '0000FF', 'response_start' => 'FFFF00', 'response_end' => 'A000A0'));
        break;
    default:
        break;
}
$obj->setFormat("%5.1lf");
$graphs[$config['plugin']][] = $obj->rrd_graph();
Beispiel #11
0
<?php

namespace Spechal\Lcgp;

$config = \Config::get('lcgp::collectd');
// host comes from the controller that load the plugin
$config['host'] = $host;
$config['plugin'] = 'memory';
$obj = new CollectdGraphStacked($config);
$obj->setOrder(array('free', 'buffered', 'cached', 'locked', 'used'));
$obj->setDataSourceNames(array('free' => 'Free', 'buffered' => 'Buffered', 'cached' => 'Cached', 'locked' => 'Locked', 'used' => 'Used'));
$obj->setColors(array('free' => '00E000', 'buffered' => '0000FF', 'cached' => 'FFB000', 'locked' => 'FF00FF', 'used' => 'FF0000'));
$obj->setTitle('Physical Memory Usage');
$obj->setVertical('Bytes');
$obj->setFormat('%5.1lf%s');
$graphs[$config['plugin']][] = $obj->rrd_graph();
Beispiel #12
0
<?php

namespace Spechal\Lcgp;

$config = \Config::get('lcgp::collectd');
// host comes from the controller that load the plugin
$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');
Beispiel #13
0
<?php

namespace Spechal\Lcgp;

$config = \Config::get('lcgp::collectd');
// host comes from the controller that load the plugin
$config['host'] = $host;
$config['plugin'] = 'irq';
$obj = new CollectdGraphStacked($config);
$obj->setTitle('Interrupts')->setVertical('Requests per second')->setFormat('%6.1lf');
$graphs[$config['plugin']][] = $obj->rrd_graph();