Sponsored Content
Full Discussion: Customizing ps command
Top Forums Shell Programming and Scripting Customizing ps command Post 302895120 by ratheeshjulk on Friday 28th of March 2014 02:07:08 PM
Old 03-28-2014
[Solved] Customizing ps command

Hi,
I want to monitor our batch jobs at a specific interval for later analysis to see the performance and CPU utilization
Code:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
 ps aux|grep dsadm|head
xxxxx   386  0.0  0.0 103524 15448 pts/0    S    Mar27   0:00 /etrade/home/dsadm/sqllib/bin/db2bp 28075A14861 5 A
dsadm     1339  0.0  0.0  24780  1696 ?        Ss   Mar13   0:00 dscs 4 0 0
dsadm     1351  0.0  0.0 158212 37128 ?        Ss   Mar13   0:00 dsapi_slave 7 6 0
xxxxxx  1911  0.0  0.0 103780 15800 pts/5    S    13:04   0:00 /etrade/home/dsadm/sqllib/bin/db2bp 24828A14861 5 A
dsadm     2721  0.0  0.0  24804  1752 ?        Ss   Mar19   0:00 dscs 4 0 0
dsadm     2722  0.0  0.0 158548 38036 ?        Ss   Mar19   0:02 dsapi_slave 7 6 0
dsadm     7298  0.0  0.0  11848  3520 ?        S    Mar23   0:08 /bin/ksh /etrade/prd/dsadm/batch/uscrm/prod/run//DCM/dcm_canary.ksh -project_code DCM -exec_mode PROD -run_date 20140316 -process_name DW_DCM_LOAD -hbinterval 5 -jobname DWDCM01LD
dsadm     7332  0.0  0.0  10924  2556 ?        S    Mar23   0:02 /bin/ksh /etrade/prd/dsadm/batch/uscrm/prod/run/DCM/dcm_load.ksh -project_code DCM -exec_mode PROD -run_date 20140316 -process_name DW_DCM_LOAD -hbinterval 5 -jobname DWDCM01LD
dsadm    10724  0.0  0.0  24780  1688 ?        Ss   Mar13   0:00 dscs 4 0 0
dsadm    10725  0.0  0.0 158924 38284 ?        Ss   Mar13   0:25 dsapi_slave 7 6 0



From which i can later identify the CPU and memory utilization etc.
But couldnt figure out a way to print the parent id in this output

Code:
ps -eo command,user,pid,ppid

i have this command to get the parent id also. but here i cant display the any of the performance parameter's. Is there a way to print both PID hierarchy and various performance factors for each process

Last edited by ratheeshjulk; 03-28-2014 at 03:31 PM.. Reason: few userid masked
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

customizing xterm windows

Does anyone now how to customize an xterm window in solaris to dynamically 'pwd' in the banner. I know how to launch with xterm -n 'cwd' but it does not change when I change dir's. (4 Replies)
Discussion started by: toddy44
4 Replies

2. UNIX for Dummies Questions & Answers

Customizing CDE background

i have a question about setting the background in a workspace in CDE. I have CDE runnning on Solaris 8 here at work and I want to use some images I have as the background in or two of the workspaces. When I use xv on the image and choose the option the option from the Display Menu -> Root:... (1 Reply)
Discussion started by: Kanu77
1 Replies

3. Shell Programming and Scripting

customizing desktop

I need help editing my openwin file. I've got it all set up so the options I normally use (xman, cmdtools, xeyes, printtool) automatically come up when I log on, but it won't read my -geometry entries. I got them by right-clicking on the desktop, but apparently they need to be entered a certain... (0 Replies)
Discussion started by: sdienlin
0 Replies

4. Red Hat

Customizing RHEL OS

Hello Every One, I am not sure if this is the correct forum to post this question. But please help me with your ideas. I have got a work (proj) where i need to customize the RHEL OS . This would involve building packages, installing them , correcting privileges etc and all these... (4 Replies)
Discussion started by: shirsha
4 Replies

5. UNIX for Dummies Questions & Answers

Customizing UNIX

Hello i'm just wondering how to customize the color of unix's (or SSH) background, cursor, and letter? Thank you for your time (4 Replies)
Discussion started by: mgyeah
4 Replies

6. UNIX for Dummies Questions & Answers

Customizing from address in mailx command

Currently I am using mailx command for sending mails. But the mail is sent as from userid@servername by default. Is it possible to customise the from mail address in mailx command? Thanks (2 Replies)
Discussion started by: pandeesh
2 Replies

7. UNIX for Dummies Questions & Answers

customizing default file permission

By default, the files are creates with this permissions:-rw-rw-r-- Is it possible to customize that in such away that ,always created as 777. Where i need to make changes? Please guide me. Thanks (2 Replies)
Discussion started by: pandeesh
2 Replies

8. Red Hat

RHEL6 customizing prompt do not work

Hi, I'm trying to customize the ksh prompt for users on a RHEL 6.6 system for having user@host pwd : $ and user@host pwd # in red color for root. I think it's possible but i do not even succeded for a non root user : I added in my ~/.kshrc : PS1="Hello : " and it works but when i... (4 Replies)
Discussion started by: Fundix
4 Replies

9. UNIX for Advanced & Expert Users

Customizing bash on AIX

AIX is really different from most distros I am used to. I am trying to set up my .bashrc so I did this in the file. I noticed when I ssh into the server or use the bash command for a new shell it was being ignored. #------------------------------------------------------------- # Source global... (2 Replies)
Discussion started by: cokedude
2 Replies
getusershell(3C)					   Standard C Library Functions 					  getusershell(3C)

NAME
getusershell, setusershell, endusershell - get legal user shells SYNOPSIS
#include <unistd.h> char *getusershell(void); void setusershell(void); void endusershell(void); DESCRIPTION
The getusershell() function returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If /etc/shells does not exist, the following locations of the standard system shells are used in its place: /bin/bash /bin/csh /bin/jsh /bin/ksh /bin/pfcsh /bin/pfksh /bin/pfsh /bin/sh /bin/tcsh /bin/zsh /sbin/jsh /sbin/pfsh /sbin/sh /usr/bin/bash /usr/bin/csh /usr/bin/jsh /usr/bin/ksh /usr/bin/pfcsh /usr/bin/pfksh /usr/bin/pfsh /usr/bin/sh /usr/bin/tcsh /usr/bin/zsh /usr/xpg4/bin/sh The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells. The setusershell() function rewinds the file or the list. The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells. RETURN VALUES
The getusershell() function returns a null pointer on EOF. BUGS
All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved. SunOS 5.10 30 Aug 2004 getusershell(3C)
All times are GMT -4. The time now is 11:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy