HP ASM RPM Converter Script

By donmc, 26 April, 2009
From: http://www.asaiam.com/hpasmondebian.php


HPASM on Kubuntu Proliant M370

Proliant M370 server. I had to find a way to get the HPASM "HP advanced server management" software to run Linux. It controls the fan system and without it the box sounds like a jet engine. I read through the existing documentation, which is very helpful and where most of this came from... Thanks!

 


Here is how I managed to get the fan controller part of the HPasm HP Advanced Server Management
software working on Debian “Kubuntu feisty 7.04.” The other parts of the software may or may not work,
but that at least in my situation was of no real concern. The most important factor to me was just to
shut those god awful fans off “slow down”.

WARNING: These directions do involve chmodding a couple directories which may or may not be secure
afterwards so I take absolutely no responsibility for any problems you might have, I do welcome
suggested modifications to this document.

I used the following sites and the key ingredient “pure frustration” to get this working.
http://debian.catsanddogs.com/index.php
http://www.debian-on-proliant.com/
Download hpasm-7.7.0c-24.rhel5.i386.rpm from
http://h18004.www1.hp.com/support/files/server/us/download/26841.html

Note that this link is GONE, so it looks like you'll have to extract it from the "PSP" from here:
ftp://ftp.hp.com/pub/softlib2/software1/supportpack-linux/p1640255777/v46579/psp-8.20.rhel5.i686.en.tar.gz I did not use any of the rpm2deb scripts as I had previously and had nothing but problems with them,
although for non feisty systems “earlier” it may work fine. I also tried all the debian drivers
that HP has put out for like sarge or some old stuff and they all suck. So I started with a
clean red hat 5 version and went for broke and … IT WORKED

To start you will be tricking a rpm into installing as a deb so you will need alien
sudo apt-get install alien

This will convert the rpm to deb and install it
sudo alien -i hpasm-7.7.0c-24.rhel5.i386.rpm

It will post the following warning message, but just ignore it.
Warning: Skipping conversion of scripts in package hpasm: postinst postrm preinst prerm
Warning: Use the --scripts parameter to include the scripts.

After install it will return to the cursor with no messages.
Next we need to find where it installed it.

So update the database
sudo updated

Locate hpasm, there will be a few so might need to page it
locate hpasm |less

It should find it here
/opt/compaq/hpasm/etc/hpasm

This is the command to start it.
/opt/compaq/hpasm/etc/hpasm start

When you run it, you may receive the following error:
exec: 1: 10: not found

By deduction and a small reference on some forum I found in the hpasm file a list of
#exempt the standard file descriptor
[ "$FD" = "0" ] && continue
[ "$FD" = "1" ] && continue
[ "$FD" = "2" ] && continue

Around line 22 I added this line. This tells it to take the 10 and just keep kicking. This obviously
causes some major issues in the software, but doesn’t matter for the part I need it for.
[ "$FD" = "10" ] && continue

When you try to run it again you will get a new error:
/opt/compaq/hpasm/etc/foundation.functions: 438: Syntax error: Bad substitution

You can comment out the following lines and the error will go away. This probably does limit the major
functions of the software, but I am only worried about the fans.
if [ "$I" != "0" ]; then
# for J in `seq 1 $I`; do
# if [ ! -z "${TEMPARRAY2[$J]}" ]; then
# echo "rwcommunity ${TEMPARRAY2[$J]} ${TEMPARRAY1[$J]}" >>$TMPFILE
# LINES=`expr $LINES + 1`
# fi
# done
env_manager ENVUSED CMAMGMTSTATIONIPORDNS
env_manager ENVUSED CMAMGMTSTATIONRWCOMMSTR
else

Next run causes this error, getting closer:
/opt/compaq/hpasm/etc/foundation.functions: 496: Syntax error: Bad substitution

Again, you can comment out the following lines and the error will go away.
if ["$I" != "0" ]; then
# for J in `seq 1 $I`; do
# if [ ! -z "${TEMPARRAY2[$J]}" ]; then
# echo "rocommunity ${TEMPARRAY2[$J]} ${TEMPARRAY1[$J]}" >>$TMPFILE
# LINES=`expr $LINES + 1`
# fi
# done
env_manager ENVUSED CMAMGMTSTATIONROIPORDNS

Next to last run causes this error, almost thereJ:
/opt/compaq/hpasm/etc/foundation.functions: 592: Syntax error: Bad substitution

Lastly, you comment out the following lines and the error will go away.
if [ "$I" != "0" ]; then
# for J in `seq 1 $I`; do
# if [ ! -z "${TEMPARRAY2[$J]}" ]; then
# echo "trapsink ${TEMPARRAY1[$J]} ${TEMPARRAY2[$J]}" >>$TMPFILE
# LINES=`expr $LINES + 1`
# fi
#done
env_manager ENVUSED CMATRAPDESTINATIONIPORDNS

This time when you start it, the errors will change completely, which is good. The errors now are
related to permission issues, since the rpm was not a true deb it doesn’t set everything 100%
correctly.

Starting Proliant System Health Monitor (hpasmd):/opt/compaq/foundation/etc/cmad: 158: cannot create
/var/spool/compaq/hpasmd.log: Directory nonexistent
etc
etc
etc

Due to other errors I had received previously I thought that there were permissions issues with the
compaq folder in /opt. There may or may not have been? – Feel free to omit this step and tell me
if it works.

sudo chmod 755 -R /opt/compaq/foundation/

This is what the error actually references.
sudo chmod 755 -R /var/spool/

It seems to look for this directory to place log files so I went ahead and created it.
sudo mkdir /var/spool/compaq

At this point the software should be setup and working.

Here are the main commands.
sudo /opt/compaq/hpasm/etc/hpasm start
sudo /opt/compaq/hpasm/etc/hpasm stop
sudo /opt/compaq/hpasm/etc/hpasm restart
sudo /opt/compaq/hpasm/etc/hpasm status