From dae438c070bb02e50c231a9ac6f7ea4b9b90fd2c Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Fri, 10 Aug 2012 19:02:29 +0200 Subject: plugin: convert spaces to tabs --- plugin/vserver.php | 187 ++++++++++++++++++++++++++--------------------------- 1 file changed, 93 insertions(+), 94 deletions(-) (limited to 'plugin/vserver.php') diff --git a/plugin/vserver.php b/plugin/vserver.php index e51d97d..204134e 100644 --- a/plugin/vserver.php +++ b/plugin/vserver.php @@ -28,110 +28,109 @@ require_once 'inc/collectd.inc.php'; $obj = new Type_Default($CONFIG); switch($obj->args['type']) { - case 'load': - require_once "plugin/load.php"; - break; - case 'vs_memory': - $obj = new Type_GenericStacked($CONFIG); - $obj->order = array('vm', 'vml', 'rss', 'anon'); - # http://oldwiki.linux-vserver.org/Memory+Allocation - $obj->ds_names = array( - 'vm' => "Virtual memory pages", - 'vml' => "Pages locked into memory", - 'rss' => "Resident set size", - 'anon' => "Anonymous memory pages", - ); - $obj->colors = array( - 'vm' => '00e000', - 'vml' => '0000ff', - 'rss' => 'ffb000', - 'anon' => 'ff00ff', - ); - $obj->width = $width; - $obj->heigth = $heigth; + case 'load': + require_once "plugin/load.php"; + break; + case 'vs_memory': + $obj = new Type_GenericStacked($CONFIG); + $obj->order = array('vm', 'vml', 'rss', 'anon'); + # http://oldwiki.linux-vserver.org/Memory+Allocation + $obj->ds_names = array( + 'vm' => "Virtual memory pages", + 'vml' => "Pages locked into memory", + 'rss' => "Resident set size", + 'anon' => "Anonymous memory pages", + ); + $obj->colors = array( + 'vm' => '00e000', + 'vml' => '0000ff', + 'rss' => 'ffb000', + 'anon' => 'ff00ff', + ); + $obj->width = $width; + $obj->heigth = $heigth; - $obj->rrd_title = sprintf('Memory utilization on Vserver %s', $obj->args['pinstance']); + $obj->rrd_title = sprintf('Memory utilization on Vserver %s', $obj->args['pinstance']); $obj->rrd_vertical = ucfirst($CONFIG['datasize']); $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; - $obj->rrd_format = '%5.1lf%s'; + $obj->rrd_format = '%5.1lf%s'; - collectd_flush($obj->identifiers); - $obj->rrd_graph(); - break; - case 'vs_threads': - $obj = new Type_GenericStacked($CONFIG); - $obj->order = array('running', 'uninterruptable', 'onhold', 'total'); - # http://linux-vserver.org/ProcFS - $obj->ds_names = array( - 'onhold' => "Number of threads on hold", - 'running' => "Number of running threads", - 'total' => "Total number of threads", - 'uninterruptable' => "Number of uninterruptible threads", - ); - $obj->colors = array( - 'onhold' => '00e000', - 'running' => '0000ff', - 'total' => 'ffb000', - 'uninterruptable' => 'ff00ff', - ); - $obj->width = $width; - $obj->heigth = $heigth; + collectd_flush($obj->identifiers); + $obj->rrd_graph(); + break; + case 'vs_threads': + $obj = new Type_GenericStacked($CONFIG); + $obj->order = array('running', 'uninterruptable', 'onhold', 'total'); + # http://linux-vserver.org/ProcFS + $obj->ds_names = array( + 'onhold' => "Number of threads on hold", + 'running' => "Number of running threads", + 'total' => "Total number of threads", + 'uninterruptable' => "Number of uninterruptible threads", + ); + $obj->colors = array( + 'onhold' => '00e000', + 'running' => '0000ff', + 'total' => 'ffb000', + 'uninterruptable' => 'ff00ff', + ); + $obj->width = $width; + $obj->heigth = $heigth; - $obj->rrd_title = sprintf('Threads on Vserver %s', $obj->args['pinstance']); - $obj->rrd_vertical = 'Numbers'; - $obj->rrd_format = '%5.1lf%s'; + $obj->rrd_title = sprintf('Threads on Vserver %s', $obj->args['pinstance']); + $obj->rrd_vertical = 'Numbers'; + $obj->rrd_format = '%5.1lf%s'; - collectd_flush($obj->identifiers); - $obj->rrd_graph(); - break; - case 'if_octets': - $obj->data_sources = array('rx', 'tx'); - $obj->ds_names = array( - 'inet-rx' => 'IPv4 Receive', - 'inet-tx' => 'IPv4 Transmit', - 'inet6-rx' => 'IPv6 Receive', - 'inet6-tx' => 'IPv6 Transmit', - ); - $obj->colors = array( - 'inet-rx' => '0000ff', - 'inet-tx' => '00b000', - 'inet6-rx' => 'e0e0e0', - 'inet6-tx' => 'ffb000', - 'other-rx' => 'ff00ff', - 'other-tx' => 'a000a0', - 'unix-rx' => '00e000', - 'unix-tx' => '0080ff', - 'unspec-rx' => 'ff0000', - 'unspec-tx' => '000080', - ); - $obj->rrd_title = sprintf('Traffic on Vserver %s', $obj->args['pinstance']); + collectd_flush($obj->identifiers); + $obj->rrd_graph(); + break; + case 'if_octets': + $obj->data_sources = array('rx', 'tx'); + $obj->ds_names = array( + 'inet-rx' => 'IPv4 Receive', + 'inet-tx' => 'IPv4 Transmit', + 'inet6-rx' => 'IPv6 Receive', + 'inet6-tx' => 'IPv6 Transmit', + ); + $obj->colors = array( + 'inet-rx' => '0000ff', + 'inet-tx' => '00b000', + 'inet6-rx' => 'e0e0e0', + 'inet6-tx' => 'ffb000', + 'other-rx' => 'ff00ff', + 'other-tx' => 'a000a0', + 'unix-rx' => '00e000', + 'unix-tx' => '0080ff', + 'unspec-rx' => 'ff0000', + 'unspec-tx' => '000080', + ); + $obj->rrd_title = sprintf('Traffic on Vserver %s', $obj->args['pinstance']); $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['datasize'])); $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; - $obj->width = $width; - $obj->heigth = $heigth; - $obj->rrd_format = '%5.1lf%s'; + $obj->width = $width; + $obj->heigth = $heigth; + $obj->rrd_format = '%5.1lf%s'; - collectd_flush($obj->identifiers); - $obj->rrd_graph(); - break; - case 'vs_processes': - $obj->data_sources = array('value'); - $obj->ds_names = array( - 'value' => 'Processes', - ); - $obj->rrd_title = sprintf('Processes on Vserver %s', $obj->args['pinstance']); - $obj->rrd_vertical = 'Processes'; + collectd_flush($obj->identifiers); + $obj->rrd_graph(); + break; + case 'vs_processes': + $obj->data_sources = array('value'); + $obj->ds_names = array( + 'value' => 'Processes', + ); + $obj->rrd_title = sprintf('Processes on Vserver %s', $obj->args['pinstance']); + $obj->rrd_vertical = 'Processes'; - $obj->width = $width; - $obj->heigth = $heigth; - $obj->rrd_format = '%5.1lf%s'; + $obj->width = $width; + $obj->heigth = $heigth; + $obj->rrd_format = '%5.1lf%s'; - collectd_flush($obj->identifiers); - $obj->rrd_graph(); - break; + collectd_flush($obj->identifiers); + $obj->rrd_graph(); + break; - default: - die('Not implemented yet.'); - break; + default: + die('Not implemented yet.'); + break; } -?> -- cgit v1.1