On Thu, Oct 01, 2009 at 10:38:20PM +0530, anuj agarwal wrote:
> Hi,
>
> I am trying to create a script which will send an email to the user stating
> that server is UP when it is UP. We have a script "pingServer" which can be
> used to check whether it is UP or not(it will show the server state as UP or
> DOWN) but we need to execute it many times till it shows UP.
>
> Please provide your suggestions.
>
> Anuj Agarwal
> +91-9923111896
> SME
> DVCI AMDOCS,
> Tower 2, Cybercity,
> Magarpatta City,
> Pune
>
> Engineering is the art of making what you want from things you can get.
>
> >
#!/bin/ksh
serverStatus=$(pingServer)
while [[ "$serverStatus" != "UP" ]]
do
sleep 5
serverStatus=$(pingServer)
done
sendmail [email protected] <<-"EOM"
Subject: Server [hostname] is up! <eom>
EOM
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at
http://groups.google.com/group/linuxusersgroup
-~----------~----~----~----~------~----~------~--~---