当前位置: 建站>运营/SEO
本页文章导读:
▪显示grub引导菜单 有时候装了linux系统后,开机时无法显示引导菜单,原因是系统设置上隐藏了这个菜单,下面说明下如何显示:
1.编辑/etc/default/grub文件,将 GRUB_HIDDEN_TIMEOUT=0 这一行注释掉。
2.使用upda.........
▪nagios监控主机 1.安装依赖包,建立nagios用户,建立nagios软件目录
# yum -y httpd gcc glibc glibc-common gd gd-devel php
# useradd nagios
# mkdir /usr/local/nagios
# chown -R nagios.nagios /usr/local/nagios
2.下载安装nagi.........
▪linux各种数据流重定向
> :以覆盖的方法将『所有的数据』输出到指定的文件或装置上
1> :以覆盖的方法将『正确的数据』输出到指定的文件或装置上1>>:以累加的方法将『正确的数据』输出到指定的文.........
[1]显示grub引导菜单
来源: 互联网 发布时间: 2013-11-01
有时候装了linux系统后,开机时无法显示引导菜单,原因是系统设置上隐藏了这个菜单,下面说明下如何显示:
1.编辑/etc/default/grub文件,将 GRUB_HIDDEN_TIMEOUT=0 这一行注释掉。
2.使用update-grub命令更新配置
root@yanwenjie-vm:/home/yan# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.5.0-23-generic
Found initrd image: /boot/initrd.img-3.5.0-23-generic
Found memtest86+ image: /boot/memtest86+.bin
done
当看到done,就说明修改成功了,重新启动,引导菜单正常显示了。
作者:TODD911 发表于2013-8-13 16:33:07 原文链接
阅读:53 评论:0 查看评论
[2]nagios监控主机
来源: 互联网 发布时间: 2013-11-01
1.安装依赖包,建立nagios用户,建立nagios软件目录
# yum -y httpd gcc glibc glibc-common gd gd-devel php
# useradd nagios
# mkdir /usr/local/nagios
# chown -R nagios.nagios /usr/local/nagios
2.下载安装nagios相关包
http://sourceforge.net/projects/nagios/files/
nagios-3.2.2.tar.gz
nagios-plugins-1.4.16.tar.gz
nrpe-2.12.tar.gz
# tail -xvf /soft/nagios-3.2.2.tar.gz -C /usr/src
# cd /usr/src/nagios-3.2.2/
# ./configure --prefix=/usr/local/nagios
# make all && make install && make install-init && make install-commandmode && make install-config
# tar -xvf /soft/nagios-plugins-1.4.16.tar.gz -C /usr/src
# cd /usr/src/nagios-plugins-1.4.16/
# ./configure --prefix=/usr/local/nagios
# make && make install
# vi /etc/httpd/conf/httpd.conf
User apache
Group apache
修改为
User nagios
Group nagios
然后找到
DirectoryIndex index.html index.html.var
添加index.php修改为
DirectoryIndex index.html index.html.var index.php
再在其下增加如下行
AddType application/x-httpd-php .php
在配置文件末尾增加如下信息:
#setting for nagios
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
AuthType Basic
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
AuthType Basic
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>
3.新增验证文件,并重启apache和nagios服务
Re-type new password:
Adding password for user calvin
# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: [ OK ]
# vipw
修改最后一行为
nagios:x:500:501::/home/nagios:/bin/bash
# service nagios start
Starting nagios: done.
通过浏览器输入http://192.168.217.131/nagios/
4.开始配置监控其他机器
/usr/local/nagios/etc
# vi nagios.cfg
cfg_dir=/usr/local/nagios/etc/hosts
# mkdir hosts
# cd hosts
# vi linux.cfg
define host{
use linux-server
host_name wlstest.sink.com
alias wlstest.sink.com
address 192.168.217.130
}
define service{
use generic-service
host_name FZ-APP
service_description check-swap
check_command check_nrpe!check_swap
}
define service{
use generic-service
host_name FZ-APP
service_description check-load
check_command check_nrpe!check_load
}
define service{
use generic-service
host_name FZ-APP
service_description check-disk-sda3-usage
check_command check_nrpe!check_disk_sda3_usage
}
define service{
use generic-service
host_name FZ-APP
service_description check-users
check_command check_nrpe!check_users
}
define service{
use generic-service
host_name FZ-APP
service_description otal-procs
check_command check_nrpe!check_total_procs
}
define service{
use generic-service
host_name FZ-APP
service_description check-disk-sdb1-usage
check_command check_nrpe!check_disk_sdb1_usage
}
define service{
use generic-service
host_name FZ-APP
service_description check-diskio-sdb1
check_command check_nrpe!check_diskio_sdb1
&
# yum -y httpd gcc glibc glibc-common gd gd-devel php
# useradd nagios
# mkdir /usr/local/nagios
# chown -R nagios.nagios /usr/local/nagios
2.下载安装nagios相关包
http://sourceforge.net/projects/nagios/files/
nagios-3.2.2.tar.gz
nagios-plugins-1.4.16.tar.gz
nrpe-2.12.tar.gz
# tail -xvf /soft/nagios-3.2.2.tar.gz -C /usr/src
# cd /usr/src/nagios-3.2.2/
# ./configure --prefix=/usr/local/nagios
# make all && make install && make install-init && make install-commandmode && make install-config
# tar -xvf /soft/nagios-plugins-1.4.16.tar.gz -C /usr/src
# cd /usr/src/nagios-plugins-1.4.16/
# ./configure --prefix=/usr/local/nagios
# make && make install
# vi /etc/httpd/conf/httpd.conf
User apache
Group apache
修改为
User nagios
Group nagios
然后找到
DirectoryIndex index.html index.html.var
添加index.php修改为
DirectoryIndex index.html index.html.var index.php
再在其下增加如下行
AddType application/x-httpd-php .php
在配置文件末尾增加如下信息:
#setting for nagios
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
AuthType Basic
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>
Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">AuthType Basic
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>
3.新增验证文件,并重启apache和nagios服务
# /usr/bin/htpasswd -c /usr/local/nagios/etc/htpasswd calvin
New password:Re-type new password:
Adding password for user calvin
# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: [ OK ]
# vipw
修改最后一行为
nagios:x:500:501::/home/nagios:/bin/bash
# service nagios start
Starting nagios: done.
通过浏览器输入http://192.168.217.131/nagios/
4.开始配置监控其他机器
服务端配置:
# pwd/usr/local/nagios/etc
# vi nagios.cfg
cfg_dir=/usr/local/nagios/etc/hosts
# mkdir hosts
# cd hosts
# vi linux.cfg
define host{
use linux-server
host_name wlstest.sink.com
alias wlstest.sink.com
address 192.168.217.130
}
define service{
use generic-service
host_name FZ-APP
service_description check-swap
check_command check_nrpe!check_swap
}
define service{
use generic-service
host_name FZ-APP
service_description check-load
check_command check_nrpe!check_load
}
define service{
use generic-service
host_name FZ-APP
service_description check-disk-sda3-usage
check_command check_nrpe!check_disk_sda3_usage
}
define service{
use generic-service
host_name FZ-APP
service_description check-users
check_command check_nrpe!check_users
}
define service{
use generic-service
host_name FZ-APP
service_description otal-procs
check_command check_nrpe!check_total_procs
}
define service{
use generic-service
host_name FZ-APP
service_description check-disk-sdb1-usage
check_command check_nrpe!check_disk_sdb1_usage
}
define service{
use generic-service
host_name FZ-APP
service_description check-diskio-sdb1
check_command check_nrpe!check_diskio_sdb1
&
[3]linux各种数据流重定向
来源: 互联网 发布时间: 2013-11-01
- > :以覆盖的方法将『所有的数据』输出到指定的文件或装置上
- 1> :以覆盖的方法将『正确的数据』输出到指定的文件或装置上
- 1>>:以累加的方法将『正确的数据』输出到指定的文件或装置上
- 2> :以覆盖的方法将『错误的数据』输出到指定的文件或装置上
- 2>>:以累加的方法将『错误的数据』输出到指定的文件或装置上
- <:将原本需要由键盘输入的数据,改由文件内容来取代
- <<:代表的是『结束的输入字符』
例如:『我要用 cat 直接将输入的信息输出到 catfile 中, 且当由键盘输入 eof 时,该次输入就结束』,那我可以这样做:
[root@www ~]# cat > catfile << "eof" > This is a test. > OK now stop > eof <==输入这关键词,立刻就结束而不需要输入 [ctrl]+d [root@www ~]# cat catfile This is a test. OK now stop其中eof可以使用其他的任意字符串代替。
作者:TODD911 发表于2013-8-13 20:40:25 原文链接
阅读:15 评论:0 查看评论
最新技术文章: