NAME
ClearCase::Proc::AlbdList - Collect info on VOB and View servers
VERSION
This document describes version 0.06, released February, 2005.
DEPENDENCIES
This class depends upon the ClearCase '/usr/atria/etc/utils/albd_list' command.
SYNOPSIS
use ClearCase::Proc::AlbdList;
$AlbdList = "ClearCase::Proc::AlbdList";
$albd = run AlbdList( undef, $storagePath );
or $albd = run AlbdList( $host, undef );
or $albd = run AlbdList( $host, $storagePath, $matchType, $matchPath );
($stat,$err) = $albd->status;
$count= $albd->count; # count of running servers
$pid = $albd->pid ( $storagePath ); # process id of a server
$type = $albd->isa ( $storagePath ); # "View" or "VOB" server
$uuid = $albd->uuid( $storagePath ); # UUID of View or VOB server
$sock = $albd->sock( $storagePath ); # Socket of View or VOB server
if ( $albd->isRunning( $storagePath ) ) { ... }
if ( $albd->notRunning( $storagePath ) ) { ... }
if ( $albd->isaVobServer( $storagePath ) ) { ... }
if ( $albd->isaViewServer( $storagePath ) ) { ... }
print $albd->formatResult;
print $albd->formatResult( "incUuid", "incSocket" );
$unparsedText = $albd->unparsed;
print $albd->dump;
DESCRIPTION
This class is used to collect information on running VOB and View servers.
Constructor
- run ( [ HostName ] [, StoragePath ] [, MatchType ] [, MatchPath ] [, MatchPID ])
-
- HostName
-
An optional VOB or View Server HostName can be provided to return information about all VOB and/or View Server processes running on a particular host.
- StoragePath
-
An optional VOB or View local StoragePath can be provided to return information only about a particular VOB or View.
- MatchType
-
An optional string that must equal either 'view' or 'vob' and is used as a simple match criterion to limit the resulting output. It is probably not a good idea to combine this with the StoragePath option.
- MatchPath
-
An optional string that can equal any part of the resulting server StoragePath string(s), used as a simple match criterion to limit the resulting output. It is probably not a good idea to combine this with the StoragePath option.
- MatchPid
-
An optional integer that can equal any one of the resulting server PID process identifier(s), used as a simple match criterion to limit the resulting output. It is probably not a good idea to combine this with the StoragePath option.
Methods
- count
-
This method returns the number of active VOB and/or View server processes found, based on the provided input criteria.
- path ( ServerPid )
-
This method returns the local storage path of an active VOB or View server process corresponding to a server's PID (process ID) parameter.
- pid ( StoragePath )
-
This method returns the process identifier (PID) of an active VOB or View server process, specified by a local StoragePath parameter.
- type ( StoragePath )
-
This method returns the type of the server process, either 'VOB' or 'View', as specified by a local StoragePath parameter.
See the 'isaVobServer' and 'isaViewSever' methods, below.
- uuid ( StoragePath )
-
Returns the UUID of the VOB or View server specified by a local StoragePath parameter.
- sock ( StoragePath )
-
Returns the Socket number of the VOB or View server specified by a local StoragePath parameter.
Note that for VOB servers this is a UDP port number, while for View servers this is a TCP port number.
- isRunning ( StoragePath )
- notRunning ( StoragePath )
-
These methods return a 'boolean' value indicating whether or not a server process is running for a particular 'VOB' or 'View', as specified by a local StoragePath parameter.
- isaVobServer ( StoragePath )
- isaViewServer ( StoragePath )
-
These methods return a 'boolean' value indicating whether or not a particular process is a 'VOB' or 'View' server, as specified by a local StoragePath parameter.
See the 'type' method, above.
- formatResult ( [ IncUuid ] [, IncSocket ] )
-
This method returns a text string containing formatted output generated from a prior call to the run method. By default it includes the server's process ID (PID), the 'type' of the server 'View' or 'VOB', and the file system storage path associated with each server in the list.
- IncUuid
-
An optional flag to include each server's UUIDs in the formatted output.
- IncSocket
-
An optional flag to include each server's Socket number in the formatted output.
Example:
PID Type Storage Path ----- ---- ---------------------------------------------------------- 1635 View /ClearCase/newview/baseline/i80_bl2004_1011 11520 View /ClearCase/newview/baseline/i80_bl2004_1012 17441 VOB /ClearCase/vob/lp_test/lp_test.vbs ------------------------------------------------------------------------
- status
- stat
- err
-
($stat,$err) = $albd->status; $stat = $albd->stat; # status number returned in scalar context ($err) = $albd->stat; # error message returned in array context ($err) = $albd->err;
- unparsed
-
This method returns any output from the 'albd_list' command that remains unrecognized by the output parser in this class.
Note that currently there will most likely be unparsed output as the parser does not completely handle all of the possible output.
- dump
-
Display contents of the current AlbdList object. This may be useful during testing and debugging, but does not produce a "pretty" format.
Example:
print $tmplObj->dump;
WARNINGS
Currently only VOB and View servers are reported using this module. Other server types, including admin, albd, db, rpc, stat, are silently omitted from the collection of parsed data.
INHERITANCE
None currently.
SEE ALSO
See albd_list.
AUTHOR
Chris Cobb
COPYRIGHT
Copyright (c) 2004-2005 by Hewlett-Packard. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.