- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- bizzare script problem
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
Discussions
Forums
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
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
тАО08-16-2001 09:47 AM
тАО08-16-2001 09:47 AM
| /bin/notify
to send all emails through this script.
in the script notify I have this
awk '{print $0}' > /tmp/mailfile
grep -i critical /tmp/mailtmpfile > /dev/null
if [[ $? -eq 0 ]];then
echo $SNA `arraydsp -a $SNA |egrep '(Overall State of Array)' |awk -F= '{print $
2}'` > /tmp/STATE
SNA is the serial numbers for the arrays..the arraydsp statement either comes back READY, or WARNING..
when I run this script by sending an email with CRITICAL in the message, $SNA is printed in /tmp/STATE, but the arraydsp statement is NOT..HOWEVER, if I comment out the first awk statement and put critical into /tmp/mailtmpfile and run the script from the command line, it works, both the SN and READY are in /tmp/STATE.
Any ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2001 10:06 AM
тАО08-16-2001 10:06 AM
Re: bizzare script problem
...jcd...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2001 10:22 AM
тАО08-16-2001 10:22 AM
Re: bizzare script problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2001 10:24 AM
тАО08-16-2001 10:24 AM
Re: bizzare script problem
Try some debugging like this
STATE=`arraydsp -a $SNA |egrep '(Overall State of Array)' |awk -F= '{print $2}'`
printf $STATE $SNA \n >> /tmp/state
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2001 10:36 AM
тАО08-16-2001 10:36 AM
Re: bizzare script problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2001 10:45 AM
тАО08-16-2001 10:45 AM
Re: bizzare script problem
I had a cronjob that kept failing because it never used /etc/profile or $HOME/.profile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2001 10:48 AM
тАО08-16-2001 10:48 AM
Re: bizzare script problem
Try to enliminate certain vaibles
env > /tmp/test.dat
echo $SNA >> /tmp/test.dat
arr=`arraydsp -a realnumber`
echo $arr >> /tmp/test.dat
Also, the script may not be translating the $SNA in the ``. I would try it like ${SNA}
...jcd...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2001 11:18 AM
тАО08-16-2001 11:18 AM
Re: bizzare script problem
#!/usr/bin/ksh
export SNA=00000120AEFD
awk '{print $0}' > /tmp/mails
grep -i critical /tmp/mails
if [[ $? -eq 0 ]];then
arr=`/opt/hparray/bin/arraydsp -a 0000120AEFD`
env > /tmp/test.dat
echo $SNA >>/tmp/test.dat
echo $arr >>/tmp/test.dat
fi
this is /tmp/test.dat
_=/usr/bin/env
AGENT=sendmail
SNA=00000120AEFD
PWD=/
TZ=MST7MDT
00000120AEFD
With a blank space at the bottom. Why does it have the Serial # 00000120AEFD at the end too?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2001 01:01 PM
тАО08-16-2001 01:01 PM
Re: bizzare script problem
GOOD LUCK
...jcd...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2001 01:47 PM
тАО08-16-2001 01:47 PM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2001 04:26 PM
тАО08-17-2001 04:26 PM
Re: bizzare script problem
I set the script to setuid root, and it worked, so I realized that through the email, the script was not getting executed as root. I thought it would because it was root's .forward file executing the script. I still don't quite understand what sendmail definition of insecure operations means.