HP ProCurve - switch update firmware

swx# show version
Image stamp:    /sw/pre/build/nemo(ndx)
                Jan 25 2008 13:54:14
                R.11.07
                104
Boot Image:     Primary
BL-C234-AS01# show flash
Image           Size(Bytes)   Date   Version
-----           ----------  -------- -------
Primary Image   : 3689315   01/25/08 R.11.07
Secondary Image : 3689315   01/25/08 R.11.07
Boot Rom Version: R.10.06
Current Boot    : Primary
We see that’s we’re running firmware version R.11.07. When copying the firmware to my TFTP server, I’ll use the same filename convention that HP does, so our filename will be R\_11\_07.swi. Let’s save a copy to the TFTP server:
swx# copy flash tftp 192.168.1.12 R_11_07.swi
I always like to verify that the file actually shows up on the TFTP server, regardless of any error messages (or lack thereof) from the switch:
$ ls -l /tftpboot/R_11_07.swi
-rw-r--r-- 1 nobody nogroup 3689315 2009-02-02 23:28 /tftpboot/R_11_07.swi
In the meantime, I’ve downloaded the latest version of the software, R.11.25, from HP’s FTP server and saved it as R\_11\_25.swi on the TFTP server. Let’s go ahead and copy it over to the primary flash on the switch:
swx# copy tftp flash 192.168.1.12 R_11_25.swi primary
The Primary OS Image will be deleted, continue [y/n]?  y
Here we tell the switch to copy from a TFTP server to flash memory, the TFTP server has IP address 192.168.1.12, the filename on the TFTP server is R\_11\_25.swi, and that we want that file saved to the primary flash on the switch. You’ll see a progress counter as the file is transferred, then:
Validating and Writing System Software to FLASH...
which takes a moment. After it has completed, we can verify success by examining the contents of flash:
swx# show flash
Image           Size(Bytes)   Date   Version
-----           ----------  -------- -------
Primary Image   : 3790986   01/14/09 R.11.25
Secondary Image : 3689315   01/25/08 R.11.07
Boot Rom Version: R.10.06
Current Boot    : Primary
We can now reboot the switch with the new firmware:
swx# reload
Device will be rebooted, do you want to continue [y/n]?  y
After the switch boots back up, we can verify that it is running the latest firmware:
swx# show version
Image stamp:    /sw/pre/build/nemo(ndx)
                Jan 14 2009 15:31:02
                R.11.25
                301
Boot Image:     Primary
HINT: Always read the release notes before upgrading firmware, especially on a production device!

MegaCLI - rebuild

While replacing a bad drive with a drive that used to be part of another RAID array configuration, the RAID refused to automatically rebuild, thinking that I might want to import the configuration from this disk (or that there's data on there that I might need).
Simply inserting the drive doesn't make the controller rebuild the array with that disk. Here's how to manually make the drive get along with the rest of the new array:
(Note: this is a 64 bit server, so the MegaCli client I'm using is called "MegaCli64", if you are not running x64, you can simply substitute the commands below with the path to your megacli binary.)
server:~# MegaCli64 -PDlist -aALL -a0
[...]
Enclosure Device ID: 32
Slot Number: 4
[...]
Firmware state: Unconfigured(bad)
[...]
Secured: Unsecured
Locked: Unlocked
Foreign State: Foreign
[...]
Based on the information obtained above, I now know that the disk drive I just replaced is [32:4] ([enclosureid:slotnumber]) and is currently being reported as 'Unconfigured(bad)'.
To bring this drive back online run:
server:~# MegaCli64 -PDMakeGood -PhysDrv[32:4] -a0
Adapter: 0: EnclId-32 SlotId-4 state changed to Unconfigured-Good.
The controller will now recognize the disk as being a "foreign" one. This does not mean it was made in Japan (though, it likely was). It means it has detected some RAID configuration/data on it and thus, considers it as a disk being part of an array that may be imported into current controller configuration. Because of this, it will not automatically rebuild until you force it to.
Now you can ask the controller to scan for foreign configurations and remove them:
server:~# MegaCli64 -CfgForeign -Scan -a0
There are 1 foreign configuration(s) on controller 0.
server:~# MegaCli64 -CfgForeign -Clear -a0
Foreign configuration 0 is cleared on controller 0.
The disk should now be available for rebuilding into your new RAID array. To confirm, run this:
server:~# MegaCli64 -PDList -a0
[...]
Enclosure Device ID: 32
Slot Number: 4
[...]
Firmware state: Unconfigured(good), Spun Up
Foreign State: None
[...]
Excellent. We have a good, recognized (yet still unconfigured) drive now. Now we have all we need to add the disk back into the new array, and rebuild:
Get the disk [32:4] back into array 1, as disk 4:
server:~# MegaCli64 -PdReplaceMissing -PhysDrv[32:4] -array1 -row4 -a0
Adapter: 0: Missing PD at Array 1, Row 4 is replaced
And finally start rebuilding it:
server:~# megacli -PDRbld -Start -PhysDrv[32:4] -a0
Started rebuild progress on device(Encl-32 Slot-4)
Now, sit back, relax, grab a smoke and wait for it to rebuild itself into your new RAID array. Not so foreign anymore, huh?

Edit the registry inside a WIM file

Edit the registry inside a WIM file

An oldie but a goodie – this came about again when creating Windows 7 WIM files for SCCM. It really does save a lot of time – otherwise you would need to deploy your image, make changes to the registry and then recapture. This process is much quicker! I use the DISM tool from the WAIK toolkit but you could also use imageX to mount the image.
Steps:
Mount the WIM
Open the Deployment Tools Command prompt and enter:
dism /mount-wim /wimfile:d:temptest.wim /index:1 /mountdir:c:mount
Result:

D:>dism /mount-wim /wimfile:d:temptest.wim /index:1 /mountdir:c:mount
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Mounting image
[==========================100.0%==========================]
The operation completed successfully.


Load the registry hive
From a command prompt enter:
reg load HKLMtest c:mountwindowssystem32configsoftware
Result:
D:>reg load HKLMtest c:mountwindowssystem32configsoftware
The operation completed successfully.


Open regedit
You will then see the registry that is contained in the WIM file, in this case it is called test. Make your changes, then exit regedit.


Unload the registry hive
From a command prompt enter:
reg unload HKLMtest
Result:
D:>reg unload HKLMtest
The operation completed successfully.


Unmount the image
Open the Deployment Tools Command prompt and enter:
dism /unmount-wim /mountdir:c:mount /commit
Result:
D:>dism /unmount-wim /mountdir:c:mount /commit
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image File : d:temptest.wim
Image Index : 1
Saving image
[==========================100.0%==========================]
Unmounting image
[==========================100.0%==========================]
The operation completed successfully.

Hewlett-Packard Company Smart Array G6 controllers

# yum install hp-snmp-agents hp-health

Debian

For Debian, HP provides the "Proliant Support Pack" as its own repository for squeeze, but the versions are a little bit outdated.

# vim /etc/apt/sources.list.d/hp.list
 
deb http://downloads.linux.hp.com/SDR/downloads/ProLiantSupportPack/ wheezy/current non-free
 
# wget http://downloads.linux.hp.com/SDR/repo/mcp/GPG-KEY-mcp -O - | apt-key add -
 
# apt-get update
# apt-get install hp-snmp-agents hp-health
# apt-get install hpacucli

Drive and Raid Arrays with hpacucli

Icon
Icon
For a more recent version of hpacucli refer to http://hwraid.le-vert.net/wiki/DebianPackages
# cd /usr/lib/nagios/plugins
# mkdir uname26 ; cd uname26
# wget http://mirror.linux.org.au/linux/kernel/people/ak/uname26/Makefile
# wget http://mirror.linux.org.au/linux/kernel/people/ak/uname26/uname26.c
# make
# cp uname26 /usr/sbin


# /usr/sbin/uname26 hpacucli ctrl slot=11 pd all show status

Wrapper for uname26


# vim /usr/local/bin/hpacucli

#!/bin/bash
/usr/sbin/uname26 /usr/sbin/hpacucli $@

check_hpacucli

# cd /usr/lib/nagios/plugins
# wget "http://exchange.nagios.org/components/com_mtree/attachment.php?link_id=3521&cf_id=30" -O check_hpacucli
# chmod +x check_hpacucli

# apt-get install libnagios-plugin-perl

# vim check_hpacucli
#my $hpacucli = '/usr/sbin/hpacucli';
my $hpacucli = '/usr/local/bin/hpacucli';

# ./check_hpacucli -i
check_hpacucli OK -    array A: OK    physicaldrive 1I:1:1 (port 1I.....

Sudo for the wrapper

# visudo
nagios ALL=(ALL) NOPASSWD: /usr/local/bin/hpacucli 

nrpe

# vim /etc/nagios/nrpe.d/icinga.cfg
 
command[check_raid_all]=/usr/lib/nagios/plugins/check_hpacucli -i
 
# service xinetd restart

icinga

define service {
...
       check_command  check_nrpe_command!check_raid_all
...
}

check_hparray

Plugin

# cd /usr/lib/nagios/plugins
# wget "http://exchange.nagios.org/components/com_mtree/attachment.php?link_id=674&cf_id=24" -O check_hparray
# chmod +x check_hparray
 
# vim /usr/lib/nagios/plugins/check_hparray

#HPACUCLI=/usr/sbin/hpacucli
HPACUCLI=/usr/local/bin/hpacucli

nrpe

# vim /etc/nagios/nrpe.d/icinga.cfg
# raid, disks
command[check_raid1]=/usr/lib/nagios/plugins/check_hparray -s 0
command[check_raid6]=/usr/lib/nagios/plugins/check_hparray -s 11

# service xinetd restart

icinga

define service {
...
       check_command  check_nrpe_command!check_raid1
...
}
 
define service {
...
       check_command  check_nrpe_command!check_raid6
...
}

check_cciss

(warning) doesn't work properly.
Uses hpacucli, and requires uname26 wrapper in Debian, and NRPE running.
http://exchange.nagios.org/directory/Plugins/Hardware/Storage-Systems/RAID-Controllers/check_cciss--2D-HP-and-Compaq-Smart-Array-Hardware-status/details

check_raid.pl

(warning) doesn't work properly
From PLD Linux, uses hpacucli and cciss_vol_status plus mpt-status. Call via NRPE.
https://github.com/glensc/nagios-plugin-check_raid
# apt-get install cciss_vol_status mpt-status hpacucli
# cd /usr/lib/nagios/plugins
# wget https://raw.github.com/glensc/nagios-plugin-check_raid/master/check_raid.pl
# chmod +x check_raid.pl

Mega cli install

Installing LSI megaCLI in Ubuntu
In order to setup the LSI megaraid megacli command line utility for managing hardware raid arrays under
Ubuntu requires a few steps


First you will need to modify your sources.list to include another repo whereby the tools can be downloaded
using apt-get

Modify /etc/apt/sources.list

and then add

"deb http://hwraid.le-vert.net/ubuntu precise main"


then do

Code:
apt-get update


apt-get install megacli megactl megaraid-status

If you get a GPG error, you will need to grab the keys

Code:
wget -O - http://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key | sudo apt-key add -

Then try again

Code:
apt-get install megacli megactl megaraid-status



Some basic megacli commands:

View information about virtual drive
Code:
megacli -LDInfo -Lall -aALL

View information about physical disks
Code:
megacli -PDList -aALL



Using smartmontools behind the raid controller:

You can test individual drives behind the raid controller with a bit of trickery. Smartmontools is great for diagnosing individual hard disk drives if you are concerned about the health of your raid array.

First you need to get a list of the device ids for each of the individual
drives:

Code:
root@server:~# megacli -pdlist -a0| grep 'Device Id'
Device Id: 9
Device Id: 10
Device Id: 11
Device Id: 8

In my example, I have a raid array with 4 disks, listed here as devices
8 through to 11, and the mounted device is /dev/sdc


We can manipulate the smartmontools commands in order to test these individual devices.

Code:
smartctl -d sat+megaraid,8 -t short /dev/sdc

this will perform a 'short test' on /dev/sdc's raid device drive no. 8

in order to view the status of the short test you can use

Code:
smartctl -d sat+megaraid,8 -l selftest /dev/sdc


this procedure can then be done for each other individual device id behind the raid array.

LV Status NOT available

linux01:~ # lvdisplay
--- Logical volume ---
 LV Name /dev/vg00/vm
VG Name vg00
LV UUID NBNRGV-FkSR-ZNZ9-9AVk-chLQ-j5nc-RazeBw
LV Write Access read/write
LV Status NOT available
LV Size 17.00 GB
Current LE 4352
Segments 1
Allocation inherit
Read ahead sectors 0

Solution: 
vgchange -a y

Can't locate openwsman.pm

Problem:

UNKNOWN: Cannot load module --plugin.
Can't locate openwsman.pm in @INC (@INC contains: /usr/lib/nagios/plugins/centreon-plugins /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/lib/nagios/plugins/centreon-plugins/centreon/plugins/wsman.pm line 25.
BEGIN failed--compilation aborted at /usr/lib/nagios/plugins/centreon-plugins/centreon/plugins/wsman.pm line 25.
Compilation failed in require at /usr/lib/nagios/plugins/centreon-plugins/centreon/plugins/script_wsman.pm line 25.
BEGIN failed--compilation aborted at /usr/lib/nagios/plugins/centreon-plugins/centreon/plugins/script_wsman.pm line 25.
Compilation failed in require at (eval 9) line 3.
        ...propagated at /usr/share/perl5/base.pm line 94.
BEGIN failed--compilation aborted at /usr/lib/nagios/plugins/centreon-plugins/os/windows/wsman/plugin.pm line 25.

Compilation failed in require at /usr/lib/nagios/plugins/centreon-plugins/centreon/plugins/misc.pm line 221.

Solution:

yum install openwsman-perl

LinkWithin-4

Related Posts Plugin for WordPress, Blogger...