1820254 Members
2584 Online
109622 Solutions
New Discussion юеВ

How to check disk status

 
SOLVED
Go to solution
Carles Viaplana
Valued Contributor

How to check disk status

Hello,

Is there any way to check disk status from linux?

We have some servers in other building and we want to monitor disk status remotelly. I know in HP-UX I can check if mirror works fine, but can I do the same with Linux?

Thanks in advance for your help.

Regards,

Carles
8 REPLIES 8
ofir_1
Occasional Advisor
Solution

Re: How to check disk status

hello Carles,

if you want to see information about your disk you can run fdisk -l. you allso can run the pvdislay, vgdisplay etc. just like in HP-ux.

you have allso third party software to monitor you disks for example
http://gentoowiki.com/HOWTO_Monitor_your_hard_disk(s)_with_smartmontools

hope its help

ofir

[Moderator edit: The above link is no longer valid. Please refer to https://support.hpe.com/]

Colin Topliss
Esteemed Contributor

Re: How to check disk status

Depends what disks you want to monitor and what hardware you are running.

For example, on the DL380s I use HPASM and HPSMH feeding into HPSIM and (hopefully when we sort out a couple of niggling issues) on into ISEE.

If the disks are internal, you can use the HP tools such as HPASM and HPSMH. HPASM's cpqimlview will let you see any alerts raised by ILO. HPSMH and the associated daemons will allow you to see the status of attached storage such as an MSA. These together will allow you to view the internal disk status. If you're feeling adventurous you might be able to do something with SNMP to get it to send out traps when a fault occurs. If you have HPSIM on your site then even better - because that can do it for you if you configure it correctly. I'm in the middle of looking at maybe using nagios and nrpe to remotely monitor aspects of my Linux systems from a central console (I'm looking at how to extact info from the HPASM daemons now using SNMP).

You can also use tools such as 'swatch' to monitor the messages file for any error messages that might indicate a disk problem and then mail you.

Colin.
Manuel Wolfshant
Trusted Contributor

Re: How to check disk status

The standard linux solution to monitor hard disks is usage of smartmontools (http://smartmontools.sourceforge.net/)
This usually means setting up smartd (a daemon which monitors the disks) and/or usage of smartctl for interactive access to disk status and SMART tests.

The same utilities are sometimes available in packages provided by the distribution. For instance RedHat includes them in the kernel-utils rpm.

Carles Viaplana
Valued Contributor

Re: How to check disk status

Hi all,

Thanks for your messages.

I checked system and it hasn't volume groups:

CARACAS:~ # df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p2 4079868 3810708 269160 94% /
/dev/cciss/c0d0p3 26966988 20500656 5096472 81% /img
/dev/cciss/c0d1p1 35560172 29478668 6081504 83% /img2
shmfs 1924884 0 1924884 0% /dev/shm
CARACAS:~ # vgdisplay
vgdisplay -- no volume groups found

CARACAS:~ #

I've found YasT interface and you can see hardware information, but I'm not sure whether it shows HW status.

Any idea about?

Regards,

Carles
Matti_Kurkela
Honored Contributor

Re: How to check disk status

/dev/cciss/* -style paths indicate that there is a hardware-based RAID controller. You need tools specific to your RAID controller to monitor its state.

On HP-UX, the mirrors created using MirrorDisk/UX are software-based. You could do this on Linux too, but why bother when you have a good hardware RAID available?

If you have the HP management drivers installed (packages hpasm, hpacucli), you can use these simple scripts I made. Install them wherever you like: I generally use /usr/local/sbin.

There are two scripts:
- hwraidstatus: displays a quick summary about the state of RAID controller, logical drive(s) and physical drives

- hwraidinfo: as above, but more verbose: contains information about RAID firmware version etc.

Of course you *could* do all these things using just the command line tool in hpacucli package, but it requires a long string of options.
MK
Carles Viaplana
Valued Contributor

Re: How to check disk status

Hi Matti,

I've problems to download your scripts. Could you send them again?

Thanks!

Carles
Matti_Kurkela
Honored Contributor

Re: How to check disk status

Here is "hwraidinfo":
-----cut here----------
#!/bin/sh
SLOTLIST=$(hpacucli ctrl all show | \
grep Slot | sed -e 's/^.*Slot //g' -e 's/ .*$//g')

for i in $SLOTLIST
do
echo
hpacucli ctrl slot=$i show | grep -v "^$"
echo
hpacucli ctrl slot=$i ld all show | grep -v "^$"
hpacucli ctrl slot=$i pd all show | grep -v "^$"
done
echo
---------cut here--------------
And "hwraidstatus":
---------cut here--------------
#!/bin/sh
SLOTLIST=$(hpacucli ctrl all show | \
grep Slot | sed -e 's/^.*Slot //g' -e 's/ .*$//g')

for i in $SLOTLIST
do
echo
hpacucli ctrl slot=$i show status | grep -v "^$"
echo
hpacucli ctrl slot=$i ld all show status | grep -v "^$"
hpacucli ctrl slot=$i pd all show status | grep -v "^$"
done
echo
-------------cut here------------
MK
Matti_Kurkela
Honored Contributor

Re: How to check disk status

Hm, pasting the scripts directly onto my reply seems to have wrecked the indentation in the scripts. They should still work.

(BTW: I originally attached the scripts as a .zip file, could that have caused the download problems?)

MK