The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

VBTK::ClientObject - Class for handling client-side processing of VBObjects.

SYNOPSIS

  # Add a graph group to the VBObject
  $vbObj->addGraphGroup (
    GroupNumber    => 1,
    DataSourceList => undef,
    Labels         => 'user,system,runQueue,scanRate',
    Title          => "myhost cpu",
  );

DESCRIPTION

This perl library is used by the VBTK::Parser class to handle the client-side processing of VB Objects. Do not attempt to call this class directly. The one exception is the 'addGraphGroup' method which you will commonly call to define graph groups for your VB objects.

PUBLIC METHODS

The following methods are supported

$vbObj->addGraphGroup(<parm1> => <val1>, <parm2> => <val2>, ...)

The addGraphGroup method is used to add graph group definitions to a VBObject. The graphs will be shown in the web interface under the 'GraphsX' tabs where X is the group number. Graphs are generated using the data stored in the Rrd library, so an Rrd library must have been defined. See the 'Rrd...' parms in VBTK::Parser for more details. The following parms are allowed:

GroupNumber

A number indicating which graph group to add graphs to. The group number determines which 'GraphsX' tab the graphs will be displayed undef. (Defaults to 1).

    GroupNumber => 1,
Labels

A string containing a comma-separated list of labels to display for each data source to be graphed. These must correspond one-to-one with the 'DataSourceList'. (Required)

    Labels => 'cpu-time,run-queue',    
DataSourceList

A string containing a comma-separated list of data source specifications of the form 'vbobject-name:rrdlib-column'. These should correspond one-to-one with the list of labels specified with the 'Labels' parm. The data source list vbobject-name defaults to the current VBObject if not specified. The 'rrd-lib-column' defaults to it's position in the list if not specified. So, for example, if there are two labels in the 'Labels' list, and the object is named '.myhost.cpu', then the DataSource list would default to:

    DataSourceList => '.myhost.cpu:0,.myhost.cpu:1',

Note that you can specify any VBObject name and Rrd lib column, so you can create graphs made up from any Rrd library hosted on the VBServer. So for example, if you wanted to graph just the cpu-time but from two hosts 'myhost1' and 'myhost2', and you knew that cpu-time was stored in column 0 of the rrdlib for those objects, then you would use the following setting:

    Labels         => 'cpu myhost1','cpu myhost2',
    DataSourceList => '.myhost1.cpu:0,.myhost2.cpu:0',
LineWidth

A number indicating the linewidth to be passed to the Rrd lib tool when generating the graph. (Defaults to 1)

    LineWidth => 2,
Colors

A string containing a comma-separated list of color specifications to be used when drawing the lines on the graph. These should correspond one-to-one with the list of 'Labels'. (Defaults to a list of standard colors)

    Colors => '#00FF00,#FF0000',
VLabel

A string containing a label to be placed on the vertical axis of the graph. (Defaults to none)

    VLabel => 'myhost1 cpu utilization',
Title

A string containing a title to be displayed at the top of the graph. If the graph is less than 100 pixels high, then this title will be moved down into the legend to make better use of space. (Defaults to none)

    Title => 'CPU utilization for myhost1',
TimeWindowList

A string containing a comma-separated list of time expressions. For each time expression, a graph will be displayed which shows the data in the Rrd library over the specified time window. Note that n time window expressions will result in n separate graphs being displayed, one below the other. (Defaults to '1day,1week,1month,1year')

    TimeWindowList => '1day,1week',
CF

A string containing the CF specifier to be passed to the Rrd tool when generating the graph. See the Rrd man page for more details. (Defaults to 'AVERAGE').

    CF => 'MAX',
XSize

A number indicating the X-axis size of the graph to be generated. (Defaults to 600)

    XSize => 600,
YSize

A number indicating the Y-axis size of the graph to be generated. (Defaults to 60)

    YSize => 60,
Target

A pointer to a hash containing name value pairs which describe what to do when a user clicks on the graph itself. The 'target' graph will inherit it's values from the initial graph, with the specified overrides being applied. The following overrides are allowed:

XSize, YSize

If XSize and YSize overrides are specified, then clicking on the graph will cause an identical graph to be displayed, but sized with the new sizes. This is useful for zooming in on a graph.

    Target => {
        XSize => 800,
        YSize => 600 },
VBObjName, GroupNumber

If the VBObjName and/or GroupNumber overrides are specified, then clicking on the graph will jump to the specified VBObject and GroupNumber. This is usefull for jumping to a different arrangement of graphs, perhaps which show more detail or show data grouped in a different way.

    Target => {
        VBObjName   => '.myhost2.cpu',
        GroupNumber => 2 },

If no Target is specified, then it will default to:

        Target => { XSize => 800, YSize => 300 }

PRIVATE METHODS

Haven't gotten around to documenting these yet, but you shouldn't be messing with them anyway.

SEE ALSO

VBTK::Wrapper:: VBTK::ClientObject

AUTHOR

Brent Henry, vbtoolkit@yahoo.com

COPYRIGHT

Copyright (C) 1996-2002 Brent Henry

This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation available at: http://www.gnu.org/copyleft/gpl.html

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.