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
SK(4)							   BSD Kernel Interfaces Manual 						     SK(4)

NAME
sk, skc -- SysKonnect XMAC II and Marvell GMAC based gigabit ethernet SYNOPSIS
skc* at pci? dev ? function ? sk* at skc? mskc* at pci? dev ? function ? msk* at skc? DESCRIPTION
The sk driver provides support for SysKonnect based gigabit ethernet adapters and Marvell based gigabit ethernet adapters, including the fol- lowing: o SK-9821 SK-NET GE-T single port, copper adapter o SK-9822 SK-NET GE-T dual port, copper adapter o SK-9841 SK-NET GE-LX single port, single mode fiber adapter o SK-9842 SK-NET GE-LX dual port, single mode fiber adapter o SK-9843 SK-NET GE-SX single port, multimode fiber adapter o SK-9844 SK-NET GE-SX dual port, multimode fiber adapter o SK-9521 V2.0 single port, copper adapter (32-bit) o SK-9821 V2.0 single port, copper adapter o SK-9843 V2.0 single port, copper adapter o 3Com 3c940 single port, copper adapter o Belkin Gigabit Desktop Network PCI Card, single port, copper (32-bit) o D-Link DGE-530T single port, copper adapter o Linksys EG1032v2 single-port, copper adapter o Linksys EG1064v2 single-port, copper adapter The msk driver provides support for the Marvell Yukon-2 based Gigabit Ethernet adapters, including the following: o Marvell Yukon 88E8035, copper adapter o Marvell Yukon 88E8036, copper adapter o Marvell Yukon 88E8038, copper adapter o Marvell Yukon 88E8050, copper adapter o Marvell Yukon 88E8052, copper adapter o Marvell Yukon 88E8053, copper adapter o Marvell Yukon 88E8055, copper adapter o SK-9E21 1000Base-T single port, copper adapter o SK-9E22 1000Base-T dual port, copper adapter o SK-9E81 1000Base-SX single port, multimode fiber adapter o SK-9E82 1000Base-SX dual port, multimode fiber adapter o SK-9E91 1000Base-LX single port, single mode fiber adapter o SK-9E92 1000Base-LX dual port, single mode fiber adapter o SK-9S21 1000Base-T single port, copper adapter o SK-9S22 1000Base-T dual port, copper adapter o SK-9S81 1000Base-SX single port, multimode fiber adapter o SK-9S82 1000Base-SX dual port, multimode fiber adapter o SK-9S91 1000Base-LX single port, single mode fiber adapter o SK-9S92 1000Base-LX dual port, single mode fiber adapter o SK-9E21D 1000Base-T single port, copper adapter The SysKonnect based adapters consist of two main components: the XaQti Corp. XMAC II Gigabit MAC (sk) and the SysKonnect GEnesis controller ASIC (skc). The XMAC provides the Gigabit MAC and PHY support while the GEnesis provides an interface to the PCI bus, DMA support, packet buffering and arbitration. The GEnesis can control up to two XMACs simultaneously, allowing dual-port NIC configurations. The Marvell based adapters are a single integrated circuit, but are still presented as a separate MAC (sk) and controller ASIC (skc). At this time, there are no dual-port Marvell based NICs. The sk driver configures dual port SysKonnect adapters such that each XMAC is treated as a separate logical network interface. Both ports can operate independently of each other and can be connected to separate networks. The SysKonnect driver software currently only uses the second port on dual port adapters for failover purposes: if the link on the primary port fails, the SysKonnect driver will automatically switch traffic onto the second port. The XaQti XMAC II supports full and half duplex operation with autonegotiation. The XMAC also supports unlimited frame sizes. Support for jumbo frames is provided via the interface MTU setting. Selecting an MTU larger than 1500 bytes with the ifconfig(8) utility configures the adapter to receive and transmit jumbo frames. Using jumbo frames can greatly improve performance for certain tasks, such as file transfers and data streaming. Hardware TCP/IP checksum offloading for IPv4 is supported. The following media types and options (as given to ifconfig(8)) are supported: media autoselect Enable autoselection of the media type and options. The user can manually override the autoselected mode. media 1000baseSX mediaopt full-duplex Set 1000Mbps (Gigabit Ethernet) operation on fiber and force full-duplex mode. media 1000baseSX mediaopt half-duplex Set 1000Mbps (Gigabit Ethernet) operation on fiber and force half-duplex mode. media 1000baseT mediaopt full-duplex Set 1000Mbps (Gigabit Ethernet) operation and force full-duplex mode. For more information on configuring this device, see ifconfig(8). To view a list of media types and options supported by the card, try ifconfig -m <device>. For example, ifconfig -m sk0. DIAGNOSTICS
sk%d: couldn't map memory A fatal initialization error has occurred. sk%d: couldn't map ports A fatal initialization error has occurred. sk%d: couldn't map interrupt A fatal initialization error has occurred. sk%d: failed to enable memory mapping! The driver failed to initialize PCI shared memory mapping. This might happen if the card is not in a bus-master slot. sk%d: no memory for jumbo buffers! The driver failed to allocate memory for jumbo frames during initialization. sk%d: watchdog timeout The device has stopped responding to the network, or there is a problem with the network connection (cable). SEE ALSO
ifmedia(4), intro(4), netintro(4), pci(4), ifconfig(8) XaQti XMAC II datasheet, http://www.xaqti.com. SysKonnect GEnesis programming manual, http://www.syskonnect.com. HISTORY
The sk device driver first appeared in FreeBSD 3.0. OpenBSD support was added in OpenBSD 2.6. NetBSD support was added in NetBSD 2.0. The msk driver first appeared in OpenBSD 4.0, and was ported to NetBSD 4.0. AUTHORS
The sk driver was written by Bill Paul <wpaul@ctr.columbia.edu>. Support for the Marvell Yukon-2 was added by Mark Kettenis <kettenis@openbsd.org>. BUGS
This driver is experimental. Support for checksum offload is unimplemented. Performance with at least some Marvell-based adapters is poor, especially on loaded PCI buses or when the adapters are behind PCI-PCI bridges. It is believed that this is because the Marvell parts have significantly less buffering than the original SysKonnect cards had. BSD
September 9, 2006 BSD
All times are GMT -4. The time now is 01:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy