ASNMTAP

 view release on metacpan or  search on metacpan

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

 export PATH

 umask 022

=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

=over 4

=item Install for HTTPS support

 install openssh, openssl, openssl096 & openssl-devel

=item add /etc/httpd/conf.d/asnmtap.conf

 Link index.html and index-cv.html to the default screens
 [/opt/asnmtap/applications/htmlroot]# ln -s citap.html  index.html
 [/opt/asnmtap/applications/htmlroot]# ln -s citap-cv.html  index-cv.html

 vi /etc/httpd/conf.d/asnmtap.conf

 AddHandler cgi-script .cgi .pl

 DirectoryIndex index.htm index.html index.html.var index.shtml index.cfm index.pl

 <VirtualHost *:80>
   ServerName asnmtap.citap.com
   ServerAlias asnmtap.citap.be
   ServerAdmin webmaster@citap.com
   DocumentRoot /opt/asnmtap/applications/htmlroot
   ErrorLog /var/log/httpd/asnmtap.citap.com-error.log
   CustomLog /var/log/httpd/asnmtap.citap.com-combined.log combined
   IndexIgnore *.png *nok.txt *all.txt *.html
   IndexOptions NameWidth=* FancyIndexing FoldersFirst SuppressDescription
   IndexOrderDefault Ascending Name

   Alias /asnmtap "/opt/asnmtap/applications/htmlroot"

   <Directory "/opt/asnmtap/applications/htmlroot">
     AllowOverride AuthConfig
     Options FollowSymLinks
     Order allow,deny
     Allow from all
   </Directory>

   Alias /results "/opt/asnmtap/results"

   <Directory "/opt/asnmtap/results">
     HeaderName HEADER.html
     ReadmeName FOOTER.html
     AllowOverride AuthConfig
     Options Indexes
   # Options Indexes FollowSymLinks
     Order allow,deny
     Allow from all
   </Directory>

   Alias /config "/opt/asnmtap/applications/tmp/config"

   <Directory "/opt/asnmtap/applications/tmp/config">
     HeaderName HEADER.html
     ReadmeName FOOTER.html
     AllowOverride AuthConfig
     Options Indexes
   # Options Indexes FollowSymLinks
     Order allow,deny
     Allow from all
   </Directory>

   ScriptAlias /asnmtap/cgi-bin/ "/opt/asnmtap/applications/htmlroot/cgi-bin/"

   <Directory "/opt/asnmtap/applications/htmlroot/cgi-bin">
     AllowOverride AuthConfig
     Options ExecCGI
     Order allow,deny
     Allow from all
   </Directory>
 </VirtualHost>

=back

=item Install Mysql client

 Use rpm or download the source, for version 4.0 or later 'gzip' needed

 when the sourecode used (gcc, g++, binutils & make needed):
   ./configure --without-server
   make
   make install

 yum install mysql-devel

=over 4

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

 LogFile="/var/log/httpd/mylog.log"
 # with
 LogFile="/var/log/httpd/asnmtap.citap.be-combined.log"


 cd /usr/local/awstats
 ./awstats_configure.pl

 /etc/init.d/httpd restart

 /usr/bin/env perl /usr/local/awstats/awstats_updateall.pl now -awstatsprog=/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -configdir=/usr/local/awstats/etc/


 vi /var/spool/cron/crontabs/root
 15 * * * * /usr/local/awstats/tools/awstats_updateall.pl now > /dev/null

 http://awstats.sourceforge.net/docs/awstats_setup.html

=back

=head1 HOWTO

=over 4

=item Apache and ASNMTAP not installed into '/opt/asnmtap/'

 when ASNMTAP is not installed into '/opt/asnmtap/' you need to add SetEnv ASNMTAP_PATH to your webserver config

 more /etc/httpd/conf.d/asnmtap.conf
 ...
 <VirtualHost *:80>
   ...
   SetEnv ASNMTAP_PATH /opt/asnmtap-3.001.xxx-other/
   ...
 </VirtualHost>

=item SQL statement to query one results from the database

 SELECT id, title, status, endDate, endTime, statusMessage, step, timeslot FROM `events` where uKey = '<uKey>' and endDate = 'yyyy-mm-dd' order by id desc limit 1;

 status
 ----------------------------------------------------------------------------------------
 OK             no problems
 WARNING        indicates that there is something wrong, but not critical
 CRITICAL       indicates a critical problem
 UNKNOWN        indicates that we don't now the correct status
 NO-TEST        there is no test for this timeslot
 OFFLINE        this application is offline (no test sheduled for this timeslot)
 <NIHIL>        problem with the execution from the plugin

  <keyl>
 --------
 DUMMY-T1
 DUMMY-T2
 DUMMY-T3
 DUMMY-T4
 DUMMY-T5

=item run archiver.pl on cygwin

 Install libpng... needed, install this now

 mount -f -s -b "D:/cygwin/usr/sbin" "/usr/sbin" <-- to update the registry

 cygrunsrv --install "CYGWIN crontab" --path /usr/sbin/cron.exe -a '-D' -e CYGWIN=ntsec
 cygrunsrv --stop    "CYGWIN crontab"
 cygrunsrv --start   "CYGWIN crontab"
 cygrunsrv --remove  "CYGWIN crontab"

 0   2 * * * cd /opt/asnmtap/applications; ./archive.sh > /dev/null  <-- crontab op master server
 30 23 * * * cd /opt/asnmtap/applications/bin; ./holidayBundleSetDowntimes.sh > /dev/null  <-- crontab op master server

=item maximum timeslot interval greather then 2 hours:

asyncroon scheduling required

=item Perl

=over 4

=item update every CPAN module that is outdated

perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)'

=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 = {
  'build_cache' => q[10],
  'build_dir' => q[/home/asnmtap/.cpan/build],
  'cache_metadata' => q[1],
  'cpan_home' => q[/home/asnmtap/.cpan],
  'ftp' => q[/usr/kerberos/bin/ftp],
  'ftp_proxy' => q[http://proxyorg:8080],
  'getcwd' => q[cwd],
  'gpg' => q[/usr/bin/gpg],
  'gzip' => q[/bin/gzip],
  'histfile' => q[/home/asnmtap/.cpan/histfile],
  'histsize' => q[100],
  'http_proxy' => q[http://proxyorg:8080],
  'inactivity_timeout' => q[0],
  'index_expire' => q[1],
  'inhibit_startup_message' => q[0],
  'keep_source_where' => q[/home/asnmtap/.cpan/sources],

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

You can also use LOAD DATA FROM MASTER. This is a convenient command that takes a snapshot, restores it to the slave, and adjusts the log name and offset on theslave all at once. In the future, LOAD DATA FROM MASTER will be the recommended way to set...

=back

=item Contrains

Foreign keys definitions are subject to the following conditions: 

Both tables must be InnoDB type!

In the referencing table, there must be an index where the foreign key columns are listed as the first columns in the same order. 

In the referenced table, there must be an index where the referenced columns are listed as the first columns in the same order. 

Index prefixes on foreign key columns are not supported. One consequence of this is that BLOB and TEXT columns cannot be included in a foreign key, because indexes on those columns must always include a prefix length. 

 [CONSTRAINT symbol] FOREIGN KEY [id] (index_col_name, ...)
   REFERENCES tbl_name (index_col_name, ...)
   [ON DELETE {RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT}]
   [ON UPDATE {RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT}]

 SET FOREIGN_KEY_CHECKS = 0; or SET FOREIGN_KEY_CHECKS = 1;

=item How to import a *.sql generated recovery file?

 mysql -u root -p
   -> USE asnmtap;

      If you use LOAD DATA INFILE ... the file must be on the server
   -> LOAD DATA LOW_PRIORITY INFILE '<filename>.sql' INTO TABLE events FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\\n';

      If you use LOAD DATA LOCAL INFILE ... the file is expected to be on the client.
      If you specify the keyword LOW_PRIORITY, execution of the LOAD DATA statement is delayed until no other clients are reading from the table. 
   -> LOAD DATA LOW_PRIORITY LOCAL INFILE '<filename>.sql' INTO TABLE events FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\\n';

=item How to import drop a InnoDB table that is referenced by a FOREIGN KEY constraint?

InnoDB does not allow you to drop a table that is referenced by a FOREIGN KEY constraint, unless you do SET FOREIGN_KEY_CHECKS=0. When you drop a table, the constraints that were defined in its create statement are also dropped. 

=back

=back

=head1 REQUIREMENTS

=over 4

=item Linux (Centos/Redhat EL3 and EL4)

 Staring from a core installation you need:

 rpm -i autoconf-2.60.noarch.rpm
 rpm -i automake-1.10.noarch.rpm

 rpm -i libtool-1.5.6-4.EL4.1.i386.rpm
 rpm -i libtool-libs-1.5.6-4.EL4.1.i386.rpm

 rpm -i libstdc++-devel-3.4.5-2.i386.rpm
 rpm -i gcc-c++-3.4.6.i386.rpm

 rpm -i libpng10-1.0.16-1.i386.rpm
 rpm -i libpng10-devel-1.0.16-1.i386.rpm

 rpm -i libpng-1.2.16.el4.2.i386.rpm
 rpm -i libpng-devel-1.2.16.el4.2.i386.rpm

 rpm -i libjpeg-6b-33.i386.rpm
 rpm -i libjpeg-devel-6b-33.i386.rpm

 rpm -i freetype-2.3.1.i386.rpm
 rpm -i freetype-devel-2.3.1.i386.rpm
 rpm -i freetype-utils-2.3.1.i386.rpm

 rpm -i fontconfig-2.4.2.i386.rpm
 rpm -i fontconfig-devel-2.4.2.i386.rpm

 rpm -i glib2-2.13.0.i386.rpm
 rpm -i glib2-devel-2.13.0.i386.rpm

 rpm -i zlib-devel-1.2.3.i386.rpm
 rpm -i e2fsprogs-devel-1.35-12.3.EL4.i386.rpm
 rpm -i krb5-devel-1.3.4-27.i386.rpm
 rpm -i openssl-devel-0.9.8e.i386.rpm

 rpm -i gd-2.0.33-4.4E.1.i386.rpm
 rpm -i gd-devel-2.0.33-4.4E.1.i386.rpm
 rpm -i gd-progs-2.0.33-4.4E.1.i386.rpm

 rpm -i libmcrypt-2.5.7-1.2.el4.rf.i386.rpm
 rpm -i libxml2-2.6.26.i386.rpm

 rpm -i httpd-2.0.59.ent.i386.rpm
 rpm -i httpd-suexec-2.0.59.ent.i386.rpm
 rpm -i mysql-5.0.29.RHEL4.1.i386.rpm
 rpm -i mysql-devel-5.0.29.RHEL4.1.i386.rpm

 perl -MCPAN -e 'install Bundle::CPAN'
 perl -MCPAN -e 'install Pod::Coverage'
 perl -MCPAN -e 'install Test::Pod'
 perl -MCPAN -e 'install Module::Signature'

 rpm -i perl-HTML-Tagset-3.03-30.noarch.rpm
 rpm -i perl-HTML-Parser-3.35-6.i386.rpm
 rpm -i perl-URI-1.30-4.noarch.rpm
 rpm -i perl-libwww-perl-5.79-5.noarch.rpm
 rpm -i perl-Crypt-SSLeay-0.51-5.i386.rpm
 rpm -i perl-Date-Calc-5.3-9.i386.rpm

 rpm -i perl-DBI-1.40-8.i386.rpm
 rpm -i perl-DBD-MySQL-2.9004-3.1.i386.rpm

 rpm -i perl-Time-HiRes-1.55-3.i386.rpm

 rpm -i perl-XML-Parser-2.34-5.i386.rpm
 rpm -i perl-XML-Dumper-0.71-2.noarch.rpm

=item Solaris 9

 Starting from a core installation you need:

=over 4

=item sunfreeware.com

 pkgadd -d bash-3.1-sol9-sparc-local
 pkgadd -d coreutils-4.5.4-sol9-sparc-local
 pkgadd -d libiconv-1.8-sol9-sparc-local
 pkgadd -d ncurses-5.4-sol9-sparc-local
 pkgadd -d perl-5.8.8-sol9-sparc-local
 pkgadd -d popt-1.7-sol9-sparc-local
 pkgadd -d tar-1.15.1-sol9-sparc-local
 pkgadd -d tcp_wrappers-7.6-sol9-sparc-local
 pkgadd -d tcpdump-3.9.3-sol9-sparc-local
 pkgadd -d wget-1.10.2-sol9-sparc-local
 pkgadd -d zlib-1.2.3-sol9-sparc-local

 pkgadd -d apache-2.0.55-sol9-sparc-local
 pkgadd -d autoconf-2.59-sol9-sparc-local
 pkgadd -d automake-1.9-sol9-sparc-local
 pkgadd -d bison-1.875d-sol9-sparc-local
 pkgadd -d bzip2-1.0.2-sol9-sparc-local
 pkgadd -d db-4.2.52.NC-sol9-sparc-local
 pkgadd -d diffutils-2.8.1-sol9-sparc-local
 pkgadd -d expat-1.95.5-sol9-sparc-local
 pkgadd -d flex-2.5.31-sol9-sparc-local
 pkgadd -d fping-2.4b2-sol9-sparc-local
 pkgadd -d fontconfig-2.2.98-sol9-sparc-local
 pkgadd -d freetype-2.1.9-sol9-sparc-local
 pkgadd -d gcc-3.4.2-sol9-sparc-local
 pkgadd -d gd-2.0.33-sol9-sparc-local
 pkgadd -d gdbm-1.8.3-sol9-sparc-local
 pkgadd -d glib-2.6.2-sol9-sparc-local
 pkgadd -d jpeg-6b-sol9-sparc-local
 pkgadd -d libnet-1.1.1-sol9-sparc-local
 pkgadd -d libpcap-0.9.3-sol9-sparc-local
 pkgadd -d libpng-1.2.8-sol9-sparc-local
 pkgadd -d librsync-0.9.7-sol9-sparc-local
 pkgadd -d libtool-1.5-sol9-sparc-local
 pkgadd -d libxml2-2.6.16-sol9-sparc-local
 pkgadd -d m4-1.4.2-sol9-sparc-local
 pkgadd -d make-3.80-sol9-sparc-local
 pkgadd -d mrtg-2.10.15-sol9-sparc-local
 pkgadd -d openssl-0.9.8b-sol9-sparc-local
 pkgadd -d openssl-0.9.7g-sol9-sparc-local
 pkgadd -d pkgconfig-0.15.0-sol9-sparc-local
 pkgadd -d prngd-0.9.25-sol9-sparc-local
 pkgadd -d readline-5.1-sol9-sparc-local
 pkgadd -d rsync-2.6.8-sol9-sparc-local
 pkgadd -d texinfo-4.2-sol9-sparc-local
 pkgadd -d unzip-5.50-sol9-sparc-local
 pkgadd -d xpm-3.4k-sol9-sparc-local

=item blastwave.org

 pkgadd -d pkg_get.pkg
 pkgadd -d common-1.4.3,REV=2006.01.22-SunOS5.8-sparc-CSW.pkg
 pkgadd -d awstats-6.4-SunOS5.8-all-CSW.pkg
 pkgadd -d binutils-2.16.1-SunOS5.8-sparc-CSW.pkg

=item libmcrypt

 tar -xvzf libmcrypt-2.5.7.tar.gz
 cd libmcrypt-2.5.7
 ./configure
 make
 make install

=item MySQL

 MySQL 5.0.x and 5.1.x are supported

 tar -xvzf mysql-5.0.20.tar.gz or higher
 cd mysql-5.0.20
 ./configure --without-server --enable-local-infile 
 make
 make install

 /usr/local/bin/mysql_client_test --host asnmtap

=item Perl

 perl -MCPAN -e 'reload index'
 perl -MCPAN -e 'install Date::Manip'
 perl -MCPAN -e 'install LWP::UserAgent'
 perl -MCPAN -e 'install Statistics::Descriptive'
 perl -MCPAN -e 'install Text::ParseWords'
 perl -MCPAN -e 'install Test::Pod'
 perl -MCPAN -e 'install Net::Daemon'
 perl -MCPAN -e 'install Bundle::DBI'
 perl -MCPAN -e 'install Bundle::DBD::mysql'
 perl -MCPAN -e 'install Net::SNMP'
 perl -MCPAN -e 'install Config::IniFiles'

=back

=back



( run in 1.606 second using v1.01-cache-2.11-cpan-df04353d9ac )