steps:
- edit /etc/redhat-release, change to "Red Hat Enterprise Linux AS release 5" (required by hpasm and hpsmh packages)
- install net-snmp* rpm packages from CentOS 5
chkconfig snmpd on
service snmpd start
- install compat-libstdc* rpms , otherwise the storage controller Smart Array won't appear in Storage section in System Management Homepage
- download hpasm and hpsmh from
- install hpasm and hpsmh
hpsmh ->HP System Management Homepage for Linux (x86)
remember to start snmpd service first before installing rpms
configuring hpasm:
/etc/init.d/hpasm reconfigure
- access https://serverip:2381
- configuring /opt/compaq/cma.conf
trapemail /bin/mail -s 'Server1 HP Agents Trap Alarm' root
cmaXSocketBase 87654321
cmaCloseCcissHandle ON
note: we put cmascsid to exclude option to avoid the daemon to startup because it can cause system load to become high(uninterruptible sleep) on Fedora Core 3, you might take it out if your system is not FC3.
note: to stop storage agent: e.g. /opt/compaq/storage/etc/cmastor start/stop cmaeventd
- allow necessary ports in Firewall settinig
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 2381 -j ACCEPT
- snmp extension
# Following entries were added by HP Insight Management Agents at
# Mon Jun 16 10:39:32 SGT 2008
dlmod cmaX /usr/lib/libcmaX.so
rwcommunity public 127.0.0.1
rocommunity public 127.0.0.1
trapcommunity public
trapsink 1.2.3.4 public
sysname server.domain.com (please add it yourself)
syscontact Root
syslocation Unknown (edit /etc/snmp/snmpd.conf)
# ---------------------- END --------------------
note: you need to configure snmptoemail on 1.2.3.4 as follows:
[root@app~]# more /etc/snmp/snmptrapd.conf
traphandle default /usr/bin/perl /usr/bin/traptoemail -s localhost -f hpsnmptrap@domain.com JepheWu@domain.com
traphandle default /usr/bin/perl /usr/bin/traptoemail -s localhost -f hpsnmptrap@domain.com WuATing@domain.com
also, comment out the following requiretty line from /etc/sudoers so that you can send test trap mail from hpsmh webpage
[root@server snmp]# grep -e requiretty -e hpsmh /etc/sudoers
#Defaults requiretty
%hpsmh ALL=NOPASSWD:/etc/init.d/snmpd
%hpsmh ALL=NOPASSWD:/usr/bin/snmptrap
- snmp email alert
- put the following parts to /etc/mail/sendmail.mc
define(`SMART_HOST', `mailrelay')dnl
dnl EXPOSED_USER(`root')dnl
MASQUERADE_AS(`domain.com')dnl
MASQUERADE_DOMAIN(localhost)dnl
MASQUERADE_DOMAIN(localhost.localdomain)dnl
MASQUERADE_DOMAIN(db.domain.com)dnl
MASQUERADE_DOMAIN(domain.com)dnl
run m4 sendmail.mc > sendmail.cf
2. create file /etc/mail/service.switch and give it right permission (smmsp user can read it )
put 'hosts files' to /etc/mail/service.switch, so it should have permission 640 and owned by root:smmsp
3. put 1.2.3.4 which mail server ip address into /etc/hosts
1.2.3.4 mailrelay
use the following command to find out the path for sendmail.cf and service.switch
strings /usr/sbin/sendmail | grep sendmail.cf
strings /usr/sbin/sendmail | grep service.switch
4. put root alias in /etc/aliases
root: admin1@domain.com,admin2@domain.com
then run newaliases
5. send a test email
# echo testing | /usr/sbin/sendmail -v root