VBTK::Controller - VBTK Master Controller Package


VBTK documentation  | view source Contained in the VBTK distribution.

Index


NAME

Top

VBTK::Controller - VBTK Master Controller Package

SYNOPSIS

Top

  use VBTK::Controller;

  # Define some global settings for the controller
  $obj = new VBTK::Controller (
      MasterVBServer => 'myhost1',
      SlaveVBServers => 'myhost3'
  );

  # Define a host group and which RemoteURI they should report to.
  $obj->addHostGroup(
      VBServerURI => "http://myhost1:$::VBPORT",
      HostList    => {
          myhost1 => 'vbserver,vbcommon',
          myhost2 => 'vbcommon,vbping,vbhttp',
      },
  );

  # Define a host group and which RemoteURI they should report to.
  $obj->addHostGroup(
      VBServerURI => "http://myhost3:$::VBPORT",
      HostList    => {
          myhost3 => 'vbserver,vbcommon',
          myhost4 => 'vbcommon,vbtcp',
      },
  );

  $obj->run;

DESCRIPTION

Top

This package is used to define the MasterVBServer, any SlaveVBServers and which VB monitoring scripts should be run on each host.

PUBLIC METHODS

Top

$obj = new VBTK::Controller (<parm1> => <val1>, <parm2> => <val2>, ...)

The constructor for this class accepts the following parameters which indicate which host is the master VBServer and which hosts are slave VBServers. All config file changes should be made on the master. Changes can then be manually replicated out to the slave servers and then to the clients by using the 'vbc sync' command on those hosts.

MasterVBServer

This is used to define the hostname where the master VBServer will run. This entry is used only during sync of the slave servers.

SlaveVBServers

A comma-separated list of hosts on which slave VBServer process will be run. When the 'vbc sync' command is run on a host specified in the 'SlaveVBServers' list, the vbc script will ignore the 'VBServerURI' param specified for the host and will instead use the 'VBServerURI' param specified for the host which runs the master VBServer process.

$obj->addHostGroup(<parm1> => <val1>, <parm2> => <val2>, ...)

The 'addHostGroup' method is used to define a group of hosts along with the VBServerURI they should sync from and report to. It also defines which monitoring scripts will run on each host.

VBServerURI

This is the URI from which config files will be replicated and to which all client processes running in this host group will report statuses. Hosts defined as slave servers will ignore this entry when syncing and will instead use the VBServerURI of the host specified as the master VBServer.

   VBServerURI => "http://myhost1:4712",

HostList

A pointer to a hash which matches up host names to comma-separated lists of vb scripts. The vb scripts must be names of real perl scripts in the $VBCONF directory.

  HostList => {
    myhost1 => 'vbserver1,vbcommon',
    myhost2 => 'vbserver2,vbcommon' },

SEE ALSO

Top

VBTK
VBTK::Server

AUTHOR

Top

Brent Henry, vbtoolkit@yahoo.com

COPYRIGHT

Top


VBTK documentation  | view source Contained in the VBTK distribution.