Sponsored Content
Top Forums Shell Programming and Scripting Help....script check status if see something then send email Post 302865467 by dotran on Friday 18th of October 2013 01:33:51 PM
Old 10-18-2013
Finally I got this code work, but I want apply to multiple servers but seem not loop can somehelp check the syntax on this. Thanks

SERVERS="server1|server2|server3"

Code:
 
#!/bin/ksh
 
SERVERS="server1|server2|server3"
 
#for SER in $SERVERS
#do
 
CHECK_MACHINE=`autorep -m server1 | awk '{print $NF}' | awk 'NR>3' | egrep 'Offline|Missing|Unqualified'`
while true
do
CHECK_MACHINE=`autorep -m server1 | awk '{print $NF}' | awk 'NR>3' | egrep 'Offline|Missing|Unqualified'`
if [ $? = 0 ] ; then
sleep 10; echo "Check the agent is [${CHECK_MACHINE}]" | 
mailx -s "WARNING --The agent is [${CHECK_MACHINE}]" abc@test.com
exit 1
fi
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

awk to find the status and send an email

Hi, I have a datafile which has the following data and it can have much more records. The data set is as follows: ISA~00~ ~00~ ~ZZ~F159B ~ZZ~U1CAD ~051215~184 3~U~00200~000011432~0~P~< GS~FA~TC11A~U1CAD~051215~1843~000011432~X~002002 ST~997~0001... (6 Replies)
Discussion started by: isingh786
6 Replies

2. Shell Programming and Scripting

check the status and send an email with status

Hi, We have a text file which has the following data. ISA~00~ ~00~ ~ZZ~VISTN ~ZZ~U1CAD ~051227~183 7~U~00200~000011258~0~P~< GS~FA~EE05J~U1CAD~051227~1831~000011258~X~002002 ST~997~0001 AK1~SH~247 AK2~856~2470001 AK5~A AK2~856~2470002 AK5~A... (3 Replies)
Discussion started by: isingh786
3 Replies

3. Shell Programming and Scripting

Script to check processes and send an email

I searched through the forum and couldn't quite find what I was looking for. I have a script that looks for a process "DW" to be running. If it is not it will email a notice to an account. I would like to add the functionality to have it also email a seperate notice if there is more that one of... (1 Reply)
Discussion started by: heprox
1 Replies

4. UNIX for Dummies Questions & Answers

unix script to check if rsh to box and send status mail

rshstatus=`rsh -n lilo /db/p2/oracle/names9208/restart_names.sh` if $rshstatus <>0 then errstatus=1 mailx -s "xirsol8dr" ordba@xxx.com >> $log_dr else if errstatus=0 echo "status to xirsol8dr successful" can anyone provide if this is t he correct way to do this or is there a better way? (1 Reply)
Discussion started by: bpm12
1 Replies

5. Shell Programming and Scripting

Check space of directories and send email if it has reached threshold limit

Hi, I need help in writing unix script for checking space of some directories on the system and also send an email when it reaches the threshold limit. I have written the followng code; #!/bin/ksh ADMIN="me@somewhere.com" # set alert level 80% is default THRESHOLD=80 df | grep -E... (5 Replies)
Discussion started by: jmathew99
5 Replies

6. Shell Programming and Scripting

Grep Stop status from the output of script and send an eamil alert.

Hello Team, I have script which gives below output. Server clustServer11 is in a STARTED state Server clustServer12 is in a STOPPED state Server clustServer21 is in a STOPPED state I would like to prepare script which will grep stop word from the above output and send an email alert. (5 Replies)
Discussion started by: coolguyamy
5 Replies

7. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

8. Shell Programming and Scripting

Help with Email Status shell script

I have written a bash script to to sort the data from logs i need some help in printing the outputs , i dont have much ideas in bah scripting. Sample script ----------------------- #!/bin/bash a=`date | cut -d " " -f2,2,3` cat /var/log/maillog |grep "$a" |grep -E -e 'deferred|bounced'... (9 Replies)
Discussion started by: unimaxlin
9 Replies

9. Shell Programming and Scripting

Script to email status

Hi, I have few processes in the server continuous run few jobs, each of the process will generate a log file which detailing when its jobs are completed. the logfile will has the name something like this, result1.log, result2.log, result3.log,.... result10.log, result11.log, result12.log.......... (8 Replies)
Discussion started by: khchong
8 Replies

10. Shell Programming and Scripting

Send Disk Space Usage Status via email

Hi Guys, Is there any way I can write a script that sends DISK SPACE USAGE STATUS via email once a week? Thanks, (5 Replies)
Discussion started by: g4v1n
5 Replies
asadmin-list-authdbs(1AS)					   User Commands					 asadmin-list-authdbs(1AS)

NAME
list-authdbs - gets the authorized database SYNOPSIS
list-authdbs --user admin_user[--password admin_password][--host localhost] [--port 4848][--passwordfile filename][--secure|-s][--instance instance_name] --virtualserver virtualserver_ID authdb_ID Gets the access control lists associated with the named server instance. OPTIONS
--user administrative user associated for the instance. --password administrative password corresponding to the administrative user. --host host name of the machine hosting the administrative instance. --port administrative port number associated with the administrative host. --passwordfile file containing passwords appropriate for the command (e.g., administrative instance). --secure if true, uses SSL/TLS to communicate with the administrative instance. --virtualserver virtual server ID. It can also be referred to as the variable $id in an obj.conf file. A virtual server ID cannot begin with a number. OPERANDS
instance_name name of the instance. Example 1: Using list-authdbs asadmin> lsit-authdbs --user admin --password adminadmin --host fuyako --port 7070 --virtualserver server1 server1 default sampleAuth Where: default and sampleAuth are the authdb IDs in virtual server server1 and instance server1 listed. asadmin% list-authdbs --instance server1 EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-create-authdb(1AS), asadmin-delete-authdb(1AS) J2EE 1.4 SDK March 2004 asadmin-list-authdbs(1AS)
All times are GMT -4. The time now is 10:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy