ASNMTAP
view release on metacpan or search on metacpan
lib/ASNMTAP/Asnmtap/Applications.pod view on Meta::CPAN
=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) !
HTTPD_UID=99
NOTICE: ASNMPTAP must be started with httpd uid !
=item sshWrapperASNMTAP.pl
ASNMTAP ssh wrapper script for ssh execution through a rsa or dsa key
Accepted ssh calls are as follows:
'script $APPLICATIONPATH/master/DisplayCT-<daemon name>.sh stop|start|restart|reload'
'script $APPLICATIONPATH/slave/DisplayCT-<daemon name>.sh stop|start|restart|reload'
'script $APPLICATIONPATH/master/CollectorCT-<daemon name>.sh stop|start|restart|reload'
'script $APPLICATIONPATH/slave/CollectorCT-<daemon name>.sh stop|start|restart|reload'
'remove $PIDPATH/DisplayCT-<daemon name>.pid'
'remove $PIDPATH/CollectorCT-<daemon name>.pid'
'killall <pid>'
'../' are forbidden into a directory of filename for security reasons !!!
You need to create an ssh account:
ssh-keygen -t dsa -f /home/asnmtap/.ssh/asnmtap
vi /home/asnmtap/.ssh/authorized_keys
from="localhost", command="/opt/asnmtap/applications/sbin/sshWrapperASNMTAP.pl" ssh-dss AAAAB3Nza...+90k63Mx...3OmZOk= alex.peeters@citap.be
or with
from="localhost", command="ASNMTAP_PERL5LIB=/opt/asnmtap/cpan-shared/lib/perl5; /opt/asnmtap/applications/sbin/sshWrapperASNMTAP.pl" ssh-dss AAAAB3Nza...+90k63Mx...3OmZOk= alex.peeters@citap.be
vi hosts.allow
ssh: localhost
vi hosts.deny
ssh: ALL
ssh -i '/home/asnmtap/.ssh/asnmtap' asnmtap@localhost 'killall number'
ssh -i '/home/asnmtap/.ssh/asnmtap' asnmtap@localhost 'remove /opt/asnmtap/pid/CollectorCT-zombie.pid'
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'
lib/ASNMTAP/Asnmtap/Applications.pod view on Meta::CPAN
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
=item collector.pl need in general
=over 4
=item onto the master and slave server:
Standalone monitoring example
MySQL 5.0.x
database:
SQLyog -> Db -> Import from SQL Statements ... -> \opt\asnmtap-3.002.xxx\applications\tools\mysql\asnmtap-3.002.003_mysql-v5.0.x.sql
or
mysql -u root -p < /opt/asnmtap/applications/tools/mysql/asnmtap-3.002.003_mysql-v5.0.x.sql
triggers to make fast display possible for heavy environment:
SQLyog -> Db -> Import from SQL Statements ... -> \opt\asnmtap-3.002.xxx\applications\tools\mysql\asnmtap-3.002.003_mysql-v5.0.x-trigger-events.sql
or
mysql -u root -p < /opt/asnmtap/applications/tools/mysql/asnmtap-3.002.003_mysql-v5.0.x-trigger-events.sql
SQLyog -> Db -> Import from SQL Statements ... -> \opt\asnmtap-3.002.xxx\applications\tools\mysql\applications/tools/mysql/asnmtap-3.002.003_mysql-v5.0.x-trigger-eventsUpdate.sql
or
mysql -u root -p < /opt/asnmtap/applications/tools/mysql/applications/tools/mysql/asnmtap-3.002.003_mysql-v5.0.x-trigger-eventsUpdate.sql
SQLyog -> Db -> Import from SQL Statements ... -> \opt\asnmtap-3.002.xxx\applications\tools\mysql\asnmtap-3.002.003_mysql-v5.0.x-trigger-eventsDisplayData.sql
or
mysql -u root -p < /opt/asnmtap/applications/tools/mysql/asnmtap-3.002.003_mysql-v5.0.x-trigger-eventsDisplayData.sql
Distributed monitoring example
MySQL 5.0.x
SQLyog -> Db -> Import from SQL Statements ... -> \opt\asnmtap-3.002.xxx\applications\tools\mysql\asnmtap-3.002.003-distributed_mysql-v5.0.x.sql
or
mysql -u root -p < /opt/asnmtap/applications/tools/mysql/asnmtap-3.002.003-distributed_mysql-v5.0.x.sql
=item onto the master server:
mysql -u root -p
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, CREATE, CREATE TEMPORARY TABLES, DROP ON asnmtap.* TO 'asnmtap'@'localhost' IDENTIFIED BY 'passwd';
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, CREATE, CREATE TEMPORARY TABLES, DROP ON asnmtap.* TO 'asnmtap'@'hostname-master-server' IDENTIFIED BY 'passwd';
mysql> GRANT SELECT ON asnmtap.* TO 'asnmtapro'@'hostname-master-server' IDENTIFIED BY 'passwd-ro';
mysql> GRANT SELECT, SUPER, REPLICATION CLIENT, REPLICATION SLAVE, RELOAD ON asnmtap.* TO 'replication'@'hostname-slave-server' IDENTIFIED BY 'passwd-replication';
mysql> FLUSH TABLES WITH READ LOCK;
mysql> QUIT;
when master is in production before the slave exist
mysqldump -u root -p asnmtap > asnmtap.sql
or for big tables
make sure mysqld is dead!!!
tar -cvf /tmp/mysql-snapshot.tar /path/to/data-dir
lib/ASNMTAP/Asnmtap/Applications.pod view on Meta::CPAN
mysql> STOP SLAVE; <-- if replication was running
This is where you put the values you got earlier from SHOW MASTER STATUS from 3)
mysql> CHANGE MASTER TO
MASTER_HOST='<slave hostname>',
MASTER_USER='<replication username>',
MASTER_PASSWORD='<replication password>',
MASTER_LOG_FILE='<recorded log file name>', <-- replace with the value show 'SHOW MASTER STATUS' on the master server
MASTER_LOG_POS=<recorded log offset>; <-- replace with the value show 'SHOW MASTER STATUS' on the master server
mysql> START SLAVE; <-- if you want to restart replication
At this point you got master -> slave -> master replication
You can now execute any query on any of them, and it will appear on both.
We will do it always onto the master server, unless the master server is down then we uses the slave server!!!
=back
=item Update your ASNMTAP configuration
vi /opt/asnmtap/Asnmtap.cnf
Here you can modify all the varibales used by the ASNMTAP package !!!
vi /opt/asnmtap/applications/Applications.cnf
URL: http://asnmtap.citap.be/asnmtap/cgi-bin/sadmin/index.pl
regarding the server administrator, the default username: `sadmin` and password: `a1A`
Now you can build your config !!!
=back
=item Install perl modules from CPAN
export http_proxy=http://proxy:8080
export ftp_proxy=http://proxy:8080
perl -MCPAN -e shell
install Bundle::CPAN
install Bundle::DBI
install Bundle::DBD::mysql # need mysql-devel
=item Perfparse integration
Perfparse (http://perfparse.sourceforge.net/)
We use the 'Pipe to Perfparse' methode
=over 4
=item Compiling Perfparse
wget http://belnet.dl.sourceforge.net/sourceforge/perfparse/perfparse-0.106.1.tar.gz
cd /export/download/
tar -xvzf perfparse-0.106.1.tar.gz
cd /export/download/perfparse-0.106.1
./configure --prefix=/opt/asnmtap/perfparse --with-imagedir=/opt/asnmtap/applications/htmlroot/img/ --with-cgidir=/opt/asnmtap/applications/htmlroot/cgi-bin --with-http_image_path=/asnmtap/img --with-data-source=asnmtap --disable-phpui
make
make install-strip
=item Installing Perfparse database
cd /export/download/perfparse-0.106.1/scripts
cat mysql_create.sql | mysql -u root -p -D asnmtap
=item Configuration of Perfparse v19 for ASNMTAP
cp /opt/asnmtap/perfparse/etc/perfparse.cfg.example /opt/asnmtap/perfparse/etc/perfparse.cfg
First you should edit '/opt/asnmtap/perfparse/etc/perfparse.cfg', adding the correct database settings (if using something other than 'nagios' as DB name, username, and password). The options are :
Use_Storage_Mysql (only in perfparsed; considered as enabled in perfparse-log2mysql)
vi /opt/asnmtap/perfparse/etc/perfparse.cfg
...
Service_Log "-"
...
# Error handling :
Error_Log = "/opt/asnmtap/log/perfparse-asnmtap-all"
Drop_File = "/opt/asnmtap/log/perfparse-asnmtap-drop"
...
# Database managment :
# ====================
Use_Storage_Mysql = "yes"
No_Raw_Data = "no"
No_Bin_Data = "no"
# Database Authentication
DB_User = "asnmtap"
DB_Name = "perfparse_asnmtap"
DB_Pass = "passwd"
DB_Host = "localhost"
=item Configuration of Perfparse v20 for ASNMTAP
cp /opt/asnmtap/perfparse/etc/perfparse20.cfg.example /opt/asnmtap/perfparse/etc/perfparse20.cfg
First you should edit '/opt/asnmtap/perfparse/etc/perfparse20.cfg', adding the correct database settings (if using something other than 'nagios' as DB name, username, and password). The options are :
Use_Storage_Mysql (only in perfparsed; considered as enabled in perfparse-log2mysql)
vi /opt/asnmtap/perfparse/etc/perfparse20.cfg
...
Service_Log "-"
...
# Error handling :
Error_Log = "/opt/asnmtap/log/perfparse-asnmtap-all"
Drop_File = "/opt/asnmtap/log/perfparse-asnmtap-drop"
...
# Database managment :
# ====================
Storage_Modules_Load = "mysql"
Use_Storage_Mysql = "yes"
lib/ASNMTAP/Asnmtap/Applications.pod view on Meta::CPAN
=item Testing configuration
... TODO ... NO PART OF NORMAL SETUP ...
=back
=item NagTrap integration
... TODO ... NO PART OF NORMAL SETUP ...
=over 4
=item Install NagTrap
... TODO ... NO PART OF NORMAL SETUP ...
=item Configuration of NagTrap for ASNMTAP
more /opt/asnmtap/applications/htmlroot/snmptraps/.htaccess
AuthName "CITAP's Nagios Access"
AuthType Basic
AuthUserFile /etc/httpd/conf/nagios-htpasswd.users
require valid-user
... TODO ... NO PART OF NORMAL SETUP ...
=item Testing configuration
... TODO ... NO PART OF NORMAL SETUP ...
=back
=item Install HTML to PDF converter for Perl
HTMLDOC: http://www.htmldoc.org/
=over 4
=item Downloading the Software
Get the software from http://www.htmldoc.org/
cd /export/download
wget http://ftp.easysw.com/pub/htmldoc/1.8.27/htmldoc-1.8.27-source.tar.gz
=item Installing the Software
=over 4
=item Linux
cd /export/download/directory
rpm -i htmldoc-1.8.27-linux-intel.rpm
/usr/bin/htmldoc
=item Solaris
cd /export/download/directory
tar -xvzf htmldoc-1.8.27-source.tar.gz
cd /export/download/htmldoc-1.8.27
./configure
make
make install
=back
=item Licensing the Software
The HTMLDOC License window is shown the first time you run the software.
Click on the Update License button to add a license to your system
perl -MCPAN -e shell
install HTML::HTMLDoc
ln -s /usr/bin/htmldoc /opt/asnmtap/applications/htmlroot/cgi-bin/htmldoc.cgi
vi httpd.conf
AcceptPathInfo On
AddHandler cgi-script .cgi .pl
Options ExecCGI FollowSymLinks
=item Testing the Software
htmldoc -f '/opt/asnmtap/results/_ASNMTAP/reports/yyyydmmdd-collectorDaemonSchedulingReports.pl-_ASNMTAP-probe02-Daily.pdf' --bodyimage /opt/asnmtap/applications/htmlroot/img/logos/bodyimage.gif --charset iso-8859-1 --format pdf14 --size A4 --landsc...
cd /opt/asnmtap/applications/bin
./generateCollectorDaemonSchedulingReports.pl -D L
ls /opt/asnmtap/results/_ASNMTAP/reports/
=back
=item Install ChartDirector 4.x for Perl
=over 4
=item Linux installation
download chartdir_perl_linux.tar.gz from http://www.advsofteng.com/
wget http://www.advsofteng.com/chartdir_perl_linux.tar.gz
mv chartdir_perl_linux.tar.gz /opt/.
cd /opt
tar -xvzf chartdir_perl_linux.tar.gz
rm chartdir_perl_linux.tar.gz
=item Solaris installation
download chartdir_perl_sunos.tar.gz from http://www.advsofteng.com/
wget http://www.advsofteng.com/chartdir_perl_sunos.tar.gz
mv chartdir_perl_sunos.tar.gz /opt/.
cd /opt
tar -xvzf chartdir_perl_sunos.tar.gz
rm chartdir_perl_sunos.tar.gz
=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"
lib/ASNMTAP/Asnmtap/Applications.pod view on Meta::CPAN
=item Step 3: Creating Client Certificates for Authentication
openssl genrsa -des3 -out alex-peeters.key 1024
openssl req -new -key alex-peeters.key -out alex-peeters.csr
openssl x509 -req -in alex-peeters.csr -out alex-peeters.crt -sha1 -CA server-ca.crt -CAkey server-ca.key -CAcreateserial -days 3650
openssl pkcs12 -export -in alex-peeters.crt -inkey alex-peeters.key -name "Alex Peeters" -out alex-peeters.p12
openssl pkcs12 -in alex-peeters.p12 -clcerts -nokeys -info
when:
[error] Re-negotiation handshake failed: Not accepted by client!?
[error] Certificate Verification: Error (20): unable to get local issuer certificate
vi /etc/httpd/cond.d/ssl.conf
SSLCertificateFile /etc/httpd/conf/ssl.crt/citap-server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/citap-server.key
SSLCertificateChainFile /etc/httpd/conf/ssl.crt/server-ca.crt
SSLCACertificateFile /etc/httpd/conf/ssl.crt/server-ca.crt
=back
=back
=item MySQL
=over 4
=item A -> B -> C -> A replication
MySQL Reference Manual http://mysqld.active-venture.com/
It is safe to connect servers in a circular master/slave relationship with log-slave-updates enabled. Note, however, that many queries will not work correctly in this kind of setup unless your client code is written to take care of the potential prob...
A -> B -> C -> A
Server IDs are encoded in the binary log events. A will know when an event it reads had originally been created by A, so A will not execute it and there will be no infinite loop. But this circular setup will work only if you only if you perform no co...
=over 4
=item PURGE MASTER LOGS
PURGE {MASTER|BINARY} LOGS TO 'log_name'
PURGE {MASTER|BINARY} LOGS BEFORE 'date'
Deletes all the binary logs listed in the log index that are strictly prior to the specified log or date. The logs also are removed from this list recorded in the log index file, so that the given log now becomes the first.
If you have an active slave that is currently reading one of the logs you are trying to delete, this command does nothing and fails with an error. However, if you have a dormant slave, and happen to purge one of the logs it wants to read, the slave w...
You must first check all the slaves with SHOW SLAVE STATUS to see which log they are reading, then do a listing of the logs on the master with SHOW MASTER LOGS, find the earliest log among all the slaves (if all the slaves are up to date, this will b...
=item RESET MASTER
Deletes all binary logs listed in the index file, resetting the binlog index file to be empty
=item RESET SLAVE
Makes the slave forget its replication position in the master's binlogs. This statement is meant to be used for a clean start: it deletes the `master.info' and `relay-log.info' files, all the relay logs, and starts a new relay log.
Note: All relay logs are deleted, even if they had not been totally executed by the slave SQL thread. (This is a condition likely to exist on a replication slave that is highly loaded, or if you have issued a STOP SLAVE statement.) Connection informa...
=item How do I configure a slave if the master is already running and I do not want to stop it?
There are several options. If you have taken a backup of the master at some point and recorded the binlog name and offset ( from the output of SHOW MASTER STATUS ) corresponding to the snapshot, do the following:
Make sure the slave is assigned a unique server ID.
Execute the following statement on the slave, filling in appropriate values for each parameter:
mysql> CHANGE MASTER TO
-> MASTER_HOST='master_host-name',
-> MASTER_USER='master_user_name',
-> MASTER_PASSWORD='master_pass',
-> MASTER_LOG_FILE='recorded_log_name',
-> MASTER_LOG_POS=recorded_log_pos;
Execute START SLAVE on the slave.
If you do not have a backup of the master already, here is a quick way to do it consistently:
FLUSH TABLES WITH READ LOCK
gtar zcf /tmp/backup.tar.gz /var/lib/mysql (or a variation of this)
SHOW MASTER STATUS - make sure to record the output - you will need it later
UNLOCK TABLES
An alternative is taking an SQL dump of the master instead of a binary copy like above; for this you can use mysqldump --master-data on your master and later run this SQL dump into your slave. However, this is slower than makeing a binary copy.
No matter which of the two methods you use, afterwards follow the instructions for the case when you have a snapshot and have recorded the log name and offset. You can use the same snapshot to set up several slaves. As long as the binary logs of the ...
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.
lib/ASNMTAP/Asnmtap/Applications.pod view on Meta::CPAN
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
=head1 EXPORT
...
=head1 AUTHOR
Alex Peeters [alex.peeters@citap.be]
=head1 SEE ALSO
ASNMTAP::Asnmtap, ASNMTAP::Asnmtap::Applications::CGI, ASNMTAP::Asnmtap::Applications::Collector, ASNMTAP::Asnmtap::Applications::Display
=head1 DEPENDENCIES
ASNMTAP::Time
ASNMTAP::Asnmtap
Carp
Config::General
Config::General::Interpolated
Getopt::Long
HTML::Entities
Mail::Sendmail
Time::Local
=head1 COPYRIGHT NOTICE
(c) Copyright 2000-2011 by Alex Peeters [alex.peeters@citap.be],
All Rights Reserved.
ASNMTAP is based on 'Process System daemons v1.60.17-01', Alex Peeters [alex.peeters@citap.be]
Purpose: CronTab (CT, sysdCT),
Disk Filesystem monitoring (DF, sysdDF),
Intrusion Detection for FW-1 (ID, sysdID)
Process System daemons (PS, sysdPS),
Reachability of Remote Hosts on a network (RH, sysdRH),
Rotate Logfiles (system activity files) (RL),
( run in 0.771 second using v1.01-cache-2.11-cpan-39bf76dae61 )