Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Find Memory and activity from command output Post 303041747 by Varja on Tuesday 3rd of December 2019 04:33:37 PM
Old 12-03-2019
Find Memory and activity from command output

Hello -
I have a requirement to get the Memory(Xmx) and the activity name using it.

Sample input info :

Code:
1502       02:57 /bin/sh /opt/rather/bar/deploy/bar_run.sh
1545       02:57 java -Drather.repository=/opt/rather/bar/deploy/JobSyng_Barol_Count/JobSyng_Barol_Count/../lib -Xms1024M -Xmx2048M -cp .:/opt/rather/bar/deploy/JobSyng_Barol_Count/JobSyng_Barol_Count:/opt/rather/bar/deploy/JobSyng_Barol_Count/JobSyng_Barol_Count/../lib/routines.jar:/opt/rather/bar/deploy/JobSyng_Barol_Count/JobSyng_Barol_Count/../lib/advancedPersistentLookupLib-1.2.jar:/opt/rather/bar/deploy/JobSyng_Barol_Count/JobSyng_Barol_Count/../lib/rather_file_enhanced_20070724.jar:/opt/rather/bar/deploy/JobSyng_Barol_Count/JobSyng_Barol_Count/../lib/rathercsv.jar:/opt/rather/bar/deploy/JobSyng_Barol_Count/JobSyng_Barol_Count/../lib/trove.jar:/opt/rather/bar/deploy/JobSyng_Barol_Count/JobSyng_Barol_Count/JobSyng_Barol_count_0_1.jar: intlbar_tac.JobSyng_Barol_count_0_1.JobSyng_Barol_Count --context=Default
9738    03:05:12 java -Xms3002M -Xmx3002M -cp /opt/rather/raal/raal.jar com.aexp.raal.main.controller.raalMainController

Command running for the o/p:

Code:
ps -eo pid,etime,command | grep rather | egrep -sv "$$|bash|tail|cat|sshd|grep|less|more|su"

Result looking from it (or something similar/meaningful):
Code:
ActivityName1:  bar
Memory for ActivityName1:2048M
ActivityName2:  raal
Memory for ActivityName2:3002M

Few pointers :
All these are running under process: rather
The memory is looking under value "Xmx"
always the activity name is after "/opt/rather/"

Can someone help me on the code for me?

Thanks in adv.

Last edited by Varja; 12-03-2019 at 05:46 PM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

output of find command

Hi, I am confused about the output of find command. Please see the two find commands below. When i put "*.c" i get lots of files. But when i put *c only i get only one file. Any answer?? $ find . -name "*c" ./clarify/cheval/hp_server/rulemanager/rulemansvc... (3 Replies)
Discussion started by: shriashishpatil
3 Replies

2. Shell Programming and Scripting

hiding output from find command

when I do the find command from / , there are a lot of directories that I do not have access to and so I get "find: cannot open ..." How can I suppress these messages so only what was found is output. I was thinking on find / -name 'searchterm' | grep -v find but this doesnt work ... (5 Replies)
Discussion started by: JamesByars
5 Replies

3. Shell Programming and Scripting

Incorrect output using find command

I'm using the below command to list files older than 2 hours but it returns redundant output, am I missing something. # find . -mmin +120 -exec ls -l {} \; total 0 -rw-r--r-- 1 root system 0 Oct 13 09:52 test1 -rw-r--r-- 1 root system 0 Oct 13 09:52 test2 -rw-r--r-- 1 root ... (5 Replies)
Discussion started by: mbak
5 Replies

4. UNIX for Dummies Questions & Answers

problem with output of find command being input to basename command...

Hi, I am triying to make sure that there exists only one file with the pattern abc* in path /path/. This directory is having many huge files. If there is only one file then I have to take its complete name only to use furter in my script. I am planning to do like this: if ; then... (2 Replies)
Discussion started by: new_learner
2 Replies

5. AIX

Command to find TOP 5 Memory consuming process

HI All, Can anyone send me a command to find TOP 5 Memory consuming process. It would be lelpful if I get output something like below processname - pid - memory(in MB) - command I tried few commands from the internet but the result only give the real memory usage or pagging, I want total... (4 Replies)
Discussion started by: bce_groups
4 Replies

6. Shell Programming and Scripting

Command to find the Memory and CPU utilization using 'top' command

Hi all, I found like top command could be used to find the Memory and CPU utilization. But i want to know how to find the Memory and CPU utilization for a particular user using top command. Thanks in advance. Thanks, Ananthi.U (2 Replies)
Discussion started by: ananthi_ku
2 Replies

7. Shell Programming and Scripting

Wrong output in find command

Hi guys - I am trying a small script to tell me if there is a file that exists less than 1k. It should report ERROR, otherwise the check is good. I wrote this script down, however it never runs in the if/then statement. It always returns the echo ERROR. MYSIZE=$(find /home/student/dir1... (8 Replies)
Discussion started by: DallasT
8 Replies

8. Shell Programming and Scripting

indication of find activity - bash script

Hi All, I wanted to show on stdout that a file was found right after it happens due to indicate the activity of long search. Further more I want to store the result of the find in a file. I have tried this: echo -n "Searching" find . -name Makefile -type f -print -exec echo -n "." \; >... (16 Replies)
Discussion started by: vercsab
16 Replies

9. Red Hat

How to find memory taken by a process using top command?

I wanted to know how to find the memory taken by a process using top command. The output of the top command is as follows as an example: Mem: 13333364k total, 13238904k used, 94460k free, 623640k buffers Swap: 25165816k total, 112k used, 25165704k free, 4572904k cached PID USER ... (6 Replies)
Discussion started by: RHCE
6 Replies
wcadmin(1M)						  System Administration Commands					       wcadmin(1M)

NAME
wcadmin - manage the configuration of the Sun Java Web Console SYNOPSIS
/usr/sbin/wcadmin subcommand options /usr/sbin/wcadmin [-h| --help] /usr/sbin/wcadmin [-V | --version] DESCRIPTION
wcadmin is a Command Line Interface (CLI) -- based tool for managing the configuration of the Sun Java Web Console. SUBCOMMANDS
The following subcommands are supported: add The wcadmin add subcommand adds a new shared jar file, a new JAAS login module, or a new shared service property to the console configuration. An optional identifier may be specified; if omitted, the identifier is derived from the resource name. The resource is added when the console is next started. The format of the add subcommand is: add -l -a appname [-n id] jarpath add -m -a appname [-n id] -b behavior -s service [-o name=value] classname add -p -a appname name=value [... name=value] deploy The wcadmin deploy subcommand deploys the specified web application into the console's web server instance. Applications are deployed directly from their installation directories. The format of the deploy subcommand is: deploy [-D] -a appname -x context app_path disable The wcadmin disable subcommand disables access to the specified web application in the console's web server instance. The format of the disable subcommand is: disable -x context enable The wcadmin enable subcommand enables access to the specified web application in the console's web server instance. The format of the enable subcommand is: enable -x context list The wcadmin list subcommand lists the resources currently configured for the console; including deployed web applications, shared jar files, login modules, and shared service properties. If no option is specified, all resources are listed. The format of the list subcommand is: list [-a] [-d] [-l] [-m] [-p] password The wcadmin password subcommand manages the administrator and security keystore passwords for the console. Keystore passwords should not be changed while the console is running. The format of the password subcommand is: password [-a] [-k] [-t] password -f password_file reload The wcadmin reload subcommand unloads the specified web application from the console's web server instance and reloads the application from its original installation directory. The format of the reload subcommand is: reload -x context remove The wcadmin remove subcommand removes a shared jar file, a login module, or a shared service property from the console configu- ration. The resource may be specified by its identifier or by its full jarpath or classname. The resource is removed when the console is next started. The format of the remove subcommand is: remove -l -a appname [-n id] jarpath remove -m -a appname [-n id] classname remove -p -a appname property [...] undeploy The wcadmin undeploy subcommand undeploys the specified web application from the console's web server instance. The format of the undeploy subcommand is: undeploy [-D] -a appname -x context OPTIONS
The following options are supported: -h | --help | -? Display runtime help. -V | --version Display console version information. -D | --defer When used with the deploy and undeploy subcommands, defers the deployment or undeployment until the next console restart. The operation is deferred by simply adding or removing the corresponding resource registration notifica- tion file. If defer is not specified, a runtime deployment or undeployment is performed, so that the application becomes available or unavailable in the running console. If the console instance is not currently running, the operation is automatically deferred. -a | --adminpassword Specify that the administrator password should be changed, when used with password subcommand. You are prompted for a new password, which must be 8 to 32 characters. -a | --application Specify the application name, when used with subcommands other than password subcommand. -d | --detail Specify that configuration details of each resource should be displayed. -f Specify the fully qualified path name to a file containing one or more password property values. See the descrip- tion of the password_file argument. -k | --keypassword Specify that the keystore password should be changed. You are prompted for a new password, which must be 8 to 32 characters. -l | --library Specify that the resource is a shared jar file. -m | --module Specify that the resource is a JAAS login module. -n | --name Specify the short-hand identifier name for the resource. If omitted, the identifier name is derived from the full resource name. -o | --option Specify the name and value of a login module option property, separated by the equals character. -p | --property Specify that the resource is one or more shared service properties. -s | --service Specify the name of the JAAS login service definition. If omitted, the default console login service definition is assumed. -t | --trustpassword Specify that the truststore password should be changed. You are prompted for a new password, which must be 8 to 32 characters. -x | --context Specify the web application context path name under which the application is deployed. ARGUMENTS
app_path The fully qualified file system path to the web application installation directory. appname The application name. The name must be unique among all web applications registered with the console. It is also used as the name of the subdirectory under the console's pre-registration directory which contains all the resource registration notification files for that application. Typically, the application package name, plugin identifier, or context path name is specified for the application name. behavior The JAAS login module control flag behavior. Must be one of "optional", "required", "requisite", or "sufficient". classname The fully qualified Java package class name of the JAAS login module. The specified class must be included in a shared jar file added to the console. context The web application context path name under which the application is deployed. With the .reg suffix, the context forms the file name of the registration notification file for that application. id The short-hand identifier name for a jar file or login module resource to be added or removed. The identifier name must be unique among the resources shared for a given application name. With the .reg suffix, it forms the file name of the regis- tration notfication file for that resource. jarpath The fully qualified file system path to the jar file resource. When the resource is added to the console, its path is included in the classpath of the console's shared class loader. option The JAAS login module option property name. property The shared service property name. password_file The fully qualified path to a password text file that contains the new administrator, keystore, and truststore passwords in property file format. The administrator password is specified using the "adminpassword" property. The keystore password is specified using the "keypassword" property. The truststore password is specified using the "trustpasswd" property. At least one password property must be contained in the password file. value The login module option or shared service property value. If the value contains white space, it must be quoted. EXAMPLES
The following command adds a jar file to be shared in the console: wcadmin add -l -a myapp_1.0 -n wbem /usr/sadm/lib/wbem.jar The following command deploys a new web application: wcadmin deploy -a myapp_1.0 -x myapp /opt/SUNWmyapp/myapp The following command reloads an existing web application: wcadmin reload -x myapp The following command undeploys a web application at the next server restart: wcadmin undeploy -D -a myapp_1.0 -x myapp The following command lists all the deployed web applications in the console. If the status field is "running", the web application is available. If the status field is "stopped", the web application is disabled and is not available. If all web applications are "stopped", this typically indicates the console web server instance is not running. wcadmin list -a The following command removes a shared jar file: wcadmin remove -l -a myapp_1.0 -n wbem The following command changes passwords that are specified in a file: wcadmin password -f /home/mydir/console-passwords EXIT STATUS
The following exit values are returned: 0 Subcommand succeeded without error 1 Usage error: missing or malformed arguments 2 Fatal error: subcommand failed with one or more errors ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWmcon | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ SEE ALSO
smcwebserver(1M), smreg(1M), attributes(5), environ(5) SunOS 5.11 22 Aug 2006 wcadmin(1M)
All times are GMT -4. The time now is 11:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy