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
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)
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)
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)
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)
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)
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)
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)
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)