i am new learner from shell scripting.. any one help me.


View Poll Results: Review
1 1 100.00%
2 0 0%
3 0 0%
4 0 0%
Voters: 1. This poll is closed

 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting i am new learner from shell scripting.. any one help me.
# 1  
Old 05-07-2010
i am new learner from shell scripting.. any one help me.

hi every body, i am ramesh.

i want write about this shell program (" i have 94 server's like aix, solaris, linux, hp-ux, and sco unix-") how to get mail's from these server's?

(i have personal linux system)- i want to run this program in my personal linux system continuously.

i want to write the program for got mail's, when in the 94 server's any one server is goe's down. at that time i want to got mail from that server information details.

any one help me............
i am waiting for ur reply..........................

---------- Post updated at 04:39 PM ---------- Previous update was at 12:28 PM ----------

help me anyone.....
# 2  
Old 05-07-2010
You have to consider for what reason a server goes down. If it has a serious problem, it will most probably not be able to send you an email in time. This would be very unreliable.

Maybe think about like a ping/nmap probing script, that runs on your Linux box scanning the remote hosts in some interval.
There is other versions of ping out there, that can already work on a whole input list/file of hostnames instead of running in a while loop every host against a ping.
This User Gave Thanks to zaxxon For This Post:
# 3  
Old 05-07-2010
thanks zaxxon

zaxxon:

i want shell program for send mail.." my pc to my friend yahoo mail"

u know the this program?
# 4  
Old 05-07-2010
Usually it's just mail which can be a link on some more capable mailer like mutt, mailx and so on.

Code:
echo "here comes my text blablabla..."| mail -s "Some Subject" myfriend@somedom.com

Don't forget to use the search function of the forum Smilie
# 5  
Old 05-07-2010
When in Doubt. PERL!

Well there my friend, you could use a very simple perl script to preform the mail functions.

First, you could have to ping/nmap script write to a log file or an array/hash.

Or even call it in a function.

Code:
#!/usr/bin/perl

... ping/nmap script here ...

sendMail(@nnamp_output);

sub sendMail {
open (OUT,"|/usr/sbin/sendmail -t");
print(OUT "From: i.am.leet\@space.mars\n"); ## don't forget to escape the @
print(OUT "Date: |/usr/bin/date\n");
print(OUT "To: i.am.leet\@space.mars\n");
print(OUT "Subject: Errors\n");
print(OUT "\n");
print(OUT "\n");
foreach ($_)
{
print(OUT "$_");
}
print(OUT "\n");
close(OUT);

}
exit 0;

Prior to this, you have to have a mail server eligible to accept and send this request. I run an OpenRelay here for the internals.

Hope this helps!
This User Gave Thanks to adelsin For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Beginning learner

Hi guys, New member here, also new student! I'm just starting the Shell Programming, currently in chapter four in the Book in Unix, Linux, and OS X by Stephen G. Kochan & Patrick Wood (4th edition). I'm needing a little help with other possible ways to shorten this shell command: // ... (1 Reply)
Discussion started by: shiver
1 Replies

2. AIX

Learner FTP help

Hello All, Real Newbie to AIX I need to automate an FTP server to Server. Want to push the files from an AIX server to an OSX server. What would be the best command in AIX to do this? Need help copying contents of \UVdata to 172.16.12.2\ERAbackup\1 Or Alternatively would it be better... (1 Reply)
Discussion started by: Joelly
1 Replies

3. Web Development

Perl scripting or shell scripting?

i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

4. Red Hat

learner Shell

a task given to me is to make a shell which will have the following qualities.... "The most rudimentary shell is structured as the following loop: 1. Print out a prompt (e.g., "OS_Spring2011_Shell$ "); 2. Read a line from the user; 3. Parse the line into the program name and an array of... (2 Replies)
Discussion started by: hamidnasir
2 Replies

5. What is on Your Mind?

Shell Scripting vs Perl scripting

Gents, I have been working in a Solaris/Unix environment for about 9 months. I took some linux classses online before getting the job. But, I am not very good at scripting. I want to learn how to script. Do you think that I should start with Shell scripting or Perl? I wanted to continue with... (2 Replies)
Discussion started by: Pouchie1
2 Replies

6. What is on Your Mind?

Shell scripting vs Perl scripting

Hi all, I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first. Can you please help me determine which one to... (14 Replies)
Discussion started by: Pouchie1
14 Replies

7. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

8. Post Here to Contact Site Administrators and Moderators

Thread closed when learner has tried

I'm not so sure that this thread should have been closed. Though it was clearly homework the student was asking a specific question related to the assignment, but not the answer to the whole assignment. /www.unix.com/unix-dummies-questions-answers/107494-how-get-rid.html . IMHO The solution is... (1 Reply)
Discussion started by: methyl
1 Replies

9. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

10. UNIX for Dummies Questions & Answers

I am a fresh learner of unix,and hope for some help here.

Who could tell me how to learn unix fastly? (4 Replies)
Discussion started by: dsun5
4 Replies
Login or Register to Ask a Question