- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- shell script or ? to find all processes that have ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 08:55 AM
09-29-2004 08:55 AM
shell script or ? to find all processes that have used 100% of cpu for more than 2 hours
We have oracle apps environment, have noticed from time to time the f60webmx jobs which are basically oracle forms processes going to a runaway state consuming 100% of a cpu. Is there anyway to write a script or ? that would detect these processes and alert us.
Thank you for input,it is truly appreciated.
wvsa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 09:00 AM
09-29-2004 09:00 AM
Re: shell script or ? to find all processes that have used 100% of cpu for more than 2 hours
Thanks
Prashant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 09:10 AM
09-29-2004 09:10 AM
Re: shell script or ? to find all processes that have used 100% of cpu for more than 2 hours
The best way is to configure 'alarmdef' of measureware and get alerted on it. It does a good job of keeping track of the history as well reporting.
Otherway is to use the grand old 'ps' and gather the data. For ex.,
UNIX95= ps -C "sshd" -o "pcpu args" |sort -n
Should give you the %utilization of the process sshd. You can take samples of these utilizations for every 15 mins or so and keep track of processes that are at 100% and report them after 2 hours. Bit scripting is involved but that's not difficult to write.
You can specify multiple processes with -C option such as -C "sshd,inetd' etc.,
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2004 09:21 AM
09-29-2004 09:21 AM
Re: shell script or ? to find all processes that have used 100% of cpu for more than 2 hours
It is relatively easy and accurate to implement this using Measureware alarmgen.
Do you have measureware agent installed in the system ? -
If you do
1) # vi /var/opt/perf/alarmdef
threshold=100
PROCESS LOOP
{
if (PROC_PROC_NAME == "f60webmx") then
{
if (PROC_CPU_TOTAL_TIME > 7200) and (PROC_CPU_TOTAL_UTIL_CUM > 100) then
{
exec "/usr/local/bin/run-away.ksh", PROC_PROC_ID
}
}
}
#
Create the script /usr/local/bin/run-away.sh and process the PID provided as the command line parameter to the script.
Once the script is ready, you need to restart the MWA alarmgen
# mwa restart alarmgen
You might have to do some tweaking to the measureware alarm definition.
- Sundar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2004 06:25 AM
09-30-2004 06:25 AM
Re: shell script or ? to find all processes that have used 100% of cpu for more than 2 hours
Thank you for your response, going to test first by using mailx to mail the procid to me.
Thanks to all who responded
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2004 06:42 AM
09-30-2004 06:42 AM
Re: shell script or ? to find all processes that have used 100% of cpu for more than 2 hours
Sorry, there are couple of blunders in my post...
1) # vi /var/opt/perf/alarmdef
threshold=100
PROCESS LOOP
{
if (PROC_PROC_NAME == "f60webmx") then
{
if (PROC_CPU_TOTAL_TIME > 7200) and (PROC_CPU_TOTAL_UTIL_CUM >= threshold) then
{
exec "/usr/local/bin/run-away.ksh", PROC_PROC_ID
}
}
}
#
and
# mwa restart alarm
Good luck :-)
- Sundar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2004 07:01 AM
09-30-2004 07:01 AM
Re: shell script or ? to find all processes that have used 100% of cpu for more than 2 hours
Thanks for getting back to me and pointing out the modification.
wvsa