Get grep right

Problem

When you look for a process in the ps output, the command line of grep often shows up:
ps auwwx | grep sshd
root 648 0.0 0.0 3732 1012 ? S Apr06 0:00 /usr/sbin/sshd
user 20807 0.0 0.0 4836 680 pts/0 S 04:31 0:00 grep /sshd
$

This can make writing scripts for automating sys admin tasks difficult.

Solution

There are many ways to get around this problem. Grep has for example exclusion pattern option. However, there is a simple way when you use a shell that allows character regular expressions: using a simple expression that will not alter what you are searching for, yet prevent the command line itself from being matched. For example:
$ ps auwwx | grep /ssh[d]
root 648 0.0 0.0 3732 1012 ? S Apr06 0:00 /usr/sbin/sshd

Notice the grep command line doesn’t appear any more in the results.

References


DB2 9.7.2 Log files on Windows 7

Problem

Since Windows Vista (that includes Windows 7), the place where programs store some of their information has changed. This makes finding the DB2 log files (equivalent of db2diag.log) more difficult.

Solution

The log files have moved under the directory tree node C:/Program Data/IBM/DB2/DB2COPY1/DB2. Under that directory there is a log and an events directory. This being Windows, the events directory has the logs that on Linux/Unix are the equivalent of the db2diag.log.

References

Windows Vista: Where is db2diag.log location?


How to protect Cognos 10 app server

Problem: Protecting Cognos 10 App Server

The Cognos 10 application runs within an application server. As a result it is vulnerable to attacks over the Internet through the open ports for WWW traffic.

Here are some notes on CAF.

Ant

http://publib.boulder.ibm.com/infocenter/caapps/v8r4m0/topic/com.ibm.swg.im.cognos.inst_apps.8.4.0.doc/inst_apps_i_cnfg_CAF.html

You can track firewall activity by checking the log file, which contains rejected requests only. If firewall validation fails, you can check the log file to find where the failure occurred. By default, log messages are stored in the c8_location/logs/cogserver.log file. In a gateway-only installation, the file is named caf.log. If you configure a destination for log messages, IBM Cognos Application Firewall log messages are sent to the specified destination.

IBM Cognos Application Firewall also has a Secure Error feature, which gives administrators control over which groups or users can view detailed error messages. For more information, see the IBM Cognos 8 Administration and Security Guide.


How to clear the IBM Lotus Domino server's dns cache

Problem

When the domino server caches an MX record, and that record changes, it may take time before the cache is refreshed. In some instances it is desirable to have the DNS cache refreshed on demand.

Solution

On the Domino console (IBM Domino Administrator -> Server… -> Status -> Server Console) run the following domino command:
tell router update config
If you need the cache to be refreshed more often, you can set this command to run on a schedule as well.


Install Lotus Notes 8.5.1 on SLED 11

Problem

When trying to install Lotus Notes 8.5.1 on SLED (Suse Linux Enterprise Desktop), the following error occurs:
error: Failed dependencies:
libgnomeprint-2-2.so.0 is needed by ibm_lotus_notes-8.5.1-20090929.1223.i586
libgnomeprintui-2-2.so.0 is needed by ibm_lotus_notes-8.5.1-20090929.1223.i586

This is due to the fact that Notes is a 32bit application. The latest SLED DVD doesn’t contain some of the 32bit libraries.

Solution

Using RPMfind, or your preferred RPM finder, locate, download and install the 32bit version of the following libraries:
libgnomeprint-32bit
libgnomecups-32bit
libgnomeprintui-32bit


Create Explain Tables in DB2 9.7

Problem

The explain tables allow to create access plans and visualize them. Before the explain feature of DB2 can be used, the EXPLAIN tables need to be generated.

Solution

To create the EXPLAIN tables, the following command needs to be issued while connected to the database that the access plain needs to be generated in:
CALL SYSPROC.SYSINSTALLOBJECTS('EXPLAIN','C',NULL,'EXPLAIN_SCHEMA')