- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Need to have Mail alerts for Service being Stopped
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
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
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
05-22-2015 12:18 PM - last edited on 05-24-2015 10:22 PM by Maiko-I
05-22-2015 12:18 PM - last edited on 05-24-2015 10:22 PM by Maiko-I
Need to have Mail alerts for Service being Stopped
Hi,
For Example , if my cron service is stopped on server , i want mail alert for same in my mailbox
can anyone help me with how to configure the same
P.S. This thread has been moved from General to HP-UX > sysadmin. - Hp Forum Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2015 07:11 PM - edited 05-24-2015 07:13 PM
05-24-2015 07:11 PM - edited 05-24-2015 07:13 PM
Re: Need to have Mail alerts for Service being Stopped
I have attached a general purpose script called adminalert.sh which has several features including monitoring processes by name. Save it in a scripts directory, make it executable and then run it one time with -c. It will create a commented config file in /etc/adminalert.config like this:
EMAILFREQ=60
EMAIL=somebody1@mycompany.com
EMAILFROM=root@mycompany.com
LogFile=true
LoadAlert=0 # Default = 0, change to 1 to enable
LOADLIMIT=2.0
DiskFull=0 # Default = 0, change to 1 to enable
MOUNTS=/:90,/opt:85,/tmp:90,/var:90
NFSalert=0 # Default = 0, change to 1 to enable
NFSWAITSECS=3
NFSMOUNTS=/mnt1,/mnt2
PingTest=0 # Default = 0, change to 1 to enable
PINGHOSTS=yoda:4,skywalker,jaba:2:3:20:true,mycon2:4:4:40:false
ProcMon=0 # Default = 0, change to 1 to enable
PROCS=http:2:16,cron,lvmkd:4
UserLockCheck=0
LOCKED=root,admin,lp,www,oracle,sapuser,dba
Now edit /etc/adminalert.config and change these lines:
EMAILFREQ = minutes between the same message
EMAIL = destination email address. Multiple addresses separated by commas, no spaces
EMAILFROM = a valid reply address to bypass spam filters
EMAILFREQ=60
EMAIL=somebody1@mycompany.com
EMAILFROM=root@mycompany.com
The variable called ProcMon enables process monitoring.
ProcMon=1
PROCS=cron:1:1
The cron:1:1 entry means that one and only one copy of cron must be running.
Then start this script from a terminal session that will never finish (can't use cron to monitor cron):
# while : do /usr/contrib/bin/adminalert.sh sleep 30 done
If cron is disappearing, you may have a very old version that needs a patch.
Or something run by root is killing the cron process.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2015 03:37 AM - edited 05-27-2015 04:10 AM
05-27-2015 03:37 AM - edited 05-27-2015 04:10 AM
Re: Need to have Mail alerts for Service being Stopped
Hi Bill ,
Its an excellent script.
But somehow its not running for one of my process .
ps -ef |grep -i str F0004
test 28899 1 0 13:31:02 pts/3 0:00 str F0004
rte 28254 1 0 May 21 ? 0:01 str F0004
dfr 3509 16295 1 15:58:12 pts/0 0:00 grep -i F0004
ddk17349 1 0 May 21 ? 0:04 str F0004
when am mentioning ;
ProcMon=1
PROCS=F0004:1:2
Where do i put second argument "str" ??