- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- scripting 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
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
03-01-2006 10:22 PM
03-01-2006 10:22 PM
scripting problem
for i in 1 3 5 6 7 8 ; do
if [ `bdf /dev/vg00/lvol$i | awk {'print$5'} | cut -c 1,2 | tail -1` -gt 85 ]; t
hen
bdf /dev/vg00/lvol$i | awk {'print$5,$6'} > /root/detail.txt
mail fsalerts@telenor.com.pk < /root/detail.txt
fi
done
Now I want same alert via SMS but I can't understand who I fulfill the format of SMSC server, required format is like that;
[SMS]
TO=00923455001008
FROM=Shah Fuzail
Text=FS status
How can I fetch the critical file system notification from the existing script and cascade it with the SMS format file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 10:37 PM
03-01-2006 10:37 PM
Re: scripting problem
echo "[SMS]" > sms.file
echo "TO=00923455001008" >> sms.file
echo "FROM=Shah Fuzail" >> sms.file
echo "text=`cat /root/detail.txt`" >> sms.file
Would generate a file of that format.
Is this what you are after?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 10:41 PM
03-01-2006 10:41 PM
Re: scripting problem
xargs to have the Text on one line.
Is this what you mean/need?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 10:43 PM
03-01-2006 10:43 PM
Re: scripting problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 11:01 PM
03-01-2006 11:01 PM
Re: scripting problem
I have created a procedure which fulfill my requirement and it work like that;
create file test1 (contained SMSC required format)
create file test2 (contained text of File system alert)
1) cat test1 > smstest
2) cat test2 >> smstest
above procedure is giving me the required output, now I just need to call procedure in my exixting script to call this procedure everytime when file system exceed it limit and generate email message simutanously call SMS test procdure and execute it.
BR
Shah Fuzail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 11:13 PM
03-01-2006 11:13 PM
Re: scripting problem
call your procedure just after your existing mail command.
Then issue your SMS mail command with the smstest file as input.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 11:32 PM
03-01-2006 11:32 PM
Re: scripting problem
I have no idea how procedure call in unix scripting.
Thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 11:38 PM
03-01-2006 11:38 PM
Re: scripting problem
for example:
test1()
{
echo "hello"
}
echo "1"
test1
echo "2"
When run produces:
1
hello
2
Hope this answer helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 11:46 PM
03-01-2006 11:46 PM
Re: scripting problem
for i in 1 3 5 6 7 8 ; do
if [ `bdf /dev/vg00/lvol$i | awk {'print$5'} | cut -c 1,2 | tail -1` -gt 85 ]; t
hen
bdf /dev/vg00/lvol$i | awk {'print$5,$6'} > /root/detail.txt
mail fsalerts@telenor.com.pk < /root/detail.txt
fi
done
I want to call my procedure in between the above script, means just after the detail.txt file creation.
Thnx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 11:53 PM
03-01-2006 11:53 PM
Re: scripting problem
no problem.
yourproc()
{
#This is were you place your code
}
for i in 1 3 5 6 7 8 ; do
if [ `bdf /dev/vg00/lvol$i | awk {'print$5'} | cut -c 1,2 | tail -1` -gt 85 ]; t
hen
bdf /dev/vg00/lvol$i | awk {'print$5,$6'} > /root/detail.txt
yourproc
mail fsalerts@telenor.com.pk < /root/detail.txt
fi
done
If you are happy with the answer, please have a look at
http://forums1.itrc.hp.com/service/forums/helptips.do?#28
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2006 12:08 AM
03-02-2006 12:08 AM
Re: scripting problem
Now it's working
BR
Shah
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2006 12:12 AM
03-02-2006 12:12 AM
Re: scripting problem
Now me script is working perfect.
Best regards,
Shah Fuzail Ahmed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2006 12:20 AM
03-02-2006 12:20 AM
Re: scripting problem
sorry to see none of my answers helped.
http://forums1.itrc.hp.com/service/forums/helptips.do?#28