Changeset 389


Ignore:
Timestamp:
Mar 22, 2010, 5:31:58 PM (11 years ago)
Author:
lucas
Message:

ror-build-mon: cloudify

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ror-farm/ror-build-mon

    r352 r389  
    3232my $mon_cf = "mon/mon.cf";
    3333my $mon_template = "mon/mon.cf.tmpl";
     34my $vserver_dir  = "/etc/vservers";
    3435
     36my $sql_host = "twix9";
    3537my $sql_db = "admin_prod";
    3638my %rorettes;
     
    4446
    4547
    46 my $dbh = DBI->connect("DBI:mysql:database=$sql_db;host=localhost", $sql_user, $sql_pass,{'RaiseError' => 1});
     48my $dbh = DBI->connect("DBI:mysql:database=$sql_db;host=$sql_host", $sql_user, $sql_pass,{'RaiseError' => 1});
    4749
    4850# get the list of rorettes and the associated admin contact, exclude "system" projects
     
    6264$dbh->disconnect();
    6365#print Dumper(\%rorettes);
     66
     67# build list of local rorettes
     68my @list = split(/\n/,`ls -d $vserver_dir/*/ | xargs -l basename`);
     69
     70# remove rorettes not existing locally
     71foreach my $rorette (sort keys %rorettes) {
     72  delete $rorettes{$rorette} unless exists $list[$rorette];
     73}
    6474
    6575# init template
     
    8393  my $FH;
    8494  my $sep = $/;
    85   open($FH,"<","/root/.my.cnf") or die("Error, no ~/.my.cnf");
     95  open($FH,"<","/home/rormanager/.my.cnf") or die("Error, no ~/.my.cnf");
    8696  undef $/;
    8797  my $my_cnf = <$FH>;
Note: See TracChangeset for help on using the changeset viewer.