title以太坊
『壹』 如何有效修改centos6.3 網卡名字 em0修改為eth0-history
1 修改grub.conf 最後添加 biosdevname=0
vim /etc/grub.conf
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-279.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-279.el6.x86_64 ro root=UUID=3dbe2570-4321-4af3-b108-87979ed32fdd rd_NO_LUKS rd_NO_LVM LANG=en_US.UT
F-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet biosdevname=0
initrd /initramfs-2.6.32-279.el6.x86_64.img
2 修改網卡配置名字
mv /etc/sysconfig/network-scripts/ifcfg-em0 /etc/sysconfig/network-scripts/eth0
3 修改網卡配置文件內網卡名稱
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.20.44
NETMASK=255.255.255.0
GATEWAY=192.168.20.254
ONBOOT=yes
TYPE=Ethernet
4 重啟伺服器
reboot
網卡名字就可以改過來了, /etc/udev/rules.d/70-persistent-net.rules 這里會產生這個文件,之前是沒有的。
『貳』 linux ubuntu8.10 網卡設置 目前死活連不上網需要把網卡設置成半功!
我覺得這個問題應該是很簡單的,你可以參考這里http://wiki.ubuntu.org.cn/index.php?title=UbuntuHelp:InternetHowto/zh&variant=zh-cn
說說我的看法:
我是今天剛剛刻盤安裝ubuntu的,安裝因為分區的錯誤理解,第三次才成功安裝。
然後,上網,什麼的,更新什麼的,我也都只花了不到三個小時就領會了。
我覺得一定要注意 的是:使用ubuntn的時候,一定不要用windows的思維方式來思考的,最多隻是參考那麼一點點。
上網的問題:應用程序(左上角第一個菜單)---附件---終端,然後在打開的頁面輸入sudo pppoeconf
然後,根據提示,來完成網卡的設置。
然後,每次需要連結的時候,就同樣在終端輸入pon dsl provider就可以上網了。
這些並不難 的。關鍵是不要鑽在牛角裡面出不來。
建議多在網路知道搜索下相關的問題,或者多看看官方的速配指南,不要急,慢慢的來。
Ubuntu 速配指南 http://wiki.ubuntu.org.cn/index.php?title=Qref/Intrepid&variant=zh-cn
『叄』 請教EM1和eth0的區別是什麼
在centos6.4之前,如果6.2,6.3安裝後網卡名稱都是em開始,如果想用eth0這種名稱,或者是自定義名稱,可以參照以下來實施。
第一步:修改/boot/grub/grub.conf
增加一個 biosdevname=0 的啟動參數
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-220.el6.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-220.el6.x86_64 ro root=UUID=6e7bf859-80f1-4875-8e8a-6f0fbdc9c90d nomodeset rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD quiet rhgb crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM biosdevname=0
initrd /boot/initramfs-2.6.32-220.el6.x86_64.img
第二步:修改當前網卡配置文件的名稱
mv ifcfg-em1 ifcfg-eth0
mv ifcfg-em2 ifcfg-eth1
第三步:修改網卡配置文件內容,把em1全部修改改為eth0
[root@xingfujie ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
IPADDR=XXXXX
PREFIX=24
GATEWAY=XXXXX
DNS1=XXXXX
DEFROUTE=yes
UUID=XXXXXX
HWADDR=XXXXXX
全部修改完畢後,reboot從起電腦即可。
『肆』 如何用MRTG檢測windows伺服器的CPU 內存 和網路流量
1、 安裝snmp
yum install net-snmp* -y
2、 修改/etc/snmpd.conf(可直接清空內容)
① 增加 rocommunity public
② 找到disk修改(df –k查看)可以有多個,看情況
disk / $size
disk /boot $size1
[disk /home $size2…]
3、 啟動
/etc/init.d/snmpd restart
4、 安裝mrtg
yum install mrtg* -y
5將以下內容寫到/etc/mrtg/mrtg.cfg,直接覆蓋(黃色背景需更改)
############################################################
# Multi Router Traffic Grapher -- Example Configuration File
############################################################
#
#Minimal mrtg.cfg
HtmlDir: /var/www/mrtg
ImageDir: /var/www/mrtg
LogDir: /var/lib/mrtg
ThreshDir: /var/lib/mrtg
#####################################################
#moniting LAN interface
#####################################################
Target[eth1_lan]: /10.0.0.99:public@localhost:
Options[eth1_lan]: growright
Directory[eth1_lan]: eth1
MaxBytes[eth1_lan]: 100000000
Kmg[eth1_lan]: K,M,G
YLegend[eth1_lan]: Bytes per Second
ShortLegend[eth1_lan]: B/s
Legend1[eth1_lan]: 每秒流入量 (單位 Bytes)
Legend2[eth1_lan]: 每秒流出量 (單位 Bytes)
LegendI[eth1_lan]: 流入:
LegendO[eth1_lan]: 流出:
Title[eth1_lan]: eth1網路流量[流入+流出]
PageTop[eth1_lan]: <h1>eth1網路流量[流入+流出]</h1>
###################################################
#Moniting CPU Load[use+free]
###################################################
Target[cpuload]: .1.3.6.1.4.1.2021.11.50.0&.1.3.6.1.4.1.2021.11.53.0:public@localhost:
Options[cpuload]: nopercent,growright
Directory[cpuload]: cpu
MaxBytes[cpuload]: 100
Unscaled[cpuload]: dwym
YLegend[cpuload]: CPU Utilization
ShortLegend[cpuload]: %
Legend1[cpuload]: CPU使用負載(%)
Legend2[cpuload]: CPU閑置(%)
LegendI[cpuload]: 使用:
LegendO[cpuload]: 閑置:
Title[cpuload]: CPU負載[使用+閑置]
PageTop[cpuload]: <h1>CPU負載[使用+閑置]</h1>
###################################################
#Moniting Used memory and Swap [Mem+Swap] free -k
###################################################
Target[memory]: .1.3.6.1.2.1.25.2.3.1.6.1&.1.3.6.1.2.1.25.2.3.1.6.3:public@localhost:
Options[memory]: gauge,growright
Directory[memory]: mem
MaxBytes1[memory]: 327252
MaxBytes2[memory]: 1023992
#MaxBytesX[memory]: 1023992可多個,看情況
Kmg[memory]: K,M,G
Kilo[memory]: 1024
Unscaled[memory]: dwym
YLegend[memory]: Mem Bytes
ShortLegend[memory]: B
Legend1[memory]: 已用Mem(Bytes)
Legend2[memory]: 已用Swap(Bytes)
LegendI[memory]: 已用Mem :
LegendO[memory]: 已用Swap:
Title[memory]: 內存使用量[Mem+Swap]
PageTop[memory]: <h1>內存使用量[Mem+Swap]</h1>
###################################################
#Moniting disk size [/+/boot] df -k
###################################################
Target[disk]: .1.3.6.1.4.1.2021.9.1.8.1&.1.3.6.1.4.1.2021.9.1.8.2:public@localhost:
Options[disk]: gauge,growright
Directory[disk]: disk
MaxBytes1[disk]: 11087104
MaxBytes2[disk]: 495844
Kmg[disk]: K,M,G
Kilo[disk]: 1024
Unscaled[disk]: dwym
YLegend[disk]: Disk Bytes
ShortLegend[disk]: B
Legend1[disk]: 根分區已用空間
Legend2[disk]: boot分區已用空間
LegendI[disk]: 根分區已用 :
LegendO[disk]: boot分區已用:
Title[disk]: 硬碟空間[根分區+boot分區]
PageTop[disk]: <h1>硬碟空間[根分區+boot分區]</h1>
6、 cp /etc/cron.d/mrtg /etc/mrtg/
7、vi /etc/mrtg/mrtg,改為以下內容:
#!/bin/bash
LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok
8、執行3次
/etc/mrtg/mrtg
/etc/mrtg/mrtg
/etc/mrtg/mrtg
9、執行
Indexmaker --output /var/www/mrtg/index.html –title=」System state Monitor」 /etc/mrtg/mrtg.cfg
10、修改apache配置文件httpd.conf
Alias /mrtg "/var/www/mrtg"
<Directory "/var/www/mrtg">
Options indexes
AllowOverride None
Order deny,allow
Deny from all
Allow from all
</Directory>
11、重啟httpd
12、訪問http://localhost/mrtg/
13、如出現亂碼,則改變編碼