GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  REX::GROUP::LOOKUP::DBI (3)

.ds Aq ’

NAME

Rex::Group::Lookup::DBI - read hostnames and groups from a DBI source

CONTENTS

DESCRIPTION

With this module you can define hostgroups out of an DBI source.

SYNOPSIS



 use Rex::Group::Lookup::DBI;
 groups_dbi "dsn", "user", "password", "SQL request";



EXPORTED FUNCTIONS

groups_dbi($dsn, CW$user, CW$password, CW$sql)



 With this function you can read groups from DBI source.



    Example: groups_dbi( ’DBI:mysql:rex;host=db01’, user => ’username’, password => ’password’, sql => ‘‘SELECT * FROM HOST’’, create_all_group => TRUE);

    Database sample for MySQL



 CREATE TABLE IF NOT EXISTS `HOST` (
   `ID` int(11) NOT NULL,
   `GROUP` varchar(255) DEFAULT NULL,
   `HOST` varchar(255) NOT NULL,
   PRIMARY KEY (`ID`)
 );



    Data sample for MySQL



 INSERT INTO `HOST` (`ID`, `GROUP`, `HOST`) VALUES
   (1, db, db01),
   (2, db, db02),
   (3, was, was01),
   (4, was, was02);



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 REX::GROUP::LOOKUP::DBI (3) 2016-03-07

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.