Sponsored Content
Full Discussion: Daily health check script
Top Forums Shell Programming and Scripting Daily health check script Post 302691169 by fretagi on Friday 24th of August 2012 02:48:12 AM
Old 08-24-2012
Hi

I am trying to use a modified code to check for lan, disk but with no success, please can you give me some hints:
Code:
#check if NIC cards are OK

if [ `ioscan -fnC lan |wc -l` != 1 ]
then
 if [ `ioscan -fnC lan  |grep CLAIMED|wc -l` != `ioscan -fnC lan |grep NO_HW|wc -l` ]
then
 outputW "Ethernet: Offline NICs detected."
else
 outputOK "Ethernet: All NICs are online"
fi
else
 outputOK "Ethernet: No NICs found."
fi

# check if Disks are OK

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

and the output I am getting is:

Code:
Ethernet: Offline NICs detected. [ Warning ]


SAN: Offline HBAs detected. [ Warning ]


Disks: Not CLAIMED disks detected. [ Warning ]

and if I do ioscan:
Code:
prep03[133]/tmp/fr #ioscan -fnC lan
Class     I  H/W Path  Driver S/W State   H/W Type     Description
===================================================================
lan       0  0/1/1/0   igelan   CLAIMED     INTERFACE    HP PCI-X 1000Mbps Dual-port Built-in
lan       1  0/1/1/1   igelan   CLAIMED     INTERFACE    HP PCI-X 1000Mbps Dual-port Built-in
lan       2  0/2/2/0   igelan   CLAIMED     INTERFACE    HP PCI-X 1000Mbps Dual-port Built-in
lan       3  0/2/2/1   igelan   CLAIMED     INTERFACE    HP PCI-X 1000Mbps Dual-port Built-in
prep03[134]/tmp/fr #nwmgr

Name/          Interface Station          Sub-   Interface      Related
ClassInstance  State     Address        system   Type           Interface
============== ========= ============== ======== ============== =========
lan2           UP        0x78E7D1723F0E igelan   1000Base-SX
lan0           DOWN      0x78E7D1723F0C igelan   1000Base-SX
lan1           DOWN      0x78E7D1723F0D igelan   1000Base-SX
lan3           UP        0x78E7D1723F0F igelan   1000Base-SX
lan900         DOWN      0x000000000000 hp_apa   hp_apa
lan901         DOWN      0x000000000000 hp_apa   hp_apa
lan902         DOWN      0x000000000000 hp_apa   hp_apa
lan903         DOWN      0x000000000000 hp_apa   hp_apa
lan904         DOWN      0x000000000000 hp_apa   hp_apa
prep03[135]/tmp/fr #ioscan -fnC fc
Class     I  H/W Path     Driver S/W State   H/W Type     Description
====================================================================
fc        0  0/3/0/0/0/0  fclp   CLAIMED     INTERFACE    HP 403621-B21 4Gb PCIe 2-port LPe1105 FC Mezzanine Adapter
                         /dev/fclp0
fc        1  0/3/0/0/0/1  fclp   CLAIMED     INTERFACE    HP 403621-B21 4Gb PCIe 2-port LPe1105 FC Mezzanine Adapter
                         /dev/fclp1
prep03[136]/tmp/fr #ioscan -fnC disk
Class     I  H/W Path  Driver S/W State   H/W Type     Description
==================================================================
disk      0  0/2/1/0.0.0.0.0  sdisk   CLAIMED     DEVICE       HP      IR Volume
                      /dev/dsk/c0t0d0     /dev/dsk/c0t0d0s2   /dev/rdsk/c0t0d0    /dev/rdsk/c0t0d0s2
                      /dev/dsk/c0t0d0s1   /dev/dsk/c0t0d0s3   /dev/rdsk/c0t0d0s1  /dev/rdsk/c0t0d0s3
prep03[137]/tmp/fr #

Please can you help
 

10 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. Shell Programming and Scripting

need help to write script to check the process health and automatically restart it

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)
Discussion started by: dragondad
1 Replies

3. 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

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. Shell Programming and Scripting

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 #!/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)
Discussion started by: bashi77
12 Replies

10. 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
uudemon(4)						     Kernel Interfaces Manual							uudemon(4)

NAME
uudemon.admin, uudemon.cleanu, uudemon.hour, uudemon.poll - Administrative shell scripts for polling remote systems, cleaning up spool directories, reporting status to the system administrator, and routine invocations of the uuxqt and uusched daemons SYNOPSIS
These shell scripts reside in the following directory: /usr/lib/uucp DESCRIPTION
All the scripts can be run from the command line or can be run automatically by the cron daemon. To automatically run the scripts, remove the comment character (#) from the beginning of the relevant line in the /var/spool/cron/crontabs/uucp file. This script reports status to the system administrator. It issues the uustat command to find out the status of uucp jobs. It mails the results to the uucp login ID. The script may be modified to send mail to any login ID such as the uucp administrative login ID (uucpa) or root. This script cleans up the /var/spool/uucp and /var/spool/uucppublic directories by running the uucleanup command. The uucleanup com- mand is run with the following parameters: -C7, -D7, X2, -o2, -W1. This script runs the uusched and uuxqt daemons in the background. This script polls the systems listed in the /usr/lib/uucp/Poll file. The uudemon.poll script should be scheduled before the uudemon.hour script. This allows uudemon.poll to create any command files before cron runs the uudemon.hour script. FILES
Contains the uudemon.admin, uudemon.cleanu, uudemon.hour and uudemon.poll files. Contains the uucp file. RELATED INFORMATION
Commands: cron(8), uucleanup(8), uusched(8), uuxqt(1) Files: /usr/lib/uucp delim off uudemon(4)
All times are GMT -4. The time now is 04:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy