- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HPUX Monitoring Process
Operating System - HP-UX
1753500
Members
3510
Online
108794
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
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
тАО10-28-2009 09:14 AM
тАО10-28-2009 09:14 AM
HPUX Monitoring Process
Hi
I want to monitor a process every 15 minutes and that if this down notifies to me by mail. As he can help me in that?
Thanks
Yelmo
I want to monitor a process every 15 minutes and that if this down notifies to me by mail. As he can help me in that?
Thanks
Yelmo
- Tags:
- PS
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2009 09:30 AM
тАО10-28-2009 09:30 AM
Re: HPUX Monitoring Process
Hi:
Setup a crontask to run every 15-minutes. The task can be as simple as this:
#!/usr/bin/sh
NAME=cron
[ -z "$(UNIX95= ps -C ${NAME} -o pid=)" ] && mailx -s "${NAME} process is down!" yelmo@some.org < /dev/null
Substitute the _name_ of your process for 'NAME' in the script's first line.
Regards!
...JRF...
Setup a crontask to run every 15-minutes. The task can be as simple as this:
#!/usr/bin/sh
NAME=cron
[ -z "$(UNIX95= ps -C ${NAME} -o pid=)" ] && mailx -s "${NAME} process is down!" yelmo@some.org < /dev/null
Substitute the _name_ of your process for 'NAME' in the script's first line.
Regards!
...JRF...
- Tags:
- UNIX95
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2009 04:41 AM
тАО10-29-2009 04:41 AM
Re: HPUX Monitoring Process
Hi Yelmo,
You can use the script like below which is for monitoring the syslog daemon...
count=`ps -ef|grep -i syslogd | grep -v grep | wc -l`
if [ $count -eq 0 ]
then
echo "Process:syslogd not running" | mailx -s "process not running"
fi
if [ $count -gt 1 ]
then
echo "More than one instance of syslogd process is running" | mailx -s "More than one instance of process running"
fi
Thanks,
Ramkumar A.
You can use the script like below which is for monitoring the syslog daemon...
count=`ps -ef|grep -i syslogd | grep -v grep | wc -l`
if [ $count -eq 0 ]
then
echo "Process:syslogd not running" | mailx -s "process not running"
fi
if [ $count -gt 1 ]
then
echo "More than one instance of syslogd process is running" | mailx -s "More than one instance of process running"
fi
Thanks,
Ramkumar A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2009 04:51 AM
тАО10-29-2009 04:51 AM
Re: HPUX Monitoring Process
Hi (again) Yelmo:
The use of the UNIX95 (XPG4) behavior of 'ps' allows the '-C' to exactly match a process by its basename. The '-o pid=' tells 'ps' to return any matches with only the process ID and to skip producing a heading. In this case, we build a very simple string to evaulate.
Using 'grep' can lead to false matches.
The XPG4 (UNIX95) behavior should only be set for the duration of the command line. To do otherwise may have undesirable effects for other commands. The feature is resticted to the command line by writing "UNIX95= ps...". That is, "UNIX95="; a whitespace; and then the command without any semicolon.
Regards!
...JRF...
The use of the UNIX95 (XPG4) behavior of 'ps' allows the '-C
Using 'grep' can lead to false matches.
The XPG4 (UNIX95) behavior should only be set for the duration of the command line. To do otherwise may have undesirable effects for other commands. The feature is resticted to the command line by writing "UNIX95= ps...". That is, "UNIX95="; a whitespace; and then the command without any semicolon.
Regards!
...JRF...
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