ASNMTAP

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

                               - FIX <\\/embed> added
                               - FIX stop caching sound during refresh when sound off
                               - FIX when downtime into the future, problem with the 'Condended View'
                               - UPDATE replace '$TcommentData =~ s/<br><br>/<br>/g;' with '$TcommentData =~ s/(?:<br>)+/<br>/g;'
                               display.pl and plugins.pl
                               - FIX interval/step must be greather then 0!
                               getArchivedDisplays.pl
                               - NEW Archived Displays
                               generateConfig.pl
                               - FIX all SQL select statements regarding *.activated = 1 and add when needed
                               - added print text to fix rights regarding chmod 755 for new CollectorCT-.*sh or DisplayCT-.*sh script
                               - added edit, delete, duplicate and maintenance button for 'Plugin' and 'Help Plugin Filename'
                               holidayBundleSetDowntimes.pl
                               - FIX Global symbol "$SERVERTABLENVIRONMENT" requires explicit package name at ./holidayBundleSetDowntimes.pl line 152.
                               plugins.pl
                               - making it possible to edit 'Help Plugin Filename' manual or by uploading and to clear with '<NIHIL>'
                               runStatusOnDemand.pl
                               - UPDATE doRequestedActions: added -o 'StrictHostKeyChecking=no' -o 'UserKnownHostsFile=$WWWKEYPATH/.ssh/known_hosts'
                               rsync-wrapper-*.sh
                               - UPDATE advanced debug information
                               - UPDATE making rsync version 2.6.7

Changes  view on Meta::CPAN

                               - NEW check_fs-stat.pl
                               ASNMTAP::Asnmtap::Plugins::SOAP
                               - add TYPE_ERROR_RETURN
                               ASNMTAP::Asnmtap::Plugins::WebTransact & runCmdOnDemand.pl
                               - ADDED remove password from Basic Authentication URL before putting into database!


Version 3.000.012, 2006/12/20, Central and Distributed support
                               - added common variable TYPEMONITORING to Asnmtap.cnf
                               fixRights.sh
                               - updated: script om rechten (chmod en chown) te zetten
                               Makefile.PL
                               - version update CPAN 1.8802 & CPANPLUS 0.076
                               - version update ExtUtils::MakeMaker 6.31
                               - version update Module::AutoInstall 1.03
                               - version update Bundle::DBI 1.53
                               - version update CGI 3.25
                               - version update Compress::Zlib 2.003
                               - version update Config::General 2.31
                               - version update Config::General::Interpolated 2.07
                               - version update Crypt::OpenSSL::RSA 0.24

INSTALL  view on Meta::CPAN


fixRights.sh
------------

vi fixRights.sh and change when needed
AMPATH=/opt/asnmtap-3.001.xxx	       # path where ASNMTAP is installed
ASNMTAPUSER=asnmtap                    # use for the ASNMTAP::Application
WWWUSER=apache                         # nobody
...

chmod 755 fixRights.sh

./fixRights.sh


Symbolic link:
--------------

ln -s /opt/asnmtap-3.001.xxx-new asnmtap


INSTALL  view on Meta::CPAN


  SSH access for the 'Application Monitor'
  ----------------------------------------

  cd ~/.ssh
  chown -R asnmtap:asnmtap .ssh
  #           |-------|------- user for the ASNMTAP::Application

  ssh-keygen -q -t rsa -f /home/asnmtap/.ssh/ssh -N ''

  chmod 700 .ssh
  chmod go-rwx .ssh/*

  chmod 644 ssh.pub
  chown asnmtap:asnmtap ssh.pub

  chmod 600 ssh
  chown apache:asnmtap ssh
  #        |------- user for web server

  cat /home/asnmtap/.ssh/ssh.pub >> /home/asnmtap/.ssh/authorized_keys
  chmod 600 /home/asnmtap/.ssh/authorized_keys

  vi /home/asnmtap/.ssh/authorized_keys
  add command='/opt/asnmtap/applications/sbin/sshWrapperASNMTAP.pl' before ssh.pub


  httpd.conf
  ----------

  vi /etc/httpd/conf.d/asnmtap.conf add the following content, and modify where needed like ServerName, ServerAlias, ErrorLog and CustomLog
  AddHandler cgi-script .cgi .pl

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

          $commands {$server} {SCP} {++$_id} {auto} = 1;
          $commands {$server} {SCP} {$_id} {label} = '+a';
          $commands {$server} {SCP} {$_id} {active} = $active;
          $commands {$server} {SCP} {$_id} {command} = "$SCPCOMMAND $connectArguments $APPLICATIONPATH/tmp/$CONFIGDIR/generated/$path/$generated $SSHLOGONNAME\@$server:". $ASNMTAP_PATH { substr ($type, -1, 1) } { $server } ."/applications/$subpath$ge...
          $compareText .= '<br><FONT COLOR="#99CC99"> ['. $_id .'] '. $commands {$server} {SCP} {$_id} {command} .'</FONT>' if ( $debug eq 'T' );

		  if (($generated =~ /^DisplayCT-[\w-]+.sh$/) or ($generated =~ /^CollectorCT-[\w-]+.sh$/)) {
            $commands {$server} {CHMOD} {++$_id} {auto} = 1;
            $commands {$server} {CHMOD} {$_id} {label} = '+b';
            $commands {$server} {CHMOD} {$_id} {active} = $active;
            $commands {$server} {CHMOD} {$_id} {command} = "$SSHCOMMAND $connectArguments $SSHLOGONNAME\@$server chmod 755 ". $ASNMTAP_PATH { substr ($type, -1, 1) } { $server } ."/applications/$subpath$generated";
            $compareText .= '<br><FONT COLOR="#99CC99"> ['. $_id .'] '. $commands {$server} {CHMOD} {$_id} {command} .'</FONT>' if ( $debug eq 'T' );

            $commands {$server} {START} {++$_id} {auto} = 1;
            $commands {$server} {START} {$_id} {label} = '+c';
            $commands {$server} {START} {$_id} {active} = $active;
            $commands {$server} {START} {$_id} {command} = "$SSHCOMMAND $connectArguments $SSHLOGONNAME\@$server ". $ASNMTAP_PATH { substr ($type, -1, 1) } { $server } ."/applications/$subpath$generated start";
            $compareText .= '<br><FONT COLOR="#99CC99"> ['. $_id .'] '. $commands {$server} {START} {$_id} {command} .'</FONT>' if ( $debug eq 'T' );
          } elsif (($generated =~ /rsync-wrapper-distributed-[\w\-.]+.sh$/) or ($generated =~ /rsync-wrapper-failover-[\w\-.]+.sh$/)) {
            $commands {$server} {TODO} {++$_id} {auto} = 0;
            $commands {$server} {TODO} {$_id} {label} = '+d';

applications/tools/templates/slave/rsync-mirror-distributed-example.sh  view on Meta::CPAN

# vi hosts.deny
# rsync: ALL
# ------------------------------------------------------------------------------
# Setup example:
#
# <slave server>:
#   ssh-keygen -q -t rsa -f /home/asnmtap/.ssh/rsync -N ""
# or
#   ssh-keygen -q -t dsa -f /home/asnmtap/.ssh/rsync -N ""
# 
# chmod go-w   /home/asnmtap/
# chmod 700    /home/asnmtap/.ssh
# chmod go-rwx /home/asnmtap/.ssh/*
# cat /home/asnmtap/.ssh/rsync.pub >> /home/asnmtap/.ssh/authorized_keys
# chmod 600 /home/asnmtap/.ssh/authorized_keys
#
# vi /usr/local/etc/sshd_config or /etc/ssh/sshd_config
# PubkeyAuthentication yes
# PermitEmptyPasswords yes
# 
# <master server>:
# vi authorized_keys
# from="asnmtap.citap.be", command ="/opt/asnmtap/applications/master/rsync-wrapper-distributed-asnmtap.citap.com.sh" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA5o5rh/yScb8506oLJSPRaKR2PCKfI4U/YOSylN7h8w5z5jIO/6W7qKTwWyJ9lPF3c/D6WM2N4cVkVbcprJq+59vxEPCV9jmD...
#                                                                                                                               ^- rsync.pub
# Testing:

applications/tools/templates/slave/rsync-mirror-failover-example.sh  view on Meta::CPAN

# vi hosts.deny
# rsync: ALL
# ------------------------------------------------------------------------------
# Setup example:
#
# <slave server>:
#   ssh-keygen -q -t rsa -f /home/asnmtap/.ssh/rsync -N ""
# or
#   ssh-keygen -q -t dsa -f /home/asnmtap/.ssh/rsync -N ""
# 
# chmod go-w   /home/asnmtap/
# chmod 700    /home/asnmtap/.ssh
# chmod go-rwx /home/asnmtap/.ssh/*
# cat /home/asnmtap/.ssh/rsync.pub >> /home/asnmtap/.ssh/authorized_keys
# chmod 600 /home/asnmtap/.ssh/authorized_keys
# 
# vi /usr/local/etc/sshd_config or /etc/ssh/sshd_config
# PubkeyAuthentication yes
# PermitEmptyPasswords yes
# 
# <master server>:
# vi authorized_keys
# from="asnmtap.citap.be", command ="/opt/asnmtap/applications/master/rsync-wrapper-failover-asnmtap.citap.com.sh" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA5o5rh/yScb8506oLJSPRaKR2PCKfI4U/YOSylN7h8w5z5jIO/6W7qKTwWyJ9lPF3c/D6WM2N4cVkVbcprJq+59vxEPCV9jmDQjF...
#                                                                                                                            ^- rsync.pub
# Testing:

fixRights.sh  view on Meta::CPAN


echo "chown -R $WWWUSER:$ASNMTAPUSER $AMPATH/applications/tmp"
chown -R $WWWUSER:$ASNMTAPUSER $AMPATH/applications/tmp

echo "chown -R $WWWUSER:$ASNMTAPUSER $AMPATH/plugins/tmp"
chown -R $WWWUSER:$ASNMTAPUSER $AMPATH/plugins/tmp

echo "cd $AMPATH"
cd $AMPATH

find $AMPATH -type d                   -exec chmod 755 {} \; 

find $AMPATH -type f                   -exec chmod 644 {} \;

find $AMPATH -type f -name '*.p12'     -exec chmod 600 {} \;

find $AMPATH -type f -name '*.cgi'     -exec chmod 755 {} \;
find $AMPATH -type f -name '*.js'      -exec chmod 755 {} \;
find $AMPATH -type f -name '*.pl'      -exec chmod 755 {} \;
find $AMPATH -type f -name '*.php'     -exec chmod 755 {} \;
find $AMPATH -type f -name '*.sh'      -exec chmod 755 {} \;
find $AMPATH -type f -name 'perf*.png' -exec chmod 755 {} \;

lib/ASNMTAP/Asnmtap/Applications.pod  view on Meta::CPAN

=item Distributed ASNMTAP

 archive.pl -A ArchiveCT -c T -r T -d F

=back

Shell script to run archive.pl with the default command line options

 cd /opt/asnmtap/applications/
 cp archive.sh-orig archive.sh
 chmod 755 archive.sh

 crontab -e
  0  1 * * * /opt/asnmtap/applications/archive.sh > /dev/null

 cd /opt/asnmtap/applications/
 mv archive.sh-orig archive-apache.sh
 chmod 755 archive-apache.sh
 chown <apache>:<apache> archive-apache.sh

 su - <apache>
 crontab -e
  0  1 * * * /opt/asnmtap/applications/archive-apache.sh > /dev/null

=back

=item located at /opt/asnmtap/applications/bin

lib/ASNMTAP/Asnmtap/Applications.pod  view on Meta::CPAN

this program generating automatically Collector Daemon Scheduling Reports in PDF format

 Located at URL: http://asnmtap.citap.be/results/_ASNMTAP/reports/

=item generateCollectorDaemonSchedulingReports.sh

Shell script to run generateCollectorDaemonSchedulingReports.pl with the default command line options

 cd /opt/asnmtap/applications/bin
 mv generateCollectorDaemonSchedulingReports.sh-orig generateCollectorDaemonSchedulingReports.sh
 chmod 755 generateCollectorDaemonSchedulingReports.sh

 crontab -e
  0  0 * * * /opt/asnmtap/applications/bin/generateCollectorDaemonSchedulingReports.sh > /dev/null

=item generateReports.pl

this program generate automatically reports in PDF format, defined by the CGI program reports.pl

=item generateReports.sh

Shell script to run generateReports.pl with the default command line options

 cd /opt/asnmtap/applications/bin
 mv generateReports.sh-orig generateReports.sh
 chmod 755 generateReports.sh

 crontab -e
 30  0 * * * /opt/asnmtap/applications/bin/generateReports.sh > /dev/null

=item holidayBundleSetDowntimes.pl

this program automatically set the plugin downtimes, defined by the CGI program plugin.pl and holidaysBundle.pl

=item holidayBundleSetDowntimes.sh

Shell script to run holidayBundleSetDowntimes.pl with the default command line options

 cd /opt/asnmtap/applications/bin
 mv holidayBundleSetDowntimes.sh-orig holidayBundleSetDowntimes.sh
 chmod 755 holidayBundleSetDowntimes.sh

 crontab -e
 15  0 * * * /opt/asnmtap/applications/bin/holidayBundleSetDowntimes.sh > /dev/null

=item importDataThroughCatalog.pl

this program imports automatically the data for other distributed/federated catalog members, defined by the CGI program catalog.pl

=item importDataThroughCatalog.sh

Shell script to run importDataThroughCatalog.pl with the default command line options

 cd /opt/asnmtap/applications/bin
 mv generateReports.sh-orig importDataThroughCatalog.sh
 chmod 755 importDataThroughCatalog.sh

 crontab -e
 30  0 * * * /opt/asnmtap/applications/bin/importDataThroughCatalog.sh --type=CONFIG > /dev/null
 */5 * * * * /opt/asnmtap/applications/bin/importDataThroughCatalog.sh --type=DATA > /dev/null

=back

=item located at /opt/asnmtap/applications/sbin

=over 4

=item bash_stop_root.sh

Shell script to run CollectorCT-*.sh and DisplayCT-*.sh with uid protection.

 cd /opt/asnmtap/applications/sbin
 mv bash_stop_root.sh-orig bash_stop_root.sh
 chmod 755 bash_stop_root.sh

 Modify when required:

 STOP_ROOT=TRUE
   NOTICE: ASNMPTAP has been configured not to run as root !
   WARNING: Running ASNMPTAP as root is not recommended !

 ASNMPTAP_UID=32006
 ASNMPTAP_USER=asnmtap
   NOTICE: ASNMPTAP must be started with shell uid(user) !

lib/ASNMTAP/Asnmtap/Applications.pod  view on Meta::CPAN

   ssh  -i '/home/asnmtap/.ssh/asnmtap' asnmtap@localhost 'script /opt/asnmtap/applications/master/CollectorCT-test.sh stop'

 Test sshWrapperASNMTAP.pl:

    ssh  -i '/home/asnmtap/.ssh/ssh' asnmtap@localhost 'killall number'
      SSH REQUEST FAILED INSPECTION - SKIPPING 'killall number'
      EVALUATING 'killall number'
    or
      Couldn't open log '/opt/asnmtap/log/sshWrapperASNMTAP.log'!

    chmod 664 /opt/asnmtap/log/sshWrapperASNMTAP.log 

    ssh  -i '/home/asnmtap/.ssh/ssh' asnmtap@localhost 'script /opt/asnmtap/applications/master/CollectorCT-Configsol2-environment-probe.sh stop'
      EVALUATING 'script /opt/asnmtap/applications/master/CollectorCT-Configsol2-environment-probe.sh stop'
      SSH REQUEST PASSED INSPECTION - INITIATING '/opt/asnmtap/applications/master/CollectorCT-Configsol2-environment-probe.sh stop'
      EXECUTE '/opt/asnmtap/applications/master/CollectorCT-Configsol2-environment-probe.sh stop'
      '/opt/asnmtap/applications/master/CollectorCT-Configsol2-environment-probe.sh stop' COMPLETED

    ssh  -i '/home/asnmtap/.ssh/ssh' asnmtap@localhost 'remove /opt/asnmtap/pid/CollectorCT-Configsol2-environment-probe.pid'
      EVALUATING 'remove /opt/asnmtap/pid/CollectorCT-Configsol2-environment-probe.pid'
      SSH REQUEST PASSED INSPECTION - INITIATING '/bin/rm /opt/asnmtap/pid/CollectorCT-Configsol2-environment-probe.pid'

lib/ASNMTAP/Asnmtap/Applications.pod  view on Meta::CPAN


=item create ssh key

...

 <slave server>:
   ssh-keygen -q -t rsa -f /home/asnmtap/.ssh/ssh -N ''
 or
   ssh-keygen -q -t dsa -f /home/asnmtap/.ssh/ssh -N ''

 chmod go-w   /home/asnmtap/
 chmod 700    /home/asnmtap/.ssh
 chmod go-rwx /home/asnmtap/.ssh/*

 chmod 644 ssh.pub
 chown asnmtap:asnmtap ssh.pub

 chmod 600 ssh
 chown apache:asnmtap ssh

 cat /home/asnmtap/.ssh/ssh.pub >> /home/asnmtap/.ssh/authorized_keys
 chmod 600 /home/asnmtap/.ssh/authorized_keys

 vi /home/asnmtap/.ssh/authorized_keys
   add command='/opt/asnmtap/applications/sbin/sshWrapperASNMTAP.pl' before ssh.pub
 or
   add command='ASNMTAP_PERL5LIB=/opt/asnmtap/cpan-shared/lib/perl5; /opt/asnmtap/applications/sbin/sshWrapperASNMTAP.pl' before ssh.pub

=back

=item Apache

lib/ASNMTAP/Asnmtap/Applications.pod  view on Meta::CPAN

=item using CPAN with a non-root account for ASNMTAP

 mkdir /opt/asnmtap/cpan-shared
 mkdir /opt/asnmtap/cpan-shared/lib
 mkdir /opt/asnmtap/cpan-shared/lib/perl5
 mkdir /opt/asnmtap/cpan-shared/share
 mkdir /opt/asnmtap/cpan-shared/share/man
 mkdir /opt/asnmtap/cpan-shared/share/man/man1
 mkdir /opt/asnmtap/cpan-shared/share/man/man3

 chmod -R 775 /opt/asnmtap/cpan-shared
 chown -R asnmtap:asnmtapcmd /opt/asnmtap/cpan-shared

 mkdir -p ~/.cpan/CPAN
 chown -R asnmtap:asnmtap ~/.cpan/CPAN

 cd  ~/.cpan/CPAN

 vi MyConfig.pm
 # <-- MyConfig.pm
 $CPAN::Config = {

lib/ASNMTAP/Asnmtap/Applications/Collector.pod  view on Meta::CPAN

=item 2) ASNMTAP Invokes Perfparse

 $perfParseMethode = 'AIP', default

=item 3) Periodic User Log Parse

 $perfParseMethode = 'PULP'

 cd /opt/asnmtap/applications/sbin
 mv perfparse_crontab.sh-orig perfparse_crontab.sh
 chmod 755 perfparse_crontab.sh

 when 'crontab': 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /opt/asnmtap/applications/sbin/perfparse_crontab.sh > /dev/null

 mv perfparse_crontab_failed.sh-orig perfparse_crontab_failed.sh
 chmod 755 perfparse_crontab_failed.sh

 when 'crontab':  30 23 * * * /opt/asnmtap/applications/sbin/perfparse_crontab_failed.sh > /dev/null


=item 4) Pipe to Perfparse

 $perfParseMethode = 'PTP'

 ... TODO ...



( run in 0.287 second using v1.01-cache-2.11-cpan-496ff517765 )