- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Need a script for the below actions
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
10-14-2011 11:18 AM
10-14-2011 11:18 AM
Need a script for the below actions
Hi Gurus,
I need to develop a script for the below scenario.
My scripting skill is not so good..
I need to have a script for the below setup.
1 - check if /home/nullecte is defined in local /etc/auto_home
If no, send an alert ("/home/nullecte not defined on host ...") by email to :
sree@abc.com
and then, exit script
2 - check availability of node "nullecte"
If no, send an alert ("/home/nullecte not available from host ...") by email to :
sree@abc.com
and then, exit script
3 - check if there are differencies between
/etc/auto_home and /home/nullecte/TechD/ref/auto_home
If no -> nothing to do
If yes -> replace local /etc/auto_home by ref (/home/nullecte/TechD/ref/auto_home)
4 - check if there are differencies between
/etc/auto_home and /home/nullecte/TechD/ref/auto_home
If yes -> send an alert ("auto_home inconsistency on host ...") by email to :
sree@abc.com
could you please help me to get a script for this?
Many thanks in advance.
Rgds
Sree
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2011 11:50 AM
10-14-2011 11:50 AM
Re: Need a script for the below actions
@Sreer wrote:I need to develop a script for the below scenario.
My scripting skill is not so good..
I need to have a script for the below setup.
1 - check if /home/nullecte is defined in local /etc/auto_home
If no, send an alert ("/home/nullecte not defined on host ...") by email to :
sree@abc.com
and then, exit script2 - check availability of node "nullecte"
If no, send an alert ("/home/nullecte not available from host ...") by email to :
sree@abc.com
and then, exit script
3 - check if there are differencies between
/etc/auto_home and /home/nullecte/TechD/ref/auto_home
If no -> nothing to do
If yes -> replace local /etc/auto_home by ref (/home/nullecte/TechD/ref/auto_home)4 - check if there are differencies between
/etc/auto_home and /home/nullecte/TechD/ref/auto_home
If yes -> send an alert ("auto_home inconsistency on host ...") by email to :
sree@abc.comcould you please help me to get a script for this?
Hi:
Help or write? The best way to learn how to do something is to try! Here's some pointers, comment by comment:
#1 Consider 'grep'. For example, 'grep -q nullecte /etc/auto_home' will return a zero exit status if a match is found.
#2 Define "availability". Do you mean ping-able? Do you mean a particular process is running?
#3 'diff' is your friend. Read its manpages. As for replacements, look at 'sed', in the general form of 'sed -e '/this/that/' infile > outfile'. By the way, what do you mean by " ref (/home/nullecte/TechD/ref/auto_home)"?
#4 'diff' again
As for sending mail, simple alerts can be composed thusly:
# echo "I want help" | mailx -s "HELP!" sreer
...where "I want help" is the body of the message and "HELP!" is the subject and you are the recipient.
If everything you want to say is in the sublect line, do:
# mailx -s "HELP HELP HELP" sreer < /dev/null
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2011 11:55 AM
10-14-2011 11:55 AM
Re: Need a script for the below actions
Hi James,
Thanks for your extreme help...
Iam trying to make it up with your help...
Will let you know if it win/Loss :-)
Rgds
Sree
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2011 12:03 PM
10-14-2011 12:03 PM
Re: Need a script for the below actions
@Sreer wrote:Iam trying to make it up with your help...
Will let you know if it win/Loss :-)
Hi (again) Sreer:
You win as long as you try! When you are stuck, post what you have tried.
Regards!
...JRF...