1. install infx

infx is installed on each server that has the Informix software installed on it. You can only manage instances on hosts where you install infx.

infx requires Perl version 5.8 or higher.  You check your perl version with the command perl -v. Most Linux/Unix distributions have much later versions .

requirements

infx requires a small amount of space for the infx software, the amount required for each instance will vary.

There are logs of each infx service maintained as files. The amount of space required depends on the services you access, and how often.

You can take "photos" and snapshot the instance and database metrics. The size of each file depends on the instance, how often you run it, and other settings.

These are  space requirements for infx:

 item   location  approx size
 infx software  /infx  20mb  
 service logs  /infx/inst/*/logs  10mb
 instance photos  /infx/inst/*/photo  2-5mb each
 database photos  /infx/inst/*/photo  1-2mb

Be sure to monitor your actual space usage carefully.

other items

Other items, such as the informix software, chunk files, database and log backups, can also be stored within the /infx directory tree.

You can also leave them in their existing locations and use links and config settings to point to them.

Some of the other items you might want to store with infx are:

 item   location  approx size
 informix software 11.5  /infx/sw/11.50  750mb
 informix software 11.7  /infx/sw/11.70  1gb
 database chunks  /infx/inst/*/chks  varies
 backup data files  /infx/inst/*/backup/db  varies
 backup log files  /infx/inst/*/backup/logs  varies

When the infx discovery service detects an instance, it will automatically set the informix software location, and detect the location of the database chunk files. It also creates any other directories needed by infx, such as for logs, tmp and etc files.

install location

If you were setting up the host from scratch, it might make sense to create a file system called /infx, and store all the items there.

If you are attaching infx to already installed instances, that is probably not required. You could just install it in /usr/local/infx or /home/informix/infx.

Next create a link from that location to /infx. It is simpler, and through out this guide I always refer to it that way.

Regardless of which of the above you choose, the infx directory must be owner and group informix.

install instructions

  1. Install steps are performed as the informix user
  2. You must set INFORMIXDIR to an installed copy of Informix software first
  3. Transfer the infx software to your host e.g. /home/informix/tar/infx-1.0b.tar.gz
  4. Create tmp directory e.g. mkdir /home/informix/tar/tmp
  5. Change directory to tmp e.g. cd /home/informix/tar/tmp
  6. Extract tar file to tmp directory e.g. tar xvf /home/informix/tar/infx-1.0b.tar.gz
  7. run "./install.sh" and follow the prompts to install.
  8. view the README file for further instructions

example installation

This example shows how to install infx on a Linux server that already has Informix installed. There is one sample instance on the host, created when the informix software was installed.

 host  CentOS 6.0
 informix version  11.70.FC4TL
 location  /opt/IBM/informix
 instance  ol_informix1170
 chunk location  /opt/IBM/informix/ol_informix1170/dbspaces

Once you have downloaded the software from download, copy it to the server under /home/informix/tar, and follow these steps.

mamvps03:/home/informix/tar> mkdir /home/informix/infx
mamvps03:/home/informix/tar> sudo ln -s /home/informix/infx /infx
mamvps03:/home/informix/tar> mkdir tmp
mamvps03:/home/informix/tar> cd tmp
mamvps03:/home/informix/tar/tmp> tar xvf ../infx-1.0b.tar.gz
infx.tar.gz
install.sh
disclaimer.txt
LICENSE
README

mamvps03:/home/informix/tar/tmp> ./install.sh
This will install version 1.0b of infx, do you want to continue?
1) Yes
2) No
#? 1
...[snip license]...
Do you accept the terms of the license?
1) Yes
2) No
#? 1
...[snip disclaimer]...
Do you want to continue?
1) Yes
2) No
#? 1
Enter install location [/infx]: /infx
installing version 1.0b of infx into /infx, INFORMIXDIR=/opt/IBM/informix, continue?
1) Yes
2) No
#? 1
extract software
link noenv to /opt/IBM/informix
link latest to /opt/IBM/informix
creating default /infx/local/etc/config.ini
checking for informix instances
DETECT ol_informix1170: /opt/IBM/informix/etc/onconfig.ol_informix1170: OK
run infx disco noenv save=yes to set up detected instances
version 1.0b of infx installation complete

mamvps03:/home/informix/tar/tmp> /infx/scripts/infx disco noenv newinst=ol_informix1170 save=yes
DETECT ol_informix1170: /opt/IBM/informix/etc/onconfig.ol_informix1170: OK
INFO: creating instance ol_informix1170 server: 0 config: infx-disco.inst onconfig: none.onconfig
/infx/inst/ol_informix1170/logs directory created,  mode: 0755,  note: instance, command and service log files
/infx/inst/ol_informix1170/etc directory created,  mode: 0755,  note: instance specific config files
/infx/inst/ol_informix1170/tmp directory created,  mode: 0755,  note: temporary file location
/infx/inst/ol_informix1170/etc/deny-auto-start file created,  mode: 660,  note: DO NOT start instance automatically
/infx/inst/ol_informix1170/etc/deny-auto-backup-dbs file created,  mode: 660,  note: DO NOT auto backup
/infx/inst/ol_informix1170/etc/deny-auto-clean file created,  mode: 660,  note: DO NOT auto clean
/infx/inst/ol_informix1170/etc/deny-auto-stop file created,  mode: 660,  note: DO NOT auto stop
/infx/inst/ol_informix1170/etc/config.ini created

mamvps03:/home/informix/tar/tmp> /infx/scripts/infx list

mamvps03(103.1.186.63) cpus: 4/4 mem: 0.49gb free: 0.18gb time: Tue Jan 17 14:46:19 2012

stat   inst             mode    version      up           mem    read   write  informixdir
error  ol_informix1170  online  11.70.FC4IE  00:33:05  0.17gb  99.77%  92.73%  /opt/IBM/informix

mamvps03:/home/informix/tar/tmp> . /infx/scripts/infxenv ol_informix1170
ol_informix1170@mamvps03:/home/informix/tar/tmp> infx dbspace
class  space    pg  flags                   chks  size mb  free mb  used mb   used%  read mb  write mb  L0
warn   rootdbs  2k  LO LOGCHG,DBSCHG,AUTO      1   200.00   184.36    15.64   7.82%     2.46    144.01  never
warn   physdbs  2k  LO LOGCHG,DBSCHG,AUTO      1    50.18     0.92    49.26  98.17%     0.00     49.60  never
warn   logdbs   2k  LO DBSCHG,AUTO             1    61.44     6.04    55.40  90.17%     0.00     56.69  never
warn   datadbs  2k  LO DBSCHG,AUTO             1    51.20    51.09     0.11   0.21%     0.00      0.01  never
warn   sbspace  2k  LO SBSPACE,DBSCHG,AUTO     1    32.77    30.41     2.36   7.20%     0.02      0.04  never
good   tempdbs  2k  OK TMP,AUTO                1    51.20    51.09     0.11   0.21%     0.00      0.01  never

ol_informix1170@mamvps03:/home/informix/tar/tmp> infx chunk
chkdir: /opt/IBM/informix/ol_informix1170/dbspaces
no  class  chunk    path     last modified             #  size mb  free    used  used %  read   write  del  sp
1          datadbs  datadbs  Tue Jan 17 14:13:47 2012  1    51.20  0.00   51.20    100%  0.00    0.01
3          llogdbs  llogdbs  Tue Jan 17 14:44:30 2012  1    61.44  0.00   61.44    100%  0.00   56.69
0          plogdbs  plogdbs  Tue Jan 17 14:44:30 2012  1    50.18  0.00   50.18    100%  0.00   49.60
4          rootdbs  rootdbs  Tue Jan 17 14:44:30 2012  1   200.00  0.00  200.00    100%  2.46  144.01
2          sbspace  sbspace  Tue Jan 17 14:13:47 2012  1    32.77  0.00   32.77    100%  0.02    0.04
5          tempdbs  tempdbs  Tue Jan 17 14:13:48 2012  1    51.20  0.00   51.20    100%  0.00    0.01

ol_informix1170@mamvps03:/home/informix/tar/tmp>infx dbs
database   space    owner     created     flags       log  buff  ansi  alloc mb  used  data  index  scans
sysadmin   rootdbs  informix  01/17/2012  0xFFFFD021    1     0     0      4.89  3.34  2.39   0.95     11
sysmaster  rootdbs  informix  01/17/2012  0xFFFFD009    1     0     0      3.78  2.69  1.64   1.05      1
sysuser    rootdbs  informix  01/17/2012  0xFFFFD021    1     0     0      3.01  2.01  1.31   0.70      0
sysutils   rootdbs  informix  01/17/2012  0xFFFFD021    1     0     0      3.11  2.02  1.32   0.70      0

ol_informix1170@mamvps03:/home/informix/tar/tmp>

This is the instance specific configuration file created by the discovery service. These settings override the default infx ones.

; created Tue Jan 17 16:34:29 2012 from: /home/informix/infx/etc/infx-disco.inst

[infxenv]
INFORMIXDIR=/opt/IBM/informix
ONCONFIG=onconfig.ol_informix1170
CHKDIR=/opt/IBM/informix/ol_informix1170/dbspaces
INFORMIXSQLHOSTS=/opt/IBM/informix/etc/sqlhosts.ol_informix1170

[env]

[template]


infx is now installed and operating on instance ol_informix1170.

The discovery service also accepts the parameter newinst=all, which will setup all discovered instances.

See section 2. instance setup for information about changing the settings that get made when a new instance is discovered, or to create new instances from scratch.

Read the README file for more information about setting up your login profile, and other steps to take after installing infx.

See setup apache for information about setting up Apache to access infx from a browser.

See setup ssh keys for information about setting up ssh keys between your servers, allowing you to use infx to manage remote hosts.

infx file locations

infx extracts to the following directories.

 location  description
 /infx/etc  infx config files
 /infx/inst  instance specific directories
 /infx/lib  Perl library files
 /infx/local  locally created infx scripts and templates
 /infx/scripts  infx CLI utilities
 /infx/template  infx templates
 /infx/www  CGI utilities

infx default instance

The tar file contains a default instance called noenv, this is created under /infx/inst/noenv

 location  description
 etc  infx config files
 logs  service execution output
 tmp  temporary files

This is the stub of an instance, no actual Informix instance is created. This is used as the default on commands when an instance is not supplied. 

create informix alias

The infx installation creates a link to the Informix software specified in INFORMIXDIR.

e.g. /infx/sw/laterst -> /opt/IBM/informix

You can also create an alias for any other versions of Informix you have installed. You would do this if you planned to create new infx instances using this  version.

infx inst func=ialias alias=IIF_11.50FC7IE sw=/opt/informix1150

remote installation

Once infx is installed on one host, you can use infx services to install it to other hosts.

The remote host must meet the same requirements for installation i.e. Informix software installed and the /infx location created. Plus, both hosts must have the rsync utility installed.

When ready, send the software to the remote host using the rsync command.

infx rsync dest=mamvps04

You can set up SSH keys between the hosts, which will allow you access without having to enter a password. See setup ssh keys, for details on how to generate a key and send it to the remote host.

You can also use this command to keep remote servers up to date, and to send configuration changes.

README

Example README file contents.

README

Instructions for installation and configuration

i. Installation instructions

1. Extract software to temp directory
2. cd to temp direcrory, run './install.sh' to install
3. Run '/infx/scripts/infx disco' for instance discovery

ii. Futher setup

1. Add infxenv alias to .profile/.bashrc
        alias infxenv='. /infx/scripts/infxenv'
2. Create /etc/init.d/infx or equiv. script to start/stop infx at boot time. Copy is in /infx/scripts/infx.d
        #!/bin/sh
        #
        #       /etc/init.d/infx
        #
        #       Informix instance stop/start
        #
        #       Place in /etc/init.d or equiv. to run infxinit at server start/top
        #
        #       chkconfig: 2345 60 30
        #
        su informix -c "/infx/scripts/infxinit $*"
3. Add these lines to informix crontab to enable automatic backups and logfile cleanup
        0 22 * * * /infx/scripts/infx auto noenv service=backup-dbs >>/dev/null 2>&1
        0 1 1 * * /infx/scripts/infx auto noenv service=clean >>/dev/null 2>&1
4. Setup ssh keys for remote administration. See http://www.infx.me/setup-ssh-keys for more information

iii. Set up Apache access, see http://www.infx.me/setup-apache

1. Apache configuration, add to httpd.conf
        Listen ${host}:${port}
        NameVirtualHost ${host}:${port}
        <VirtualHost ${host}:${port}>
                DocumentRoot /infx/www/docroot
                ServerName ${host}
                ErrorLog /infx/www/logs/infx-error.log
                CustomLog /infx/www/logs/infx.log common
                SetOutputFilter DEFLATE
                ScriptAlias /infx/scgi-bin/ "/infx/www/scgi-bin/"
                Alias /infx/ "/infx/www/docroot/"
                <Directory /infx/www/scgi-bin>
                        AuthType Basic
                        AuthName infxadmin
                        AuthUserFile /infx/www/htpasswd
                        Require user infxadmin
                </Directory>
        </VirtualHost>
2. Set password for infxadmin user
        a  htpasswd -c /infx/www/htpasswd infxadmin
3. To set up Apache daemon to run as informix/informix
        a. Add to httpd.conf:
                User informix
                Group informix
4. Alternatively set up Apache to use suexec and only run the infx cgi as informix
        a. Add to httpd.conf, inside VirtualHost container
                SuexecUserGroup informix informix
        b. Change these paths in httpd.conf
                ScriptAlias /infx/scgi-bin/ "/var/www/infx/scgi-bin/"
                <Directory /var/www/infx/scgi-bin>
        c. relocate /infx/www/scgi-bin to /var/www/infx/scgi-bin
        d. owner/group informix/informix, permissions 755
        e. link /var/www/infx/scgi-bin back to /infx/www/scgi-bin
        f. see http://www.infx.me/setup-apache for more info