Tuxedo::Admin::Server
use Tuxedo::Admin; $admin = new Tuxedo::Admin; $server = $admin->server('GW_GRP_1','30'); print $server->servername(), "\t", $server->srvgrp(), "\t", $server->numreq(), "\n"; $rc = $server->shutdown() if ($server->exists() and ($server->state() ne 'INACTIVE')); unless ($rc < 0) { $server->max('10'); $server->update(); $server->boot(); }
Provides methods to query, add, remove and update a specific Tuxedo server instance.
Tuxedo::Admin::Server objects are not instantiated directly. Instead they are created via the server() method of a Tuxedo::Admin object.
Example:
$server = $admin->server('GW_GRP_1','30');
This applies both for existing servers and for new servers that are being created.
Used to determine whether or not the server exists in the current Tuxedo application.
if ($server->exists()) { ... }
Returns true if the server exists.
Adds the server to the current Tuxedo application.
$rc = $server->add();
Croaks if the server already exists or if the required srvid, srvgrp and servername parameters are not set. $rc is non-negative on success.
$server = $admin->server('GW_GRP_1','30'); die "Server already exists\n" if $server->exists(); $server->servername('GWTDOMAIN'); $server->min('1'); $server->max('1'); $server->grace('0'); $server->maxgen('5'); $server->restart('Y'); $rc = $server->add($server); print "Welcome!" unless ($rc < 0); $admin->print_status();
Removes the server from the current Tuxedo application.
$rc = $server->remove();
Croaks if the server is booted or if the required srvid, srvgrp and servername parameters are not set. $rc is non-negative on success.
$server = $admin->server('GW_GRP_1','30'); warn "Can't remove a server while it is booted.\n" unless ($server->state() eq 'INACTIVE'); $rc = $server->remove() if ($server->exists() and ($server->state() eq 'INACTIVE')); print "hasta la vista baby!" unless ($rc < 0); $admin->print_status();
Updates the server configuration in the current Tuxedo application with the values of the current object.
$rc = $server->update();
Croaks if the server does not exist or the required srvid and srvgrp parameters are not set. $rc is non-negative on success.
$server = $admin->server('GW_GRP_1', '30'); die "Can't find server\n" unless $server->exists(); $server->grace('0') $server->restart('Y'); $rc = $server->update(); $admin->print_status(*STDERR);
Starts the server.
$rc = $server->boot();
Croaks if the server is already booted. $rc is non-negative on success.
$server = $admin->server('GW_GRP_1','30'); $rc = $server->boot() if ($server->exists() and ($server->state() ne 'ACTIVE'));
Stops the server.
$rc = $server->shutdown();
Croaks if the server is not running. $rc is non-negative on success.
$server = $admin->server('GW_GRP_1','30'); $rc = $server->shutdown() if ($server->exists() and ($server->state() ne 'INACTIVE'));
Returns the list of services advertised by this server.
@services = $server->services();
where @services is an array of references to Tuxedo::Admin::Service objects.
print "Server: ", $server->servername(), " advertises:\n"; foreach $service ($server->services()) { print "\t", $service->servicename(), "\n"; }
The following methods are available to get and set the server parameters. If an argument is provided then the parameter value is set to be the argument value. The value of the parameter is returned.
# Get the server name print $server->servername(), "\n"; # Set the server name $server->servername('GWTDOMAIN');
To install Tuxedo::Admin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tuxedo::Admin
CPAN shell
perl -MCPAN -e shell install Tuxedo::Admin
For more information on module installation, please visit the detailed CPAN module installation guide.