DBAmon
Master Installation Checklist - Cygwin

Home | Index / DBAmon Documentation | DBAmon Change History | DBAmon Event/Error Documentation |
What DBAmon Monitors | Free Oracle Tool: orastat | Request Support | DBAmon Download | DBAmon Gadget

If you have any problems with this checklist, please Request Support. Your feedback makes DBAmon a better product.


Installation Checklist - Cygwin

  1. Architecture Familiarization -

    Take a minute to begin to familiarize yourself with the DBAmon Architecture Diagram. It briefly speaks to DBAmon input/output and process flow. One concept that you will have to be familiar with is that of a Master Server. This is the server where the DBAmon software will reside. This Master server will reach out to monitor DBMS instances that reside on other servers.

  2. A word of wisdom on Userids -

    It is far perferable to use a GENERIC, or SERVICE ID than to use an individual's ID to run DBAmon, on the MASTER or TARGET server. You CAN use the same userid on the MASTER and TARGET servers to run DBAmon.

    Some planning should now be done. You need to decide:

    • Which userid will be used on my DBAmon MASTER Server to install the DBAmon MASTER software.
    • Which userid will be used on my initial DBAmon TARGET Server to install the DBAmon TARGET software.

    You WILL have problems if you use 1 userid to install the DBAmon MASTER software on the MASTER server, and then change to use a different userid on that server later.

    It is allowed to have a different userid running the MASTER DBAmon software than the userid running COPSSH on the TARGET server, but you have to consistenly use the same ID on any one server. The same is true for targets - use the SAME userid to install Perl, COPSSH and to configure COPSSH. Using SHIFT+RIGHT-CLICK+"Run As" is a good way to do this. Again, it is very important to use the DBAmon TARGET userid to run the COPSSH "Add User" dialog. Everything on the TARGET server must be done with the same userid (by either logging in as that user, or by using "Run As" as shown above).

  3. Download DBAmon Software -

    Download the software if you haven't already. It is packaged as a gzip'd tar file about 280K in size. Go to the Download Form. After agreeing to the download terms, you can begin downloading the tar file. Save the tar file on the MASTER server. C:\temp would be a good place.

  4. Download CYGWIN Software -

    Download the setup.exe program from CYGWIN. This will then install CYGWIN onto your DBAmon MASTER servce. Download the current version from cygwin.com/setup.exe to your wherever you save downloads. We will come back to this later.

  5. Install Base CYGWIN -

    Execute the downloaded setup.exe program. Answer the prompts:

    • NEXT
    • INSTALL FROM INTERNET
    • ROOT DIR - C:\cygwin -
    • ALL USERS
    • NEXT
    • Local package dir: (let it default)
    • Direct Connect
    • Any site
    • Select packages - Just do NEXT to install the base.
    DO create an ICON for CYGWIN on the desktop. The base CYGWIN software will now be installed. It should take around 10 minutes.

  6. Copy setup.exe Program -

    Copy the setup.exe program that you used in the previous step to C:\cygwin . You will need this later.

  7. Install Additional CYGWIN Software -

    You will need a few optional CYGWIN packages. To install them:

    • WIN: Go to C:\cygwin
    • setup
    • click NEXT 6 time (all default values)
    • for Search enter: email
    • Click the + next to Mail
    • For the "email: Command line." line click over SKIP which tells the install to install this
    • Click NEXT
    • It may bring up a screen about Resolving Dependencies. Click NEXT
    • It will now install this package.. be patient!

  8. Install More CYGWIN Optional Software -

    Repeat the prior step to add the packages:

    • ploticus
    • procps
    • apache (not apache2) - under WEB
    • perl
    • vim and gvim (under editors)
    • make (under Devel)
    • GCC
    • GCC-4
    • cygrunsrv
    • cron
    • openssh
    • email
    • libmpfr4

  9. CYGWIN Startup -

    Start a CYGWIN window from the icon created on the desktop. This will be the environment under which DBAmon will run. You can now set the terminal defaults (color, window size, font, etc.). I use raster 7x12, text color 100,120,250. Yada yada.

  10. CYGWIN Environment -

    Using the "vi" editor, you need to add these commands to the end of ~/.bashrc:

    echo ".bashrc Starting"
    alias df='df -h'
    alias du='du -h'
    alias ls="ls -CF --color"
    alias ll='ls -l'            
    alias la='ls -A'           
    alias cdd='cd /opt/dbamon'
    alias ps='dbamon_ps'
    set -o vi
    export PATH=$PATH:.:/opt/dbamon/bin:/usr/sbin:~/bin
    echo ".bashrc Done"o
    

    Now exit from CYGWIN and get back in. You should see: .bashrc Done

  11. Setup Perl In CYGWIN Environment -

    In the CYGWIN window:

    cd ~ 
    cpan 
    yes                (allow CPAN to do initial configuration)
    install DBI        (this will take about 20 minutes -- make sure there are no error messages and that the final tests are OK)
    install DBD::ODBC  (this will take about 15 minutes -- make sure there are no error messages and that the final tests are OK)
    install Devel::Size
    exit
    

  12. Install DBAmon Software

    All of these steps will be executed in the CYGWIN environment.

    1. Create DBAMON HOME Directory and Explode Software -

      Run:

      mkdir -p /opt/dbamon
      cd /opt/dbamon
      cp /cygdrive/c/temp/dbamon.tgz .
      gunzip dbamon.tgz
      tar -xvf dbamon.tar

      DBAmon is now installed into your new CYGWIN environment.

    2. Perl Symbolic Link -

      Run:

      ln -s /usr/bin/perl /usr/local/bin/perl 

    3. Run DBAmon Installer -

      Run:

      cd /opt/dbamon/bin 
      mkdir /opt/dbamon/log
      ./dbamon_install
      

      Follow the prompts. Yes, you do want to copy the CGI scripts to the default directory that is coded into this script.

  13. DBAmon Repository - Configure -

    Now, choose which SQL Server instance (it must be running at least SQL 2008R2) which is to contain your DBAmon Repository. We will code that into the dbamonrc file, which is used to specify DBAmon Global Parameters. Run:

    cd /opt/dbamon/adm 
    cp dbamonrc.TEMPLATE dbamonrc 
    

    Now, edit the dbamonrc file. At a minimum, you need to now specify these parameters (these are example values):

    • Admin_EMail: you@something.com
    • Use_MSSQL: Y
    • MSSQL_Instance: localhost\SQL2

  14. DBAmon Repository - Create DB -

    Copy SQL from /opt/dbamon/sql_mssql/create_dbamon_database.sql and paste into SSMS in REPOS instance. Run this SQL to create the database now. Verify that it was created.

  15. DBAmon Repository - Test DB Connectivity -

    Run dbamon_test_DBI (in /opt/dbamon/bin, but that should be in your PATH since you changed the .bashrc to make PATH include /opt/dbamon/bin). You should see something like:

    $ dbamon_test_DBI
    2011/01/15-22:33:40 dbamon_test_DBI [_1716] | Connecting to MSSQL Repository - mssql_instance=localhost\SQL2005 DSN=driver={SQL Server};Server=localhost\SQL2005;uid=;pwd=;
    2011/01/15-22:33:41 dbamon_test_DBI [_1716] | Connected OK
    2011/01/15-22:33:41 dbamon_test_DBI [_1716] | Running sql: select name from master.dbo.sysdatabases order by 1
    2011/01/15-22:33:41 dbamon_test_DBI [_1716] |   Found database name=dbamon
    2011/01/15-22:33:41 dbamon_test_DBI [_1716] |   Found database name=master
    2011/01/15-22:33:41 dbamon_test_DBI [_1716] |   Found database name=model
    2011/01/15-22:33:41 dbamon_test_DBI [_1716] |   Found database name=msdb
    2011/01/15-22:33:41 dbamon_test_DBI [_1716] |   Found database name=tempdb
    2011/01/15-22:33:41 dbamon_test_DBI [_1716] | Done 
    

    Make sure that you see ALL of the DBs in this SQL instance. If this looks correct, then you have successfully installed the correct Perl and ODBC modules for accessing the DB.

  16. Create Windows Services -

    First, edit the script dbamon_setup_services in /opt/dbamon/bin. Change the string to the user that you are now using (DOMAIN\\USER).

    Run dbamon_setup_services to create 2 new Windows SERVICES:

    • Cron daemon
    • CYGWIN Apache
    Answer the prompts for cron-config as follows:

     $ dbamon_setup_services
    Enter password of user `xx\dbmsmonitor':
    Reenter, please:
    Do you want to install the cron daemon as a service? (yes/no) yes
    Enter the value of CYGWIN for the daemon: [ ] ntsec
    
    You must decide under what account the cron daemon will run.
    If you are the only user on this machine, the daemon can run as yourself.
       This gives access to all network drives but only allows you as user.
    To run multiple users, cron must change user context without knowing
      the passwords. There are three methods to do that, as explained in
      http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd1
    If all the cron users have executed "passwd -R" (see man passwd),
      which provides access to network drives, or if you are using the
      cyglsa package, then cron should run under the local system account.
    Otherwise you need to have or to create a privileged account.
      This script will help you do so.
    Do you want the cron daemon to run as yourself? (yes/no) yes
    
    Please enter the password for user 'dbmsmonitor':
    Reenter:
    Running cron_diagnose ...
    WARNING: You do not currently have a crontab file.
    
    ... no problem found.
    
    Do you want to start the cron daemon as a service now? (yes/no) yes
    OK. The cron daemon is now running.
    
    In case of problem, examine the log file for cron,
    /var/log/cron.log, and the Windows event log (using /usr/bin/cronevents)
    for information about the problem cron is having.
    
    Examine also any cron.log file in the HOME directory
    (or the file specified in MAILTO) and cron related files in /tmp.
    
    If you cannot fix the problem, then report it to cygwin@cygwin.com.
    Please run the script /usr/bin/cronbug and ATTACH its output
    (the file cronbug.txt) to your e-mail.
    
    WARNING: PATH may be set differently under cron than in interactive shells.
             Names such as "find" and "date" may refer to Windows programs.
    

    To verify that the services were created (with AUTOMATIC STARTUP) and are running go to WINDOWS SERVICES to ensure that Cron daemon and CYGWIN Apache are defined and STARTED.

  17. EMail Configure and Verify -

    First, configure the email software. Edit /etc/email/email.conf to use YOUR SMTP server. Specify the SMTP_SERVER parameter in this file to specify your SMTP server hostname. Now, test email by sending an email to your self from the CYGWIN environment. From the CYGWIN shell, run:

    echo 'test' | dbamon_mailer -s 'test abc' your-email-address

    Ensure that you receive the email at the destination.

  18. Verify CYGWIN Utilities -

    Run:

    dbamon_ps

    The output should look something like:

     $ dbamon_ps
    USER       PID  PPID S TT       %CPU    SZ START     ELAPSED     TIME COMMAND         COMMAND
    36294     4364     1 S ?         0.0   839 Jan15    21:21:51 00:00:00 cygrunsrv       /usr/bin/cygrunsrv
    36294     5424  4364 S ?         0.0  1191 Jan15    21:21:51 00:00:00 httpd           /usr/sbin/httpd -F -D NO_DETACH
    36294     3636  5424 R ?         0.0  1106 Jan15    21:21:49 00:00:00 httpd           /usr/sbin/httpd -F -D NO_DETACH
    36294     4900  5424 S ?         0.0  1106 Jan15    21:21:49 00:00:00 httpd           /usr/sbin/httpd -F -D NO_DETACH
    36294     4176  5424 S ?         0.0  1106 Jan15    21:21:49 00:00:00 httpd           /usr/sbin/httpd -F -D NO_DETACH
    36294     4372  5424 S ?         0.0  1106 Jan15    21:21:49 00:00:00 httpd           /usr/sbin/httpd -F -D NO_DETACH
    36294     5160     1 S ?         0.0   839 Jan15    21:20:13 00:00:00 cygrunsrv       /usr/bin/cygrunsrv
    36294     2820  5160 S ?         0.0   715 Jan15    21:20:13 00:00:01 cron            /usr/sbin/cron -n
    36294     4408     1 S tty0      0.0  1087 19:53       18:13 00:00:00 bash            bash --login -i
    36294     5428  5424 S ?         0.0  1106 20:04       07:11 00:00:00 httpd           /usr/sbin/httpd -F -D NO_DETACH
    36294     5704  4408 S tty0      1.8   880 20:11       00:06 00:00:00 perl            /usr/bin/perl /opt/dbamon/bin/dbamon_ps
    36294     1764  5704 R tty0      0.9   875 20:11       00:05 00:00:00 procps          /usr/bin/procps -eao user,pid,ppid,state,tty,%cpu,sz,start_time,etime,time,comm,args
    

    Now, verify Apache. Since you previously verified that The CYGWIN Apache service is running, verify that you can cannot. In an IE browser windows, simply connect to this this host. For example, http://localhost . You should see a default Apache screen with the Apache logo at the bottom of the screen.

    Also verify CRON. Create a cron entry:

    crontab -e
    (a VI window will be displayed - Enter this line into the file:)
    * * * * * /bin/touch /tmp/dbamontestfile.txt
    (Now :wq)

    After a few minutes you should see that a file named dbamontestfile.txt exists in the /tmp directory.

  19. Setup Apache -

    Run:

    ln -s /opt/dbamon/htm /var/www/htdocs/dbamon

    Now, in IE, navigate to http://localhost/dbamon . You should see the DBAmon Console page.

    Also, edit /etc/apache/httpd.conf to set these parameters:

    • AddHandler server-parsed .html (toward the end of the file)
    • Within "Directory /" add "Includes" to the Options line
    • Within "Directory /var/www/htdocs", add "+Includes FollowSymLinks" to the end of the line

  20. Generate Master SSH Key -

    First, cd to your home directory in CYGWIN. Run ssh-keygen. Follow this dialogue:

    $ ssh-keygen -t dsa
    Generating public/private dsa key pair.
    Enter file in which to save the key (/home/dbmsmonitor/.ssh/id_dsa):
    Created directory '/home/dbmsmonitor/.ssh'.
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/dbmsmonitor/.ssh/id_dsa.
    Your public key has been saved in /home/dbmsmonitor/.ssh/id_dsa.pub.
    The key fingerprint is:
    (the hex key)  dbmsmonitor@THESERVER
    The key's randomart image is:
    +--[ DSA 1024]----+
    (a pretty little picture) 

    This master SSH key that you just created will be used for ALL subsequent DBAmon "TARGET Server" installations. You'll see... ;o)

  21. Initial TARGET Server Configuration

    You now need to install the software and configure the Master and the first database instances that you will be monitoring. See: TARGET Configuration (Windows) .

  22. DBAmon Configuration - User Exits

    DBAmon User Exits are the way to configure DBAmon to function in your environment. For example, you would configure a User Exit to have DBAmon create a ticket for your Help Desk call tracking system. See: DBAmon UserExist Customization .

  23. DBAmon Configuration - Instance Monitoring DBC File(s)

    DBC files reside in:

    • /opt/dbamon/adm/instances for DBAmon "prod" mode
    • /opt/dbamon/adm/instances_test for DBAmon "test" mode

    A DBC file specifies the parameters that DBAmon will use to monitor 1 database instance. There is 1 .dbc file in /opt/dbamon/adm/instances for every DB instance that you wish to monitor. Any file with the ".dbc" suffix will be read by DBAmon to monitor 1 database instance. There are TEMPLATE* files in /opt/dbamon/instance; one for each DB type that you will be monitoring. To get started, say for example that you will be monitoring an Oracle DB named SID1 on server myserver. Run:

    • cd /opt/dbamon/adm/instances
    • cp TEMPLATE_Oracle.new myserver_SID1.dbc

    See: dbc Customization for information on how to customize DBC files.

  24. Test the DBAmon Installation

    To test your installation, we are going to run "DBAmon Test Mode". To do this, logged into the Master Server as userid dbamon, copy 1 DBC file that you created above from the /opt/dbamon/adm/instances directory to the /opt/dbamon/adm/instances_test directory. Also, copy your /opt/dbamon/adm/dbamonrc file to /opt/dbamon/adm/dbamonrc_test and edit this file to ensure that the Iterations: value is set to 1. To start DBAmon Test Mode, run:

    dbamon test

    and watch all messages that are written to stdout.

    This first time that you run DBAmon test, there will be a few dbamon_mssql_util error messages near the top of the output. This is normal since the tables do not yet exist.

    There will be some messages about creating DB objects. If you get to the end then DBAmon is working. More information can be found in the log files in /opt/dbamon/log for possible errors. The actual output from the monitoring of your DB's will always be written to /opt/dbamon/log/{Day of Week}. If the Error_EMail: dbamonrc parm is properly configured, then most errors will be sent to the EMAil address that you specify there. Note that this is not how you would run DBAmon in a production environment. We will get to that in the next step.

  25. Cron Configuration

    Certain cron entries must be setup for UX user dbamon. See: DBAmon Cron Configuration . This is required for DBAmon to run in Production Mode.

  26. DBAmon Operation

    See: DBAmon Command Reference for more information. During normal operation, you should not have to do anything. The dbamon_checker process which runs under cron every 15 minutes checks to see if DBAmon is running (You configured cron in the DBAmon Software Installation step above). If it is not, then it automatically starts it (by issuing the command: dbamon) in daemon mode. If you need to stop DBAmon for any reason, run dbamon_stop, but beware that dbamon_checker will attempt to restart it within 5 minutes. If you make any chnages to a DBC file, DBAmon will automatically reread the changes during the next iteration.


DBAmon.com
This Document: http://www.dbamon.com/installation_cygwin/index.shtml