Sponsored Content
Full Discussion: Health check report
Top Forums Shell Programming and Scripting Health check report Post 302770652 by bashi77 on Monday 18th of February 2013 12:13:15 AM
Old 02-18-2013
Health check report

Hi Team,

I am writing a small script in that I want collect all servers of /opt and /stage.

Below is my small script
Code:
#!/bin/ksh

#checking Media server opt_Disk_Space_logs

myclient=`cat media_server.txt`
> opt_logs.txt

printf " Server Name\tsize\tused\tavail\tcapacity\tMounted on\n"

for i in $myclient

do

j=`sudo xxxxxx $i df -h |egrep -i "/opt|/stage" | awk '{print $2, "\t", $3, "\t", $4, "\t", $5,"\t", $6}'`

printf "\n $j"
done
echo""
echo""

the output as below.
Code:
 Server Name    size    used    avail   capacity        Mounted on

 13G     7.8G    4.9G    62      /opt
300G     268G    32G     90      /stage

but I want, some more in depth means.
If column 62 is more than 90 I need warming message

Code:
a=90

echo "out of opt_out"
echo $opt_out
if [ "$opt_out" -ge "$a" ]

then
printf "%s\t WARNING NEED TO CHECK NOW /opt \n",$opt
else
printf "%s\tGood Required space\n",$opt
echo "$opt_out   Good Required space"
fi

I know the above script as some problem, it is not give any correct output

Please provide the exact script.. The out put should be as below..

AND also I am checking many server as

Code:
server 1

 13G     7.8G    4.9G    62      /opt     Good, Required space avilable
300G     268G    32G     90      /stage  WARNING NEED TO CHECK NOW


server 2 

 13G     7.8G    4.9G    62      /opt     Good, Required space avilable
300G     268G    32G     90      /stage  WARNING NEED TO CHECK NOW


.....

etc

 

9 More Discussions You Might Find Interesting

1. HP-UX

check health

Dear Gentelmen I need command for display to me the following statement: -battery state -The application if working or not -The cpu is working or not -The power supply is working or not -The Data base is workig or not (2 Replies)
Discussion started by: magasem
2 Replies

2. AIX

AIX Health Check

Hi All, I would like to know if there is a downloadable AIX health check script available from IBM that would print a report of a servers health status. I've been working on a number of Sun Solaris servers and Sun provide a sun checkup script which can give you an ORI figure as well as a list... (3 Replies)
Discussion started by: backslash
3 Replies

3. Solaris

sun server health check

do anybody has a procedure for daily weekley monthly health check for SUN server with solaris OS?? (5 Replies)
Discussion started by: mm00123
5 Replies

4. Shell Programming and Scripting

Health check script

Hi, I have a server type(A group of AIX,HP-UX and Linux servers running with different appn) in which i need to do health check(memory,cpu,h/w etc). I am planning to automate the same. Please help me out in writing the same. Thanks Renjesh Raju (9 Replies)
Discussion started by: Renjesh
9 Replies

5. AIX

AIX Health Check script

Hi Everyone, Can you please help me put together a aix health check script that will check the status of CPU,Memory,Adapter, Filesystems (threshold 80%) and Disks.Im thinking of deploying a script to gather the required data in all the 22 servers and probably send out a mail if anything needs... (3 Replies)
Discussion started by: R!C
3 Replies

6. Shell Programming and Scripting

Health check script

There are 3 servers . I want to fire commands df -kh and mpstat -P ALL on those individual servers and retrieve particular values to genrate reports. This part is almost done. But i am facing issue when i need to compile the reports from all three servers on to one server in order to generate a... (1 Reply)
Discussion started by: pratikm23
1 Replies

7. HP-UX

HP-UX Health Check

Hi Experts, I want to check health of hp-ux box. Basically I want to check if there are possibilities of network/memory/cpu bottleneck? Are there are any commands available other than glance in hp-ux for the same? (11 Replies)
Discussion started by: sai_2507
11 Replies

8. Shell Programming and Scripting

Script to check the health of a database

need a script to check the health of a session server database. It must read the data base and send an alert if the database is unavailable. If its unavailable, we will want to bring down the database listener to force failover. can u guyz help me in doing this. what information do i need... (1 Reply)
Discussion started by: remo999
1 Replies

9. AIX

AIX Health Check

Hi everyone, I am new to the Unix admin position, needed some help. My management wants to report how their over all AIX servers / environment is doing so far. I've been researching and found multiple commands to run on each LPAR, well I have few questions and also wanted to share the commands Im... (12 Replies)
Discussion started by: Adnans2k
12 Replies
IPESCRIPT(1)						      General Commands Manual						      IPESCRIPT(1)

NAME
ipescript - Run an Ipe script (written in Lua) SYNOPSIS
ipescript script { arguments } DESCRIPTION
ipescript runs an Ipe script written in Lua. The Ipe bindings are automatically available in the script. Ipescript looks for the script in any of the script directories. The script argument should not contain the .lua extension. ENVIRONMENT VARIABLES
ipescript respects the following environment variables: IPELATEXDIR the directory where ipetoipe runs Pdflatex. IPESCRIPTS a list of directories where Ipescript will look for scripts. When this variable is not set, Ipe searches first the current directory, then ~/.ipe/scripts, and finally the system-wide Ipe script directory. When this variable is set, it should contain a list of directories, separated by semicolons. A single under- score is replaced by the system-wide Ipe script directory. IPEDEBUG set this to 1 for debugging output from ipescript. AUTHOR
Otfried Cheong REPORTING BUGS
Please report bugs using Ipe bugzilla at http://ipe7.sourceforge.net/bugzilla.html SEE ALSO
Ipe is documented fully in The Ipe Manual, which is available online at http://ipe7.sourceforge.net/manual/manual.html . August 28, 2011 IPESCRIPT(1)
All times are GMT -4. The time now is 01:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy