- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Email notification for Service Guard package
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
06-09-2006 12:26 AM
06-09-2006 12:26 AM
Email notification for Service Guard package
Thanks in advance for your help.
We recently had Service Guard implemented on two of our servers. The Engineer wrote a small script to send an email notification when a package is disabled, but we are not receiving the email when I disable the package and run the script to check for the disabled package.
Here's the script that was written.
export SAGPAGER="1234567@skytel.com"
export SAGMAIL="gerald.townes@cancer.org"
export SAGMAIL1="ken.lu@cancer.org"
TEST=`cmviewcl | grep nholwsn1 | grep up | grep running | grep disabled | wc -l`
if [ "$TEST" -gt "0" ]
then
for J in `cmviewcl | grep nholwsn1 | grep disabled | awk '{print $1}'`
do
PKG=$J
DATE=`date +%Y.%m.%d`
TIME=`date +%Xgmt`
MSG="$PKG is disabled on $SVR-$DATE-$TIME"
echo $MSG
#echo $MSG | mail $SAGPAGER
echo $MSG > /tmp/MSGFILE1
mailx -s `hostname` $SAGMAIL < /tmp/MSGFILE1
mailx -s `hostname` $SAGMAIL1 < /tmp/MSGFILE1
rm /tmp/MSGFILE1
done
fi
Is there something missing in the script, or do I need to configure something somewhere else?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 12:48 AM
06-09-2006 12:48 AM
Re: Email notification for Service Guard package
Execute the script with option,
# sh -x ./script_name
and view the execution to fine,
rgs,
ran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 12:51 AM
06-09-2006 12:51 AM
Re: Email notification for Service Guard package
Have you tested if mail is working?
Test:
sendmail -v 1234567@skytel.com
test
.
The dot is needed on the next line.
Darrel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 01:21 AM
06-09-2006 01:21 AM
Re: Email notification for Service Guard package
I ran the sh -x on the script and tested sendmail.
Here's the output.
root@nholaw1:/usr/local/bin>sh -x ./checkcl.ksh
+ export SAGPAGER=1234567@skytel.com
+ export SAGMAIL=gerald.townes@cancer.org
+ export SAGMAIL1=ken.lu@cancer.org
+ + cmviewcl
+ grep nholwsn1
+ grep up
+ grep running
+ grep disabled
+ wc -l
TEST=1
+ [ 1 -gt 0 ]
+ cmviewcl
+ grep nholwsn1
+ grep disabled
+ awk {print $1}
+ PKG=nholwsn1
+ + date +%Y.%m.%d
DATE=2006.06.09
+ + date +%Xgmt
TIME=09:13:58gmt
+ MSG=nholwsn1 is disabled on -2006.06.09-09:13:58gmt
+ echo nholwsn1 is disabled on -2006.06.09-09:13:58gmt
nholwsn1 is disabled on -2006.06.09-09:13:58gmt
+ echo nholwsn1 is disabled on -2006.06.09-09:13:58gmt
+ 1> /tmp/MSGFILE1
+ hostname
+ mailx -s nholaw1 gerald.townes@cancer.org
+ 0< /tmp/MSGFILE1
+ hostname
+ mailx -s nholaw1 ken.lu@cancer.org
+ 0< /tmp/MSGFILE1
+ rm /tmp/MSGFILE1
root@nholaw1:/usr/local/bin>
root@nholaw1:/root>sendmail -v gerald.townes@cancer.org
test
.
gerald.townes@cancer.org... Connecting to mail.cancer.org. via esmtp...
220 SMTP Proxy Server Ready
>>> EHLO nholaw1.cancer.org
250-ESMTP Server Ready
250-SIZE 31457280
250 DSN
>>> MAIL From:
250 +OK Sender OK
>>> RCPT To:
250 +OK Recipient OK
>>> DATA
354 Start mail input, end with "
>>> .
250 +OK message queued for delivery.
gerald.townes@cancer.org... Sent (+OK message queued for delivery.)
Closing connection to mail.cancer.org.
>>> QUIT
221 Service closing transmission channel closing connection
root@nholaw1:/root>
It looks like the mail is going out successfully, but I'm not receving the email. Perhaps it is being blocked by our
mail server. I will have to confirm this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 01:55 AM
06-09-2006 01:55 AM
Re: Email notification for Service Guard package
What's the output of the following command:
# mailq
Do you see any error messages in your mail.log file.
Darrel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 03:45 AM
06-09-2006 03:45 AM
Re: Email notification for Service Guard package
I figured what the problem was. I had a mail rule setup to receive all my root messages, which I completely forgot about.
Thanks for all your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 03:51 AM
06-09-2006 03:51 AM