ASNMTAP
view release on metacpan or search on metacpan
lib/ASNMTAP/Asnmtap/Applications.pod view on Meta::CPAN
=over 4
=item ArchiveCT
the config file used by the program archive.pl
when the Application CGI module and CGI applications are installed, this config file is automatically generated by the program generateConfig.pl
=over 4
=item format
format: <resultsdir>#[<catalogID>_]<uniqueKey>#check_nnn[|[<catalogID>_]<uniqueKey>#check_mmm]
<resultsdir> : results subdir where the data from the collector is located
<catalogID> : unique catalogID
<uniqueKey> : unique key for this plugin
check_nnn : plugin name
=item example
more /opt/asnmtap/applications/etc/ArchiveCT
# ArchiveCT - CTP-CENTRAL, generated on 2010/dd/mm 17:58:36, ASNMTAP v3.002.003 or higher
#
# <resultsdir>#[<catalogID>_]<uniqueKey>#check_nnn[|[<catalogID>_]<uniqueKey>#check_mmm]
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
_ASNMTAP#_ASNMTAP#CID_collectorDaemonSchedulingReports.pl
#
test-01#CID_DUMMY-T1#check_dummy.pl
#
test-02#CID_DUMMY-T2#check_dummy.pl
#
test-03#CID_DUMMY-T3#check_dummy.pl
#
test-04#CID_DUMMY-T4#check_dummy.pl
#
test-05#CID_DUMMY-T5#check_dummy.pl
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Einde ArchiveCT - CTP-CENTRAL
=back
=back
=item located at /opt/asnmtap/applications/master
=over 4
=item rsync-wrapper-failover-*.sh
=over 4
=item rsync
mkdir /home/asnmtap/.ssh
chown -R asnmtap:asnmtap /home/asnmtap/.ssh
ssh-keygen -t rsa -f /home/asnmtap/.ssh/rsync -N ""
# or
ssh-keygen -t dsa -f /home/asnmtap/.ssh/rsync -N ""
=item testing
ssh -i /home/asnmtap/.ssh/rsync asnmtap@probe
... Access Denied! Sorry
Connection to probe closed.
rsync -e "ssh -i /home/asnmtap/.ssh/rsync" -a /opt/asnmtap/results/test/ asnmtap@probe.citap.be:/opt/asnmtap/results/test/ -v -c -z --exclude=*-all.txt --exclude=*-nok.txt --exclude=*-KnownError --exclude=*.tmp --exclude=*.sql
building file list ... done
./
yyyymmdd-check_dummy-PROBE-01-T1-csv.txt
...
/opt/asnmtap/applications/slave/rsync-mirror-distributed-probe.citap.be.sh
building file list ... done
yyyymmdd-check_dummy-PROBE-01-T5-csv.txt
...
sent nnnn bytes received nnnn bytes nnnn.nn bytes/sec
total size is nnnn speedup is nnnn.nn
when problems: check value off 'KeyRsync'
=back
=item linux
=over 4
=item standalone
ln -s /opt/asnmtap/applications/master/root-display.sh /etc/init.d/root-display
ln -s /etc/init.d/root-display /etc/rc3.d/S99root-display
ln -s /etc/init.d/root-display /etc/rc3.d/K99root-display
ln -s /etc/init.d/root-display /etc/rc2.d/S99root-display
ln -s /etc/init.d/root-display /etc/rc2.d/K99root-display
ln -s /opt/asnmtap/applications/master/root-collector.sh /etc/init.d/root-collector
ln -s /etc/init.d/root-collector /etc/rc3.d/S99root-collector
ln -s /etc/init.d/root-collector /etc/rc3.d/K99root-collector
ln -s /etc/init.d/root-collector /etc/rc2.d/S99root-collector
ln -s /etc/init.d/root-collector /etc/rc2.d/K99root-collector
ln -s /opt/asnmtap/applications/bin/root-importDataThroughCatalog.sh /etc/init.d/root-importDataThroughCatalog
ln -s /etc/init.d/root-importDataThroughCatalog /etc/rc3.d/S99root-importDataThroughCatalog
ln -s /etc/init.d/root-importDataThroughCatalog /etc/rc3.d/K99root-importDataThroughCatalog
ln -s /etc/init.d/root-importDataThroughCatalog /etc/rc2.d/S99root-importDataThroughCatalog
ln -s /etc/init.d/root-importDataThroughCatalog /etc/rc2.d/K99root-importDataThroughCatalog
=item failover
more /opt/asnmtap.sh
#!/bin/sh
# ---------------------------------------------------------------
lib/ASNMTAP/Asnmtap/Applications.pod view on Meta::CPAN
/etc/rc0.d/S99asnmtap /etc/init.d/asnmtap
/etc/rc0.d/K99asnmtap /etc/init.d/asnmtap
=back
=back
=back
=back
=head1 PROGRAMS
=over 4
=item located at /opt/asnmtap/applications
=over 4
=item archive.pl
the Archiver.
This perl program
- create automatically new comments and events archive tables when needed.
- archiving the comments and events to the correspondending archiving tables
- removes the old unused cgisess files
- make backups and zips the csv, sql error, week, debug and report files
- removes the old zipped csv, sql error, week, debug and report files
=item archive.sh
=over 4
=item Central ASNMTAP
archive.pl -A ArchiveCT -c F -r T -d T
=item Central Apache
archive.pl -c T -r F -d F
=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
=over 4
=item generateCollectorDaemonSchedulingReports.pl
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
lib/ASNMTAP/Asnmtap/Applications.pod view on Meta::CPAN
PATH=/usr/local/bin:/usr/local/sbin:/usr/sbin:/etc:/usr/ccs/bin:/usr/bin:/opt/csw/bin:/usr/ucb:${PATH}
LD_LIBRARY_PATH=/opt/asnmtap/ssl/lib:/usr/local/lib/mysql:/usr/local/lib:/usr/lib/:${LD_LIBRARY_PATH}
http_proxy=http://proxy.citap.be:8080
ftp_proxy=http://proxy.citap.be:8080
alias su=/usr/bin/su
alias perl=/usr/bin/env perl
if [ -d /opt/asnmtap/cpan-shared/lib/perl5 ]; then
PERL5LIB=${PERL5LIB:+$PERL5LIB:}/opt/asnmtap/cpan-shared/lib/perl5
MANPATH=${MANPATH:+$MANPATH:}/opt/asnmtap/cpan-shared/share/man
fi
umask 022
=item .profile example
export PATH=/usr/local/bin:/usr/local/sbin:/usr/sbin:/etc:/usr/ccs/bin:/usr/bin:/opt/csw/bin:/usr/ucb:${PATH}
export LD_LIBRARY_PATH=/opt/asnmtap/ssl/lib:/usr/local/lib/mysql:/usr/local/lib:/usr/lib/:${LD_LIBRARY_PATH}
export http_proxy=http://proxy.citap.be:8080
export ftp_proxy=http://proxy.citap.be:8080
alias su=/usr/bin/su
alias perl=/usr/bin/env perl
if [ -d /opt/asnmtap/cpan-shared/lib/perl5 ]; then
PERL5LIB=${PERL5LIB:+$PERL5LIB:}/opt/asnmtap/cpan-shared/lib/perl5
MANPATH=${MANPATH:+$MANPATH:}/opt/asnmtap/cpan-shared/share/man
export MANPATH PERL5LIB
fi
umask 022
=item .bash_profile example
MAIL=/usr/mail/${LOGNAME:?}
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
lib/ASNMTAP/Asnmtap/Applications.pod view on Meta::CPAN
=item ASNMTAP Chartdirector configuration
Applications.cnf
<COMMON>
...
<CHARTDIRECTOR>
LIB /opt/ChartDirector/lib/.
</CHARTDIRECTOR>
...
</COMMON>
=back
=item ASNMTAP Tunneling localhost configuration
Applications.cnf
<COMMON>
...
HTTPSSERVER asnmtap.citap.be
REMOTE_HOST localhost.citap.be
REMOTE_ADDR 127.0.0.1 ...
</COMMON>
through browser with normal access:
http://asnmtap.citap.be:8080/asnmtap/nav/test/T/
http://asnmtap.citap.be:8080/asnmtap/cgi-bin/moderator/index.pl
http://asnmtap.citap.be:8080/asnmtap/cgi-bin/admin/index.pl
http://asnmtap.citap.be:8080/asnmtap/cgi-bin/sadmin/index.pl
ssh -l nagios -i ~/.ssh/nagios_dsa.id -o TCPKeepAlive=yes -L 8080:127.0.0.1:80 -N nagios@asnmtap.citap.be &
through browser with localhost tunneling:
http://localhost.citap.be:8080/asnmtap/nav/test/T/
http://localhost:8080/asnmtap/cgi-bin/moderator/index.pl
http://localhost:8080/asnmtap/cgi-bin/admin/index.pl
http://localhost:8080/asnmtap/cgi-bin/sadmin/index.pl
=back
=over 4
=item Install Awstats
Applications.cnf
<COMMON>
...
<AWSTATS>
ENABLED 1 # '0' or '1'
</AWSTATS>
...
</COMMON>
vi /usr/local/apache2/conf/httpd.conf
CustomLog logs/access_log combined
wget http://belnet.dl.sourceforge.net/sourceforge/awstats/awstats-6.5.tgz
tar -xvzf awstats-6.5.gz
chown -R asnmtap:asnmtap awstats-6.5
mv awstats-6.5 /usr/local/
mv /usr/local/awstats-6.5 /usr/local/awstats
cd /usr/local/awstats/tools
./awstats_configure.pl
mkdir /var/lib
mkdir /var/lib/awstats
chown -R nobody /usr/local/awstats/wwwroot
vi /usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf
# replace
SiteDomain=""
# with
SiteDomain="citap.be"
...
# replace
HostAliases="localhost 127.0.0.1 REGEX[myserver\.com$"
# with
HostAliases="localhost 127.0.0.1 asnmtap]"
...
# replace
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],
'links' => q[],
'make' => q[/usr/local/bin/make],
'make_arg' => q[],
'make_install_arg' => q[],
'makepl_arg' => q[PREFIX=/opt/asnmtap/cpan-shared SITELIBEXP=/opt/asnmtap/cpan-shared/lib/perl5 LIB=/opt/asnmtap/cpan-shared/lib/perl5 INSTALLMAN1DIR=/opt/asnmtap/cpan-shared/share/man/man1 INSTALLMAN3DIR=/opt/asnmtap/cpan-shared/share/man/man3 INS...
'ncftp' => q[],
'ncftpget' => q[],
'no_proxy' => q[],
'pager' => q[/usr/bin/less],
'prerequisites_policy' => q[ask],
'proxy_user' => q[],
'scan_cache' => q[atstart],
'shell' => q[/bin/bash],
'tar' => q[/bin/tar],
'term_is_latin' => q[1],
'unzip' => q[/usr/bin/unzip],
'urllist' => [q[http://cpan.llarian.net/], q[http://ftp.easynet.be/pub/CPAN/], q[http://cpan.mirrors.skynet.be/pub/CPAN], q[http://ftp.belnet.be/packages/cpan/], q[ftp://http.kulnet.kuleuven.ac.be/pub/mirror/CPAN/], q[http://ftp.scarlet.be/pub/cpan...
'wget' => q[/usr/bin/wget],
};
1;
__END__
# MyConfig.pm -->
su - asnmtap
perl -c MyConfig.pm
perl -MCPAN -e 'reload index'
vi ~/.bash_profile
...
export PATH=/usr/local/bin:/usr/local/sbin:/usr/sbin:/etc:/usr/ccs/bin:/usr/bin:/opt/csw/bin:/usr/ucb:/usr/local/mysql/bin:${PATH}
if [ -d /opt/asnmtap/cpan-shared/lib/perl5 ]; then
PERL5LIB=${PERL5LIB:+$PERL5LIB:}/opt/asnmtap/cpan-shared/lib/perl5
MANPATH=${MANPATH:+$MANPATH:}/opt/asnmtap/cpan-shared/share/man
export MANPATH PERL5LIB
fi
( run in 0.774 second using v1.01-cache-2.11-cpan-71847e10f99 )