ASNMTAP

 view release on metacpan or  search on metacpan

applications/htmlroot/cgi-bin/admin/generateConfig.pl  view on Meta::CPAN

HTML
    }

    if ($action ne "menuView") {
      print "  <tr align=\"center\"><td>\n  <table>\n";

      if ($action eq 'checkView' or $action eq 'generateView') {
        print "    <tr align=\"center\"><td>&nbsp;</td></tr>\n    <tr align=\"center\"><td>$matchingWarnings</td></tr>\n" if ($countWarnings);
        print "    <tr align=\"center\"><td>&nbsp;</td></tr>\n    <tr align=\"center\"><td>$matchingErrors</td></tr>\n" if ($countErrors);
        print "    <tr align=\"center\"><td>&nbsp;</td></tr>\n    <tr align=\"center\"><td>Warning: $countWarnings, Errors: $countErrors</td></tr>\n";
      }

      if ($action eq 'generateView') {
        if ($countErrors == 0) {
          print <<HTML;
    <tr align="center"><td>&nbsp;</td></tr>
    <tr align="center"><td>$initializeGenerateView</td></tr>
    <tr align="center"><td>&nbsp;</td></tr>
    <tr align="center"><td>$matchingArchiveCT</td></tr>
    <tr align="center"><td>&nbsp;</td></tr>
    <tr align="center"><td>$matchingDisplayCT</td></tr>
    <tr align="center"><td>&nbsp;</td></tr>
    <tr align="center"><td>$matchingAsnmtapDisplayCTscript</td></tr>
    <tr align="center"><td>&nbsp;</td></tr>
    <tr align="center"><td>$matchingCollectorCT</td></tr>
    <tr align="center"><td>&nbsp;</td></tr>
    <tr align="center"><td>$matchingAsnmtapCollectorCTscript</td></tr>
    <tr align="center"><td>&nbsp;</td></tr>
    <tr align="center"><td>$matchingRsyncMirror</td></tr>
HTML
        } else {
          print "    <tr align=\"center\"><td>&nbsp;</td></tr>\n    <tr align=\"center\"><td>Errors: $countErrors, first solve them PLEASE</td></tr>\n";
        }
      } elsif ($action eq 'compareView') {
        print <<HTML;
    <tr align=\"center\"><td>&nbsp;</td></tr>
    <tr align=\"center\"><td>$compareView</td></tr>
HTML
      } elsif ($action eq 'installView' or $action eq 'install') {
        print <<HTML;
    <tr align=\"center\"><td>&nbsp;</td></tr>
    <tr align=\"center\"><td>$installView</td></tr>
HTML
      }

      print "  </table>\n  </td></tr>\n";
    }

    print "  </table>\n";
	
    if ($action eq 'installView') {
      print "</form>\n";
    } else {
      print "<br>\n";
    }
  }
}

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

print_legend (*STDOUT);
print '</BODY>', "\n", '</HTML>', "\n";

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

sub createCollectorCTscript {
  my ($typeMonitoringCharDorC, $typeServersCharMorS, $typeActiveServer, $serverFQDN, $serverAdminCollectorFQDN, $serverASNMTAP_PATH , $serverRSYNC_PATH , $serverSSH_PATH, $databaseFQDN, $subdir, $collectorDaemon, $mode, $dumphttp, $status, $debugDaem...

  my ($hostnameAdminCollector, undef) = split (/\./, $serverAdminCollectorFQDN, 2);
  return ('') if ( "CollectorCT-$collectorDaemon.sh" eq "CollectorCT-${hostnameAdminCollector}.sh" );

  my $filename = "$APPLICATIONPATH/tmp/$CONFIGDIR/generated/$typeMonitoringCharDorC$typeServersCharMorS-$typeActiveServer-$serverFQDN/$subdir/CollectorCT-$collectorDaemon.sh";
  my $command  = "cat $APPLICATIONPATH/tools/templates/CollectorCT-template.sh >> $filename";

  my $rvOpen = open(CollectorCT, ">$filename");

  if ($rvOpen) {
    print CollectorCT <<STARTUPFILE;
#!/bin/bash
# ---------------------------------------------------------------
# © Copyright $COPYRIGHT Alex Peeters [alex.peeters\@citap.be]
# ---------------------------------------------------------------
# This shell script takes care of starting and stopping

AMNAME=\"Collector ASNMTAP $collectorDaemon\"
AMPATH=$serverASNMTAP_PATH/applications
AMCMD=collector.pl
AMPARA=\"--hostname=$databaseFQDN --mode=$mode --collectorlist=CollectorCT-$collectorDaemon --dumphttp=$dumphttp --status=$status --debug=$debugDaemon --screenDebug=$debugAllScreen --allDebug=$debugAllFile --nokDebug=$debugNokFile\"
PIDPATH=$serverASNMTAP_PATH/pid
PIDNAME=CollectorCT-$collectorDaemon.pid

if [ -f ~/.profile ]; then
  source ~/.profile
fi

if [ -f ~/.bash_profile ]; then
  source ~/.bash_profile
fi

if [ -f "\$AMPATH/sbin/bash_stop_root.sh" ]; then
  source "\$AMPATH/sbin/bash_stop_root.sh"
fi

STARTUPFILE

    close (CollectorCT);
  }

  my $statusMessage = do_system_call ($command, $debug);
  $statusMessage .= "<tr bgcolor=\"$COLORSTABLE{ENDBLOCK}\"><td><a href=\"/$CONFIGDIR/generated/$typeMonitoringCharDorC$typeServersCharMorS-$typeActiveServer-$serverFQDN/$subdir/CollectorCT-$collectorDaemon.sh\" target=\"_blank\">CollectorCT-$collect...
  return ($statusMessage);
}

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

sub createAsnmtapCollectorCTscript {
  my ($typeMonitoring, $typeServersCharMorS, $typeActiveServer, $serverFQDN, $serverAdminCollectorFQDN, $serverASNMTAP_PATH , $serverRSYNC_PATH , $serverSSH_PATH, $subdir, $debug) = @_;

  my $typeMonitoringCharDorC = ($typeMonitoring) ? 'D' : 'C';

  my $filename = "$APPLICATIONPATH/tmp/$CONFIGDIR/generated/$typeMonitoringCharDorC$typeServersCharMorS-$typeActiveServer-$serverFQDN/$subdir/root-collector.sh";



( run in 0.839 second using v1.01-cache-2.11-cpan-d7f47b0818f )