Posts

Glassbox: Drop-in Java Diagnosis Tool

Image
Glassbox is a monitoring tool that can understand the methods and exceptions via Aspect Oriented Programming. The tool can monitor the the java application, diagnose specific errors, race conditions and performance issues and provide the result in plain english with supporting logs. Check out the Google Tech Talk on Glassbox.

How to monitor file transfer progress in FTP

When you are transferring a large file using the ftp command line tool, you are not really sure if the transfer is going on or not. The prompt take hours to return with success or failure message. A very simple way to monitor the transfer is to use hash command in the FTP prompt. Example: $ ftp <host> user: <user name> password: <pass> ftp> hash Hash mark printing on (1024 bytes/hash mark). ftp> get a_very_large_file 200 PORT command okay. 150 Opening data connection for a_very_large_file ######################################## 226 Transfer complete.

Running OS Program or Script as SAP Job Step

SAP allows you to trigger an OS command or script through a job step. A very common usage of this facility is to write FTP scripts and use them as a job step to transfer files. When the background process wants to trigger the script, it sends the request out to SAP gateway (local sapgwXX) through the dispatcher. The gateway calls sapxpg with the OS script/command as an argument. sapxpg then executes the OS command/script. When the command/script finishes or outputs intermediate messages, it passes the information to sapxpg; sapxpg passes that to sapgw; sapgw to the background process via dispatcher. If any of the commands in your script fails and you do not handle them with proper exit codes from the script, the job will be shown as successful as the script exits with an exit 0 command. For example: If we use the following ftp script : #!/bin/ksh ftp -vn $HOST <<END_FTP > /ftp_working_directory/ftplog 2>&1 quote USER sapnwnewbie quot...

SAP Java Server Node Not Starting

If the java server node is not starting up check the bootstrap properties. If you see the following, set the environment variable LDR_CNTRL to USERREGS. JVMCI200 - ERROR: User register saving is not enabled, Garbage Collection could be incorrect. JVMCI200 - ERROR: because of this the JVM library is explicitly aborting the process JVMCI200 - ERROR: You must either rebuild the executable using "-bM:UR" JVMCI200 - ERROR: or run with "export LDR_CNTRL=USERREGS" You can set the environment variable using the command 'export LDR_CNTRL=USERREGS' or 'setenv  LDR_CNTRL USERREGS' in UNIX depending on the shell used. USERREGS enables user register saving when system calls are made by the JVM.

Use of SIGUSR1 and SIGUSR2 on SAP Kernel

SIGUSR1 and SIGUSR2 are user-defined signals that can be sent to a process to perform the pre-defined actions. SAP has implemented these signals to help increase/decrease trace on the kernel program. The following actions are defined for the SIGUSR1 and SIGUSR2 signals on SAP programs like disp+work, gwrd, msg_server, icman, saprouter etc. 1. SIGUSR1 reduces the trace level by one 2. SIGUSR2 increases the trace level by one and writes the current call stack of the program to the trace file. The stack can then be used to determine which operating system routine the process is currently in. Then switch the trace level downwards with SIGUSR1 as, otherwise, the entire program flow is logged in the trace file and the size of the file increases very quickly . If you send the SIGUSR2 signal to an SAP work process (kill -USR2 <PID of work process>), the signal handler executes the pre-defined funtion for SIGUSR2 and the trace is written to dev_w<N> trace file. The trace is ...

Unable to View Java System Reports in NWA

If you get a java.lang.NullPointerException while trying to check Java system reports through NetWeaver Administrator (NWA), check if the applications required are running or not. 1. Go to http://<server>:<port>/nwa --> Operation management --> Systems --> Start&Stop --> Java EE Applications 2. Restart/start the following applications     tc~lm~webadmin~performance~provider_ear     tc~lm~webadmin~performance~viewer~wd     tc~lm~webadmin~monitor~state~wd     tc~lm~webadmin~monitor~complib~wd 3. Check SAP notes 1261071 and 1349854 if you are still unable to open the reports.

GRC Spool and Log File Cleanup

Background or ad-hoc jobs for risk analysis generate spool and log file. Unlike ABAP, where you can set reports to clean up job logs and spool files, GRC does not have house-keeping jobs available. You will have to write your own OS scripts to cleanup old logs from the file system. The background job spool files are written to /usr/sap/<SID>/>INST>/j2ee/cluster/server0/virsa/bgJobSpool with name jobid.X.0 and the foreground tasks (with huge object selection) write _tmp.xx.x.0 at the same location. If the file system fills up, the J2EE engine will hang. You need to restart J2EE engine after a disk full situation.