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
TIDY_GET_OPT_DOC(3)							 1						       TIDY_GET_OPT_DOC(3)

tidy::getOptDoc - Returns the documentation for the given option name

       Object oriented style

SYNOPSIS
string tidy::getOptDoc (string $optname) DESCRIPTION
Procedural style string tidy_get_opt_doc (tidy $object, string $optname) tidy_get_opt_doc(3) returns the documentation for the given option name. Note You need at least libtidy from 25 April, 2005 for this function be available. PARAMETERS
o $object - The Tidy object. o $optname - The option name RETURN VALUES
Returns a string if the option exists and has documentation available, or FALSE otherwise. EXAMPLES
Example #1 Print all options along with their documentation and default value <?php $tidy = new tidy; $config = $tidy->getConfig(); ksort($config); foreach ($config as $opt => $val) { if (!$doc = $tidy->getOptDoc($opt)) $doc = 'no documentation available!'; $val = ($tidy->getOpt($opt) === true) ? 'true' : $val; $val = ($tidy->getOpt($opt) === false) ? 'false' : $val; echo "<p><b>$opt</b> (default: '$val')<br />". "$doc</p><hr /> "; } ?> SEE ALSO
tidy.getconfig(3), tidy.getopt(3). PHP Documentation Group TIDY_GET_OPT_DOC(3)
All times are GMT -4. The time now is 09:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy