2017年7月12日星期三

HP Linux Raid info (Tested under Centos 6.9)

HP System Management 
https://h20566.www2.hpe.com/hpsc/swd/public/detail?swItemId=MTX_6c49e131b4dc46fd937a652120 
 
HP Array Controller Unit Command Line Interface HPACUCLI
http://h20564.www2.hpe.com/hpsc/swd/public/detail?swItemId=MTX_d6ebba0f5cd642edace4648b9a 
 
CLI  status show
hpacucli controller slot=0 physicaldrive all show
 
CLI monitoring script example: 

slot=0 means build in controller if you use additional raid then you need to update the controller slot number
#!/bin/bash
###
#If disk and RAID went wrong with HP raid controller this script will send an email 
###
MAIL=info@ljhk.com
HPACUCLI=`which hpacucli`
HPACUCLI_TMP=/tmp/hpacucli.log


  if [ `hpacucli controller slot=0 physicaldrive all show | grep '(Failed|Rebuilding)'| wc -l` -gt 0 ]
  then
   msg="HP RAID Controller Errors"
   #echo $msg
   #$msg2=`hpacucli controller slot=0 physicaldrive all show`
   logger -p syslog.error -t RAID "$msg"
   $HPACUCLI controller slot=0 physicaldrive all show > $HPACUCLI_TMP
   mail -s "$HOSTNAME [ERROR] - $msg" "$MAIL" < $HPACUCLI_TMP
   #rm -f $HPACUCLI_TMP
  #else
  #echo "Everything Good"
   fi

2017年5月9日星期二

Centos 7 install SSH , LAMP(replace mariadb with Mysql-server) & webmin

Install SSH

yum -y install openssh*

after installation complete. start the service

service sshd start


------------------------------------------------------------------------
Install LAMP

yum  -y  install  httpd  php  php-mysql  mariadb mariadb-server

Set MARIADB start when boot and start now

systemctl start mariadb
systemctl enable mariadb
Set Apache start when boot and start now

systemctl start httpd.service
systemctl enable httpd.service
After that , double check the firewall setting to make sure ports are opened correctly.

Edit use this command
vi /etc/sysconfig/iptables

After edit , please restart the service again
/etc/init.d/iptables restart

Double check the firewall status
/sbin/iptables -L -n

---------------------------------------------------------

Download Webmin & install (Remarks, please install & start all service for LAMP before install webmin)

wget http://prdownloads.sourceforge.net/webadmin/webmin-1.831-1.noarch.rpm

then install optional dependencies with :

yum -y install perl perl-Net-SSLeay openssl perl-IO-Tty

and then run the command :

rpm -U webmin-1.831-1.noarch.rpm

more details can be find at :
http://www.webmin.com/rpm.html

2017年3月8日星期三

BOOT Repair for Linux

Boot Ubuntu live CD

Start a terminal and 
 
To add boot-repair to the repository
sudo add-apt-repository ppa:yannubuntu/boot-repair

To Update your repository
sudo apt-get update

To install boot-repair
sudo apt-get install -y boot-repair
Once Installation complete run boot-repair on terminal by typing the following command.
boot-repair