08-08-2007
CPU usage and memory usage
Please tell me solaris functions/api for getting following information
1- Function that tells how much memory used by current process
2- Function that tells how much memory used by all running processes
3- Function that tells how much CPU is used by current process
4- Function that tells how much CPU is used by all running process.
Please tell me as soon as possible..
10 More Discussions You Might Find Interesting
1. Programming
how can i monitor usages of CPU, Memory, Hard disk etc. under SUN Solaries
through a c program or java program
i want to store that data into database so i can show it graphically
thanks in advance (2 Replies)
Discussion started by: Gajanad Bihani
2 Replies
2. UNIX for Dummies Questions & Answers
Is there a way for me to record cpu and memory usage over time without buying and installing new software? I know I can use top to see the current state, but can I record that data somehow? (2 Replies)
Discussion started by: cshih31
2 Replies
3. UNIX for Dummies Questions & Answers
Hi All,
Does anyone know what the best commands in the UNIX command line are for obtaining this info:
current CPU usage
memory usage
virtual memory usage
preferably with date and time parameters too?
thanks
ocelot (4 Replies)
Discussion started by: ocelot
4 Replies
4. HP-UX
how can I find cpu usage memory usage swap usage and
I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times
my final destination is monitor process
logical volume usage above X % and number of Logical voluage above
can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies
5. Solaris
Hi,
I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP.
I want the oids for above tasks.
can you please tell me that
Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies
6. UNIX for Dummies Questions & Answers
Can any one suggest me, how to get the last week's (Last n weeks) average CPU utilization and Memory usage? (2 Replies)
Discussion started by: siba.s.nayak
2 Replies
7. AIX
How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies
8. UNIX for Advanced & Expert Users
Hi all,
When you monitor the CPU and memory usage, how often do you do it ? Do it too often or too rarely will both cause the problem. So does anyone have hand-on experience ?
And for my case, the requirement says that when CPU usage is above X% or memory usage is above Y%, I should reject... (5 Replies)
Discussion started by: qiulang
5 Replies
9. Shell Programming and Scripting
what is the best way to get the memory and cpu usage of a process on any system?
this is relatively simple. however, i'm looking for a unified method that would work on linux, sunos, hpux, aix.
ps -ef | egrep myprocess | awk '{print $4}' ---> there could be several instances of 'myprocess'... (3 Replies)
Discussion started by: SkySmart
3 Replies
10. Shell Programming and Scripting
All
I am writing a script to generate an email when cpu and memory usage is high for 5 min continuously
help me urgent
I wrote below scritpt
LOAD=75.00
CPU_LOAD= 'sar -P all 300 5 |grep 'Average.all* '| awk -F " " '(print 100.0 -$NF)''
IF };
ECHO "pLEASE CHECK YOUR PROCESS ON YOUR... (1 Reply)
Discussion started by: anil529
1 Replies
LEARN ABOUT HPUX
cmpt_get
cmpt_change(3) Library Functions Manual cmpt_change(3)
NAME
cmpt_change(), cmpt_get() - set and get process' compartment
SYNOPSIS
Parameters
cid Compartment ID.
pid Process ID of the target process or for the calling process.
DESCRIPTION
The and functions query and manipulate the compartment of a process.
The function returns the given process' compartment ID. If is passed as the pid parameter, the compartment ID of the calling process is
returned.
The function changes the calling process' compartment ID to be the value of cid.
Security Restrictions
In order for the function to be effective, the calling process must possess the privilege. See privileges(5) for more information about
privileges.
RETURN VALUE
returns the following values:
Successful completion.
The function returns a valid compartment ID.
Function failed.
is set to indicate the error.
returns the following values:
Successful completion.
Function failed.
is set to indicate the error.
ERRORS
If any of the following conditions occur, the functions fail and set
Invalid compartment ID specified.
The function failed to allocate sufficient memory for its operation.
The process does not have the
privilege.
pid is not valid.
EXAMPLES
#include <errno.h>
#include <sys/cmpt.h>
main()
{
cmpt_t c = cmpt_getbyname("init");
if (cmpt_change(c) == -1 )
{
perror("could not enter init compartment");
exit(1);
}
printf("The process is now running in compartment %d
",
cmpt_get(0));
}
DEPENDENCIES
These functions are a part of the library.
SEE ALSO
cmpt_getbynum(3), cmpt_getbyname(3), compartments(4), compartments(5), privileges(5).
cmpt_change(3)