- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: shell script for tracking processes
Operating System - Linux
1753511
Members
5271
Online
108795
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
Discussions
Discussions
Forums
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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
тАО02-06-2006 12:03 PM
тАО02-06-2006 12:03 PM
Re: shell script for tracking processes
The -C option provides an exact process name match. So if you were looking for /usr/bin/vi, the command would be:
UNIX95= ps -f -C vi
and to store the results of the ps search:
MYSTATUS=$(UNIX95= ps -f -C vi)
echo $MYSTATUS
Be sure you do not put a pathname (ie, -C /usr/bin/vi) because that is not the process name. The process name is just the last part of a pathname.
Bill Hassell, sysadmin
UNIX95= ps -f -C vi
and to store the results of the ps search:
MYSTATUS=$(UNIX95= ps -f -C vi)
echo $MYSTATUS
Be sure you do not put a pathname (ie, -C /usr/bin/vi) because that is not the process name. The process name is just the last part of a pathname.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2006 06:59 PM
тАО02-06-2006 06:59 PM
Re: shell script for tracking processes
Hi,
check it out also
# ps -efx | grep
to see all parameters of a process running,
very useful with java processes.
Pablo
check it out also
# ps -efx | grep
to see all parameters of a process running,
very useful with java processes.
Pablo
share share share
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2006 08:05 PM
тАО02-06-2006 08:05 PM
Re: shell script for tracking processes
Shiv,
I agree with Bill. JRF's script is the most elegant and efficient because it does it all on one line.
Note:
Do not set the UNIX95 variable by default in /etc/profile, .profile or other profiles, unless you create a special user for this.
A VERY common gotcha is setting this variable by default. It interferes with SD/UX when you sh a patch depot, it triggers checksum failures.
I will admit that I fell victim to this very mistake some years ago.
SEP
I agree with Bill. JRF's script is the most elegant and efficient because it does it all on one line.
Note:
Do not set the UNIX95 variable by default in /etc/profile, .profile or other profiles, unless you create a special user for this.
A VERY common gotcha is setting this variable by default. It interferes with SD/UX when you sh a patch depot, it triggers checksum failures.
I will admit that I fell victim to this very mistake some years ago.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2006 08:12 PM
тАО02-06-2006 08:12 PM
Re: shell script for tracking processes
Hi,
This is great. I have got this working now. We have a stupid electronic invoicing system that send out emails. but it dies if it looses connection to the smtp server even for a second. don't ask why it can't wait..... p poor code....
anyway, I think i will run this in a start up script and monitor the process. Thanks for the warning on UNIX95. i think i will just run this as root, but set the variable in the script.
many thanks:-D
This is great. I have got this working now. We have a stupid electronic invoicing system that send out emails. but it dies if it looses connection to the smtp server even for a second. don't ask why it can't wait..... p poor code....
anyway, I think i will run this in a start up script and monitor the process. Thanks for the warning on UNIX95. i think i will just run this as root, but set the variable in the script.
many thanks:-D
- « Previous
-
- 1
- 2
- Next »
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP