NAME

Ingres::Utility::Netutil - API to Netutil Ingres RDBMS utility

VERSION

Version 0.01

SYNOPSIS

    use Ingres::Utility::Netutil;
    
    # create a connection to NETUTIL utility
    $foo = Ingres::Utility::Netutil->new();
    
    # Attention: many arguments accept wildcard *
    
    # showLogin($type,$vnode) - prepare to provide info on login VNodes
    #                           and return netutil ouput
    print $foo->showLogin('global','*');
    
    #
    # getLogin() - return one-by-one all login VNodes previously prepared
    while ( ($type, $login, $vnode, $acct) = $foo->getLogin() ) {
    	print "Type: $type\tName: $vnode\tAccount: $acct\n";
    }
    
    # showConn($type, $conn, $vnode, $addr, $proto, $listen)
    #                         - prepare to provide info on connections of a VNode
    #                           and return netutil ouput
    print $foo->showConn('global','sample_vnode_name', '*', '*', '*');
    
    #
    # getConn() - return one-by-one all connections of a VNodes previously prepared
    while ( @conn = $foo->getConn() ) {
	($type, $conn, $vnode, $addr, $proto, $listen) = @conn;
    	print "Type: $type\tName: $vnode\tAddress: $addr\tProtocol: $proto";
    	print "\tListen Address: $listenAddr\n";
    }
    
    # createLogin($type,$vnode,$acct, $passwd) - create a new VNode
    $foo->createLogin('global', 'new_vnode_name', 'sample_login_account', 'secret_passwd');
    
    # createConn($type,$vnode,$addr,$proto,$listenAddr) - create a connection for a VNode
    $foo->createConn('global', 'new_vnode_name', '192.168.0.1', 'tcp_ip', 'II');
    
    # destroyConn($type,$vnode,$acct, $passwd) - destroy a connection from a VNode
    $foo->destroyConn('global', 'new_vnode_name', '192.168.0.1', 'tcp_ip', 'II');
    
    # destroyLogin($type,$vnode) - destroy a VNode and all connections
    $foo->destroyLogin('global', 'new_vnode_name');
    
    # quiesceServer($serverId) - stop IIGCC server after all connections close (die gracefully)
    # if no $serverId is given, then all IIGCC servers are affected (carefull).
    $foo->quiesceServer('sample_server_id');
    
    # stopServer($serverId) - stop IIGCC server imediately (break connections)
    # if no $serverId is given, then all IIGCC servers are affected (carefull).
    $foo->stopServer('sample_server_id');

The server id can be obtained through Ingres::Utility::IINamu module.

DESCRIPTION

This module provides an API to netutil utility for Ingres RDBMS, which provides local control of IIGCC servers for Ingres Net inbound and outbound remote connections, and also manage logins and connections to remote servers, a.k.a. VNodes.

FUNCTIONS

new

Start interaction with netutil utility.

Takes the user id as optional argument to identify which user's private VNodes to control. (user privileges may be necessary).

showLogin

Prepare to return VNode login info.

Returns output from netutil.

Takes the VNode type to filter: GLOBAL/PRIVATE/*.

Takes de VNode name to filter (wildcard enabled).

getLogin

Returns sequentially (call-after-call) each VNode info reported by showLogin() as an array of 3 elements.

showConn

Prepare to return VNode connection info.

Returns output from netutil.

Takes the following parameters: $type - VNode type: GLOBAL/PRIVATE/* $vnode - VNode name or '*' $addr - IP, hostname of the server or '*' $proto - protocol name (tcp_ip, win_tcp, ipx, etc.) $listen - remote server's listen address (generaly 'II') or '*'

getConn

Returns sequentially (call-after-call) each VNode connection info reported by showConn() as an array of 5 elements:

createLogin($type, $vnode)

Create a Login VNode.

Returns output from netutil.

Takes the following parameters: $type - VNode type: GLOBAL/PRIVATE $vnode - VNode name

createConn

Create a connection for a Login VNode.

Returns output from netutil.

Takes the following parameters: $type - VNode type: GLOBAL/PRIVATE $vnode - VNode name $addr - IP, hostname of the server $proto - protocol name (tcp_ip, win_tcp, ipx, etc.) $listen - remote server's listen address (generaly 'II')

destroyLogin

Delete a Login VNode and all its connections.

Returns output from netutil.

Takes the VNode type to filter: GLOBAL/PRIVATE/*.

Takes de VNode name to filter (wildcard enabled).

destroyConn

Destroy (delete) a connection for a Login VNode.

Returns output from netutil.

Takes the following parameters: $type - VNode type: GLOBAL/PRIVATE $vnode - VNode name $addr - IP, hostname of the server, or '*' $proto - protocol name (tcp_ip, win_tcp, ipx, etc.), or '*' $listen - remote server's listen address (generaly 'II'), or '*'

sub quiesceStopServer { my $this = shift; my $cmd = shift; my $obj = $this->{xpct}; $obj->send("$cmd $serverId"); my $before = $obj->before; while ($before =~ /\ \ /) { $before =~ s/\ \ /\ /g; } return $before; }

quiesceServer

Stops IIGCC server gracefully, i.e. after all connections are closed by clients. No more connections are stablished.

Takes optional parameter serverId, to specify which server, or '*' for all servers.

stopServer

Stops IIGCC server immediatly, breaking all connections.

Takes optional parameter serverId, to specify which server, or '*' for all servers.

DIAGNOSTICS

Ingres environment variable II_SYSTEM not set

Ingres environment variables should be set in the user session running this module. II_SYSTEM provides the root install dir (the one before 'ingres' dir). LD_LIBRARY_PATH too. See Ingres RDBMS docs.

Ingres utility cannot be executed: _COMMAND_FULL_PATH_

The Netutil command could not be found or does not permits execution for the current user.

invalid type: _VNODE_TYPE_

Call to a VNode related method should be given a valid VNode type (GLOBAL/PRIVATE), or a wildcard (*), when permitted.

showLogin() must be previously invoked

A method call should be preceded by a preparatory call to showLogin(). If any call is made to createXxx() or deleteXxx(), (whichever Login or Conn), then showLogin() should be called again.

showConn() must be previously invoked

A method call should be preceded by a preparatory call to showConn(). If any call is made to createXxx() or deleteXxx(), (whichever Login or Conn), then showConn() should be called again.

missing VNode name

VNode name identifying a Login is required for this method.

missing parameter _PARAMETER_

The method requires the mentioned parameter to perform an action.

CONFIGURATION AND ENVIRONMENT

Requires Ingres environment variables, such as II_SYSTEM and LD_LIBRARY_PATH.

See Ingres RDBMS documentation.

DEPENDENCIES

Expect::Simple

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to bug-ingres-utility-Netutil at rt.cpan.org, or through the web interface at http://rt.cpan.org.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Ingres::Utility::Netutil

You can also look for information at:

ACKNOWLEDGEMENTS

Thanks to Computer Associates (CA) for licensing Ingres as open source, and let us hope for Ingres Corp to keep it that way.

AUTHOR

Joner Cyrre Worm <FAJCNLXLLXIH at spammotel.com>

LICENSE AND COPYRIGHT

Copyright (c) 2006, Joner Cyrre Worm <FAJCNLXLLXIH at spammotel.com>. All rights reserved.

Ingres is a registered brand of Ingres Corporation.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.