HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: process monitoring
Operating System - HP-UX
1834772
Members
3309
Online
110070
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
11-22-2002 11:18 AM
11-22-2002 11:18 AM
process monitoring
Hi All,
does anyone have a script to share that does process monitoring for applications. we have a application running and unfortunately one of the processes died today and noone knoew about it. Any help is greatly appreciated and points will be assigned.
does anyone have a script to share that does process monitoring for applications. we have a application running and unfortunately one of the processes died today and noone knoew about it. Any help is greatly appreciated and points will be assigned.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 11:25 AM
11-22-2002 11:25 AM
Re: process monitoring
I guess you could do something like this:
#!/usr/bin/sh
PROCS="proc1 proc2 proc3 proc4 proc5"
for PROCNAME in $PROCS
do
NUMPROC=`ps -ef | grep $PROCNAME | grep -v grep | wc -l`
if [ $NUMPROC != whatever_number_there_should_be ] then
mailx -s "$PROCNAME isn't running" somemail@co.com < "$PROCNAME isn't running right now. you might want to fix it."
fi
done
Or something to that effect.
Note: That script is in no way guaranteed to work. It's off the cuff and is inteded only as an example to guide you in writing your own.
#!/usr/bin/sh
PROCS="proc1 proc2 proc3 proc4 proc5"
for PROCNAME in $PROCS
do
NUMPROC=`ps -ef | grep $PROCNAME | grep -v grep | wc -l`
if [ $NUMPROC != whatever_number_there_should_be ] then
mailx -s "$PROCNAME isn't running" somemail@co.com < "$PROCNAME isn't running right now. you might want to fix it."
fi
done
Or something to that effect.
Note: That script is in no way guaranteed to work. It's off the cuff and is inteded only as an example to guide you in writing your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 11:47 AM
11-22-2002 11:47 AM
Re: process monitoring
Especially the grep in the ps -ef output is not reliable... imagine a user having a "more swagentd.log" running... the monitor would accept this as a running swagentd. :)
This is somewhat more reliable:
NUMPROC=$(UNIX95= ps -o pid= -C "$PROCNAME" | wc -l)
Best regards...
Dietmar.
This is somewhat more reliable:
NUMPROC=$(UNIX95= ps -o pid= -C "$PROCNAME" | wc -l)
Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 12:01 PM
11-22-2002 12:01 PM
Re: process monitoring
If you have ITO, there are several scripts available as process monitors, such as vp_chk.sh, ds_chk.sh. You could start with vp_chk.sh and modify it to your needs. (We modifed the "ps -e" to "ps -ef" to better pinpoint the processes we were interested in.)
HTH
Marty
HTH
Marty
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP