Let's pick one of the tests and assume that OutputW and OutputOK are other scripts or local functions.
Quote:
if [ `ioscan -fnC disk |wc -l` != 1 ]
then
if [ `ioscan -fnC disk |grep CLAIMED|wc -l` != `ioscan -fnC disk |grep NO_HW|wc -l` ]
then
outputW "Disks: Not CLAIMED disks detected."
else
outputOK "Disks: All Disks are CLAIMED"
fi
else
outputOK "Disks: No Disks found."
fi
There is a basic logic error here. The main condition does not work unless perhaps there is only ever one disk on a HP-UX system! Not sure about the syntax either.
We should run ioscan only once because it is a very powerful program and can cause the view to change. Be aware that running ioscan can cause dead hardware to completely disappear from the inventory (and therefore not show as NO_HW).
Let's try something lke this (untested and purely to demonstrate logic and not recommended).
On my systems I run ioscan -fn (i.e. all hardware) daily and compare this output with the output from the same command yesterday. No attempt to predict every possible error output from ioscan. If there are differences, this is reported as a major error. Obviously if you detect a failure and repair it you will get one false alert for the broken hardware re-appearing.
I started doing this after discovering that a major hardware failure can cause a crash and reboot during which the dead hardware can completely and silently disappear from the ioscan inventory.
That reminds me. Don't forget to have a script to read the syslog and identify anything abnormal (and I don't mean broken printers).
Last edited by methyl; 08-24-2012 at 07:44 PM..
Reason: minor typos
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)
Hi Team,
I am writing a small script in that I want collect all servers of /opt and /stage.
Below is my small script
#!/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... (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)
I am working on a project, which need to constantly watch the process, and check its status, if it was dead, it should be restart automatically.
Please kindly refer me to URL which teach how to write this kind of script, or service.
Thanks. (1 Reply)
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)