实施小记之服务器安装系统启动后报错no bootdevice

最近,因为项目需要,把在运行的某个服务器重新安装了RHEL6.6系统,但是安装完重启后,都报no boot d…


Zookeeper和kafka集群搭建博客收集(转载自CSDN)

Zookeeper和kafka集群搭建,博客收集  http://blog.csdn.net/my_bai/a…


(转载)下载RPM包及其依赖包的方法

1.yuminstall –downloadonly –downloaddir=&lt…


简单的Linux主机监控脚本

参照网上的脚本写了一个简单的主机监控脚本。功能主要是安装脚本到指定目录;运行脚本显示系统主要的信息。效果如下:

QQ截图201609042

 

 

 

 

 

 

 

脚本如下:

#! /bin/bash
# tecmint_monitor version 0.2
# Released Under Apache 2.0 License
while getopts ivh name
do
case $name in
i)iopt=1;;
v)vopt=1;;
h)hopt=1;;
*)echo “invalid arg”;;
esac
done

if [ $iopt ];then
{
scriptname=$0;
#installation for the monitor.sh
# if [ -e /usr/bin/monitor ];then
# {
# echo “you have already installed the monitor.sh! ” && exit 1
# }
# fi
echo “Now you are need to input the root’s password to install the monitor.sh”
su -c “cp $scriptname /usr/bin/monitor” root && echo “Installation for monitor.sh success!” || echo “Installation failed!”
}
fi

if [ ! -z $vopt ];then
{
sed -n ‘2,3 p’ $0
}
fi

if [ ! -z $hopt ];then
{
echo -e ” -i Install script”
echo -e ” -v Print Version Info and exit”
echo -e ” -h Print help and exit”
}
fi
echo “args’number is : $#”
if [ $# -eq 0 ];then
{
clear
unset tecreset os architecture kernetrelease internalip externalip nameservers loadaverage
#define variable tecreset
tecreset=$(tput sgr0) #which will reset the screen printing to nomal
#Check Internet
ping www.baidu.com -c 3 &> /dev/null && echo -e ‘\E[32m'”Internet: $tecreset Connected” || echo -e ‘\E[32m'”Internet: $tecreset Disconnected”

#Check the system type
ostype=$(uname -o)
echo -e ‘\E[32m'”Operating System Type:” $tecreset $ostype

#Check OS Release Version and Name,Arch,Kernel Release
OS=`uname -s`
REV=`uname -r`
ARCH=`uname -m`

if [ “${OS}” = “SunOS” ];then
OS=Solaris
ARCH=`uname -p`
OSSTR=”${OS} ${REV}(${ARCH} `uname -v`)”
elif [ “${OS}” = “AIX” ];then
OSSTR=”${OS} `oslevel` (`oslevel -r`)”
elif [ “${OS}” = “Linux” ];then
KERNEL=`uname -r`
if [ -f /etc/redhat-release ];then
DIST=’RedHat’
PSUEDONAME=`cat /etc/redhat-release| sed s/.*\(// | sed s/\)//`
REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/SuSE-release];then
DIST=`cat /etc/SuSE-release | tr “\n” ‘ ‘ | sed s/VERSION.*//`
REV=`cat /etc/SuSE-release | tr “\n” ‘ ‘ | sed s/.*=\ //`
elif [ -f /etc/mandrake-release ];then
DIST=’Mandrake’
PSUEDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s /\)//`
REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/debian_version ];then
DIST=”Debian `cat /etc/debian_version`”
REV=””
fi
if ${OSSTR} [ -f /etc/UnitedLinux-release ];then
DIST=”${DIST}[`cat /etc/UnitedLinux-release | tr “\n” ‘ ‘ | sed s/VERSION.*//`]”
fi

OSSTR=”${OS} ${DIST} ${REV} (${PSUEDONAME} ${KERNEL} ${ARCH})”
fi
################
echo -e ‘\E[32m'”OS Version:” $tecreset $OSSTR

architecture=$(uname -m)
echo -e ‘\E[32m'”Architecture: $” $tecreset $architecture

kernelrelease=$(uname -r)
echo -e ‘\E[32m'”Kernel Release: $” $tecreset $kernelrelease

echo -e ‘\E[32m'”Hostname:” $tecreset $HOSTNAME

internalip=$(hostname -I)
echo -e ‘\E[32m'”Internal IP:” $tecreset $internalip

externalip=$(curl -s ipecho.net/plain;echo)
echo -e ‘\E[32m'”External IP :” $tecreset $externalip

nameservers=$(cat /etc/resolv.conf | sed ‘1 d’ | awk ‘{print $2}’)
echo -e ‘\E[32m'”Name Servers :” $tecreset $nameservers

[ ! -e /tmp/monitor ] && mkdir -p /tmp/monitor

who > /tmp/monitor/who
echo -e ‘\E[32m'”Logged In users :” $tecreset && cat /tmp/monitor/who

free -a | grep -v + > /tmp/monitor/ramcache
echo -e ‘\E[32m'”Ram Usages :” $tecreset
cat /tmp/monitor/ramcache | grep -v “Swap”
echo -e ‘\E[32m'”Swap Usages :” $tecreset
cat /tmp/monitor/ramcache | grep -v “Mem”

df -h | grep ‘Filesystem’ > /tmp/monitor/diskusage
df -h | grep ‘/dev/sda*’ >> /tmp/monitor/diskusage
echo -e ‘\E[32m'”Disk Usages :” $tecreset
cat /tmp/monitor/diskusage

loadaverage=$(top -n 1 -b | grep “load average:” | awk ‘{print $10 $11 $12}’ )
echo -e ‘\E[32m'”Load Average :” $tecreset $loadaverage

tecuptime=$(uptime | awk ‘{print $3,$4}’ | cut -f1 -d,)
echo -e ‘\E[32m'”System Uptime Days/(HH:MM) :” $tecreset $tecuptime

unset tecreset os architecture kernelrelease internalip externalip nameservers loadaverage
#delete the temp files
#rm /tmp/monitor/{who,ramcache,diskusage}
}
fi


MySQL主从复制原理以及架构(转载)

转载自 http://www.open-open.com/lib/view/open1373874692544…


Linux基础网络相关知识和命令(转载)

转载自: http://www.178linux.com/39163 1、  请描述网桥、集线器、二层交换机、…


select搭配case用法(常见于服务脚本的写法)

普通版:select var in list do 循环体 done 用户输入被保存在REPLY变量中 &nb…


转载 Ubuntu 14.04搭建ELK日志分析系统(Elasticsearch+Logstash+Kibana)

开源实时日志分析ELK平台能够实现日志的监控与分析,ELK由ElasticSearch、Logstash和Ki…


CentOS 6.5下利用Rsyslog+LogAnalyzer+MySQL部署日志服务器

转载自 cnblogs http://www.cnblogs.com/mchina/p/linux-cento…


zabbix监控系统客户端安装

转载自chinaunix http://blog.chinaunix.net/uid-25266990-id-…


详解zabbix安装部署(Server端篇) 转载自chinaunix

转载自chinaunix http://blog.chinaunix.net/uid-25266990-id-…


Shell脚本自动部署(编译)LAMP平台(转载)

转载自 运维部落 Net18-AnyISalIn Shell脚本自动部署(编译)LAMP平台 为什么要用脚本进…


VMware克隆Linux系统后,网络问题解决

VMware克隆Linux系统后,新系统网络问题Device eth0 dose not seem to be…


马哥Linux学习之编译—Nginx

Nginx是一个俄罗斯人开发的一个轻量级web服务器的开源软件,现在已经在Web服务器使用率排名第二了,因为其…


马哥Linux学习之DHCP架设篇

随着现在电脑办工的情况越来越多,每个职员的电脑上网都得使用一个唯一的IP地址,人为的管理、分配和设置IP显得很…


Linux之自动安装—Cobbler

在学习中,学了kickstart无人值守自动安装,觉得配置太繁琐,而且管理也不太方便。后面在看51 CTO的运…


在CentOS6上使用源码编译LAMP平台

最近在学习重要的Web服务,当然也就少不了很重要的httpd和php.而动态网站必定又会使用数据库如mysql…


ssh密钥登录-不用输入密码

做一个关于ssh登录类的总结吧,使用密钥无密码登录的。 实验环境:两台CentOS release 6.6 (…


分离式LAMP平台构建

LAMP平台是常用的动态网站平台,现在很多情况下,因为业务请求的原因需要把Apache服务、Mysql(Mar…


世界,你好!

欢迎使用WordPress。这是系统自动生成的演示文章。编辑或者删除它,然后开始您的博客!