The SAP System OS Collector – SAPOSCOL in a Nutshell
The SAP System OS collector (SAPOSCOL) is a platform independent stand-alone program that runs in OS background and collects the system information using a part of the shared memory for various applications and all SAP instances on a great number. These information details can be viewed by transaction code ST06/OS06 in frontend SAPGUI. It is a very useful tool for NetWeaver/Basis Administrators & consultants to monitor server performance. SAPOSCOL extracts real-time data from system, although it does not refreshes automatically, you need to click the ‘Refresh’ button to get the updated data. SAPOSCOL collects system data every 10 seconds and records it, and also records the hourly averages for the last 24 hours. It runs autonomously from SAP instances exactly one course of action per great number and collects data from various operating system resources. User can monitor all the servers under SAP scenery with this tool. But for far away server (livecache server) the transaction code is OS07. You can check CPU utilization, Physical & virtual memory usage, Pool data/Swap size, disk response time, utilization of physical disks and file systems, resource load for running processes and already LAN data from the monitoring list.
You can navigate to this tool from SAP Menu->Tools->CCMS->Control/Monitoring->Performance->Operating System->Local->Activity.
If you can’t see any data, that method the OS Collector (SAPOSCOL) is not running (error code: Shared memory not obtainable). In this situation your main task is to fix the saposcol to run properly. This usually happens after a new SAP installation or Kernel upgrades. If you are new with the SAP Systems the following guideline will be helpful to conquer the saposcol issue.
First, Check the permission of saposcol.exe file, it should be 777 (owner is root in group sapsys) and sticky bit should be set to 4750. If you want to know which user is running saposcol, use “ps -ef | grep saposcol”. Now to change the saposcol file to owner root, group sapsys, mode 4750, log in as root to your unix system and execute the commands as below,
chown root saposcol
chgrp sapsys saposcol
chmod 4750 saposcol
You can also run the “saproot.sh” in the exe dir to set the permissions. Then run saposcol -l as the same owner (root). Check collector position using saposcol -s. After setting the file permissions, you can also use, ST06 -> Operating System Collector -> Click on ‘Start’ to run SAPOSCOL.
To stop the OS collector use saposcol -k. If this command failed to kill the time of action, you can execute “cleanipc 99 remove” (Check SAP observe 548699). If this attempt also fails, then you need to remove the shared memory meaningful of saposcol. Execute command “ipcs -ma” and observe down Shared Memory ID in the line that contains saposcol meaningful. Then execute the command “ipcrm -m ID”. Shared memory meaningful will be produced again next time when you run saposcol.
Sometimes using “saposcol -l” gives a message that it’s already running, but when you grep the time of action using “ps -ef|grep -i saposcol” it may not show the time of action. In this situation, you can use a undocumented parameter “saposcol -f”, where “f” stands for starting the time of action forcefully. When it starts, then stop the time of action in regulation methon using “saposcol -k” and then start it typically using “saposcol -l”.
If saposcol nevertheless doesn’t run, then you need to start it in dialog mode. Login with use adm and follow the steps below,
Collector > clean
Collector > quit
saposcol -k to stop the collector.
Collector > leave (You should get a message- Shared memory deleted)
Collector > quit
mv coll.put coll.put.sav
“coll.put”,if this file contains the old shared memory and should be deleted in order to get a clean start (Check SAP observe 548699, point 7). If you are unsuccessful in clearing shared memory, please try the following commands to clear the shared memory:
$ saposcol -kc
$ saposcol -f
If this also fails, then you need to restart the system from OS level and seems like also need a new version of saposcol (Check SAP observe 19227).
IBM iSeries i5/OS (OS/400, OS/390):
– Check permissions of directory ‘/usr/sap/tmp’ and the file ‘saposcol.exe’, it should be 4755 and owner must be root in sapsys group. Check SAP observe 790639. After assigning permissions you can run from OS command line using ‘SAPOSCOL -l’. To show the position use ‘SAPOSCOL -s’ and to stop the time of action use ‘SAPOSCOL -k’. You can also run the time of action by submitting a job in OS level using
CALL PGM(SAPOSCOL) PARM(-l)
It submits the job in job queue QBATCH in library QGPL.
– In iSeries, you might experience strange data when analyzing CPU utilization using tcode ST06/OS06. already you are using multiple CPU’s, SAPOSCOL might only report CPU usage for the first CPU. Also sometimes you will find CPU utilizations reported above 100% in some intervals, if you are running SAP example in an uncapped partition where multiple logical partitions are using a shared processor pool. In this situation, be sure that CPU usage reported for CPU number 0 is the average usage for all CPU’s being used in the system. If you want to view shared CPU partition information, apply sustain packages as per SAP observe 994025 including following patch levels
6.40 disp+work package (DW): 182 SAPOSCOL: 69
7.00 disp+work package (DW): 109 SAPOSCOL: 34
By applying these patches and sustain packages into the system, new transactions, OS06N, ST06N, and OS07N are obtainable to view additional information in two sections titled “great number system” and “Virtual system”. These include information about the partition kind and the obtainable and consumed CPU in the current partition in addition as in the shared processor pool. So, if you are a iSeries user and your SAPOSCOL is not running, highest probability is that you need to put the latest kernel & saposcol patch. (SAP observe 708136 & 753917)
– Another scenario in iSeries, when your saposcol is not running, and you cannot start it from ST06/OS06. Problem might be with the authorization list R3ADMAUTL was not accurate. You can solve it by this way,
1) Remove QSECOFR *ALL X
2) Change *PUBLIC from *USE to *EXCLUDE
3) Add R3OWNER *ALL X
Now you can start saposcol using the tcode ST06/OS06. And also you can start the time of action from command line,
CALL PGM(/SAPOSCOL PARM(‘-l’)
If this does not solve the problem check if both programs QPMLPFRD and QPMWKCOL in library QSYS have *USE- authority stated for user R3OWNER (SAP observe: 175852). If not then you have to run the following commands:
GRTOBJAUT OBJ(QSYS/QPMLPFRD) OBJTYPE(*PGM) USER(R3OWNER) AUT(*USE)
GRTOBJAUT OBJ(QSYS/QPMWKCOL) OBJTYPE(*PGM) USER(R3OWNER) AUT(*USE)
Then you should verify if the user R3OWNER is part of authority list R3ADMAUTL (SAP observe: 637174). After this if you receive the error “SAPOSCOL not running? (Shared memory not obtainable), then follow the steps below,
1) Remove the shared memory (coll.put) as per SAP observe: 189072. ‘coll.put’ location is: ‘/usr/sap/tmp’.
2) End the jobs QPMASERV, QPMACLCT, QYPSPFRCOL and CRTPFRDTA in QSYSWRK if running.
3) Delete the permanent user space, WRKOBJ OBJ(R3400/PERFMISC*) OBJTYPE(*USRSPC)
4) ENDTCPSVR *MGTC
5) CALL QYPSENDC PARM(‘*PFR ‘ ‘ ‘) [There are 6 blanks after *PFR and there are 6 blanks making up the second parameter]
6) ENDJOB JOB(xxxxxx/QSYS/QYPSPFRCOL) OPTION(*IMMED) SPLFILE(*YES) [This command must be run for all QYPSPFRCOL jobs found on the system even if they show with *OUTQ as their status]
7) ENDJOB JOB(xxxxxx/QSYS/CRTPFRDTA) OPTION(*IMMED) SPLFILE(*YES) [This command must be run for all CRTPFRDTA jobs even if they show with *OUTQ as their status]
8) RNMOBJ OBJ(QUSRSYS/QPFRCOLDTA) OBJTYPE(*USRSPC) NEWOBJ(QPFRCOLDTX)
9) RNMOBJ OBJ(QUSRSYS/QPFRCOLDTA) OBJTYPE(*DTAQ) NEWOBJ(QPFRCOLDTX) [This object may or may not exist at this time]
10) CALL QYPSCOLDTA *observe This program will create a new *USRSPC. After collection sets is started there should be a new *DTAQ.
11) Start collection sets using GO PERFORM, opt 2, and opt 1; OR CALL QYPSSTRC PARM(‘*PFR ‘ ‘*STANDARDP’ ‘ ‘) [There are 6 blanks after *PFR and there are 6 blanks making up the second parameter]. Or, Start collection sets from Operations Navigator.
12) STRTCPSVR *MGTC
13) End and restart Operations Navigator if running. See IBM empowered program examination report (APAR) SE12188 for more information.
14) Now start SAPOSCOL from ST06/OS06.
– Go to the Kernel folder in command line where you will find saposcol.exe. Set complete owner permission
for the file & folder. Then run saposcol -l (saposcol -d in dialog mode)
– You can also try Start/Stop SAPOSCOL service from Control Panel -> Administrative Tools -> sets (sets.msc).
If all other attempts fail, then make sure you have the correct version of SAPOSCOL. Get latest SAPOSCOL from SAP Service Marketplace for your OS. Download the SAPOSCOL.SAR file for your Kernel and save in a directory. Then STOP SAP & SAPOSCOL. Check for any Kernel library locks and don’t forget to take library backup. Then run APYR3FIX and then APYSAP. Check OSS observe 19466.
SAPOSCOL also can be terminated due to small amount of internal memory allocation. When this memory filled little by little during the runtime of SAPOSCOL, system writes data outside the buffer. As a consequence the following buffer is cleared and SAPOSCOL terminates with a dump. Apply the following patches with at the minimum the patch levels stated below:
SAP Release 640: SAPOSCOL patch level 100 and DW patch level 293
SAP Release 700: SAPOSCOL patch level 75 and DW patch level 151
SAP Release 701: SAPOSCOL patch level 18 and ILE patch level 53
SAP Release 710: SAPOSCOL patch level 36 and ILE patch level 161
SAP Release 711: SAPOSCOL patch level 12 and ILE patch level 48
So, it’s obvious that if we use different SAP Systems in one server with incompatible combination of Kernel versions, SAPOSCOL will confront crisis and will not provide data for all systems, though SAP system roles will run without any trouble. This happens because we are using new IBM technology with EXT Kernels, so it will not allow SAPOSCOL to reside in single level store (SLS), instead of put it to Teraspace. In this situation it’s obvious that if you run an EXT system with some other non-EXT systems, saposcol will run only in one system. To conquer this issue you need to upgrade to EXT Kernel for all SAP systems with latest patches. Then set proper authorization for SAPOSCOL file & directory as guided which will solve any problem related to SAP OS Collector.