偶然想起的一套作業系統,以前也曾為此消磨過一段時間。
[@more@]使用虛擬機器來安裝
底下是安裝過程
花了一段時間才安裝起來,好像沒有什麼可以使用,當然不能與現在的作業系統相比。而且這一套 IBM OS/2 WARP 好像和我原來使用的不同,應該是 eComStation 才對,關於更多 IBM OS/2 WARP,可以查看 OS/2 – 維基百科,自由的百科全書。
全新的繁體中文 WordPress 網站《宜蘭部落格教育平台 網站》
偶然想起的一套作業系統,以前也曾為此消磨過一段時間。
[@more@]使用虛擬機器來安裝
底下是安裝過程
花了一段時間才安裝起來,好像沒有什麼可以使用,當然不能與現在的作業系統相比。而且這一套 IBM OS/2 WARP 好像和我原來使用的不同,應該是 eComStation 才對,關於更多 IBM OS/2 WARP,可以查看 OS/2 – 維基百科,自由的百科全書。
1. 安裝及修改完 OpenVPN,要啟動時,卻出現錯誤
# systemctl start openvpn@server.service
Job for openvpn@server.service failed because the control process exited with error code. See “systemctl status openvpn@server.service” and “journalctl -xe” for details.
2. 檢查 OpenVPN 服務狀態
# systemctl status openvpn@server.service
● openvpn@server.service – OpenVPN Robust And Highly Flexible Tunneling Application On server
Loaded: loaded (/usr/lib/systemd/system/openvpn@.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 二 2016-08-16 11:31:37 CST; 5min ago
Process: 1883 ExecStart=/usr/sbin/openvpn –daemon –writepid /var/run/openvpn/%i.pid –cd /etc/openvpn/ –config %i.conf (code=exited, status=1/FAILURE)
Main PID: 1845 (code=exited, status=0/SUCCESS)
8月 16 11:31:37 xxxxx.sytes.net systemd[1]: Starting OpenVPN Robust And Highly Flexible Tunneling Application On server…
8月 16 11:31:37 xxxxx.sytes.net openvpn[1883]: Options error: In [CMD-LINE]:1: Error opening configuration file: server.conf
8月 16 11:31:37 xxxxx.sytes.net openvpn[1883]: Use –help for more information.
8月 16 11:31:37 xxxxx.sytes.net systemd[1]: openvpn@server.service: control process exited, code=exited status=1
8月 16 11:31:37 xxxxx.sytes.net systemd[1]: Failed to start OpenVPN Robust And Highly Flexible Tunneling Application On server.
8月 16 11:31:37 xxxxx.sytes.net systemd[1]: Unit openvpn@server.service entered failed state.
8月 16 11:31:37 xxxxx.sytes.net systemd[1]: openvpn@server.service failed.
[@more@]3. 另外一種檢查方式
# journalctl -xe
— Unit openvpn@server.service has begun starting up.
8月 16 11:31:37 xxxxx.sytes.net openvpn[1883]: Options error: In [CMD-LINE]:1: Error opening configuration file: server.conf
8月 16 11:31:37 xxxxx.sytes.net openvpn[1883]: Use –help for more information.
8月 16 11:31:37 xxxxx.sytes.net systemd[1]: openvpn@server.service: control process exited, code=exited status=1
8月 16 11:31:37 xxxxx.sytes.net systemd[1]: Failed to start OpenVPN Robust And Highly Flexible Tunneling Application On server.
— Subject: Unit openvpn@server.service has failed
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit openvpn@server.service has failed.
—
— The result is failed.
8月 16 11:31:37 xxxxx.sytes.net systemd[1]: Unit openvpn@server.service entered failed state.
8月 16 11:31:37 xxxxx.sytes.net systemd[1]: openvpn@server.service failed.
8月 16 11:31:37 xxxxx.sytes.net polkitd[1816]: Unregistered Authentication Agent for unix-process:1878:1286078 (system bus name :1.37, object path /
看訊息似乎是無法開啟 /etc/openvpn/server.conf 設定檔
4. 檢查 /etc/openvpn/server.conf 檔案是否存在
# ls -l /etc/openvpn/server.conf
-rw-r–r–. 1 root root 10441 8月 16 11:30 /etc/openvpn/server.conf
5. 檔案正常存在,因為這一台 Server 有開啟 SELinux,所以檢查檔案的屬性
# ls -lZ /etc/openvpn/server.conf*
-rw-r–r–. root root unconfined_u:object_r:admin_home_t:s0 /etc/openvpn/server.conf
-rw-r–r–. root root unconfined_u:object_r:openvpn_etc_t:s0 /etc/openvpn/server.conf.20160816
6. 修改屬性
# chcon -t openvpn_etc_t /etc/openvpn/server.conf
7. 再檢查一次
# ls -lZ /etc/openvpn/server.conf*
-rw-r–r–. root root unconfined_u:object_r:openvpn_etc_t:s0 /etc/openvpn/server.conf
-rw-r–r–. root root unconfined_u:object_r:openvpn_etc_t:s0 /etc/openvpn/server.conf.20160816
8. 啟動 OpenVPN 服務
# systemctl start openvpn@server.service
# systemctl status openvpn@server.service
● openvpn@server.service – OpenVPN Robust And Highly Flexible Tunneling Application On server
Loaded: loaded (/usr/lib/systemd/system/openvpn@.service; enabled; vendor preset: disabled)
Active: active (running) since 二 2016-08-16 11:49:11 CST; 10s ago
Process: 1934 ExecStart=/usr/sbin/openvpn –daemon –writepid /var/run/openvpn/%i.pid –cd /etc/openvpn/ –config %i.conf (code=exited, status=0/SUCCESS)
Main PID: 1935 (openvpn)
CGroup: /system.slice/system-openvpn.slice/openvpn@server.service
mq1935 /usr/sbin/openvpn –daemon –writepid /var/run/openvpn/server.pid –cd /etc/openvpn/ –config server.conf
8月 16 11:49:11 xxxxx.sytes.net openvpn[1935]: GID set to nobody
8月 16 11:49:11 xxxxx.sytes.net openvpn[1935]: UID set to nobody
8月 16 11:49:11 xxxxx.sytes.net openvpn[1935]: Listening for incoming TCP connection on [undef]
8月 16 11:49:11 xxxxx.sytes.net openvpn[1935]: TCPv4_SERVER link local (bound): [undef]
8月 16 11:49:11 xxxxx.sytes.net openvpn[1935]: TCPv4_SERVER link remote: [undef]
8月 16 11:49:11 xxxxx.sytes.net openvpn[1935]: MULTI: multi_init called, r=256 v=256
8月 16 11:49:11 xxxxx.sytes.net openvpn[1935]: IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
8月 16 11:49:11 xxxxx.sytes.net openvpn[1935]: IFCONFIG POOL LIST
8月 16 11:49:11 xxxxx.sytes.net openvpn[1935]: MULTI: TCP INIT maxclients=10 maxevents=14
8月 16 11:49:11 xxxxx.sytes.net openvpn[1935]: Initialization Sequence Completed
因為 /etc/openvpn/server.conf 是我直接複製別台修改好的設定檔,所以才會出現這樣的問題,也提醒自己使用 SELinux 應該注意的事項。
參考網頁:
建立只發送Mail的Mail Server – iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天
因為需要查看系統的 Log ,所以想要利用 gmail,將系統產生的 Log 檔,寄送到指定的信箱。
1. 安裝 ssmtp 套件
# yum install ssmtp
2.備份原設定檔 /etc/ssmtp/ssmtp.conf
# cp /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp.conf.$(date +%F)[@more@]3. 修改 /etc/ssmtp/ssmtp.conf 設定檔
# egrep -v ‘^$|^#’ /etc/ssmtp/ssmtp.conf
root=postmaster
mailhub=smtp.gmail.com:587
Hostname=xxxxx.sytes.net
AuthUser=xxxxx@gmail.com
AuthPass=xxxxx
FromLineOverride=YES
UseTLS=YES
UseSTARTTLS=Yes
TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt
4. 更改檔案權限
# chmod 600 /etc/ssmtp/ssmtp.conf
5. 測試是否可以正常使用
# echo “Testing” | mail -s “Test Email” yourname@gmail.com
6. 如果還有安裝其它的 Mail Server,就要設定系統使用的 MTA
# alternatives –config mta
有 2 個程式提供「mta」。
選擇 指令
———————————————–
*+ 1 /usr/sbin/sendmail.postfix
2 /usr/sbin/sendmail.ssmtp
請輸入以保留目前的選擇[+],或輸入選擇號碼:2
表單使用 Gmail 當 SMTP
啟用「安全性較低的應用程式存取權限」
https://www.google.com/settings/security/lesssecureapps
執行 logwatch 時出現如下的錯誤訊息
# logwatch –output stdout
logwatch: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol
logwatch: warning: inet_protocols: configuring for IPv4 support only
看起來問題似乎是 IPv6 被取消了,這是因為在家裡用不到。[@more@]解決方式:
參考網站:
email – “IPv6 support is disabled” warnings – Unix & Linux Stack Exchange
1. 備份原設定檔
# cp /etc/postfix/main.cf /etc/postfix/main.cf.$(date +%F)
2. 將 inet_protocols = all 改成 inet_protocols = ipv4
# sed -i ‘s/^(inet_protocols = ).*$/1”ipv4/’ /etc/postfix/main.cf
3. 重新啟動 postfix 服務
# systemctl restart postfix
4. 檢查一下
# logwatch –output stdout
可以從 說明 / 關於 Firefox(A) 升級
[@more@]直接下載新的版本安裝
Windows 版本:
x86 版本
http://ftp.mozilla.org/pub/firefox/releases/48.0.2/win32/zh-TW/Firefox%20Setup%2048.0.2.exe
x64 版本
http://ftp.mozilla.org/pub/firefox/releases/48.0.2/win64/zh-TW/Firefox%20Setup%2048.0.2.exe
Mac 版本:
http://ftp.mozilla.org/pub/firefox/releases/48.0.2/mac/zh-TW/Firefox%2048.0.2.dmg
參考網站:
CentOS 7 install OpenVPN @ 回憶……! :: 痞客邦 PIXNET ::
CentOS 7 安裝 OpenVPN Server – Linux 技術手札
1. 安裝 epel 套件庫
# yum install epel-release
2. 安裝 OpenVPN 套件
# yum install openvpn
3. 安裝 Easy RSA 套件,之後要產生 Key 的
# yum install easy-rsa[@more@]4. 複製 server.conf 的範例檔至 openvpn 設定檔目錄
# cp /usr/share/doc/openvpn-*/sample/sample-config-files/server.conf /etc/openvpn
5. 備份原設定檔
# cp /etc/openvpn/server.conf /etc/openvpn/server.conf.$(date +%F)
6. 修改 /etc/openvpn/server.conf 設定檔
# egrep -v “^#|^$|^;” /etc/openvpn/server.conf
port 1194
proto tcp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push “route 10.8.0.0 255.255.255.0”
push “redirect-gateway def1 bypass-dhcp”
push “dhcp-option DNS 168.95.1.1”
push “dhcp-option DNS 8.8.8.8”
client-to-client
duplicate-cn
keepalive 10 120
tls-auth ta.key 0 # This file is secret
comp-lzo
max-clients 10
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
verb 3
7. 建立 Easy RSA 要產生 Key 的目錄
# mkdir -p /etc/openvpn/easy-rsa/keys
8. 複製 Easy RSA 範例檔至 Easy RSA 設定檔目錄
# cp -rf /usr/share/easy-rsa/2.0/* /etc/openvpn/easy-rsa
9. 請情況修改 /etc/openvpn/easy-rsa/vars 中的變數
export KEY_COUNTRY=”US”
export KEY_PROVINCE=”CA”
export KEY_CITY=”SanFrancisco”
export KEY_ORG=”Fort-Funston”
export KEY_EMAIL=”me@myhost.mydomain”
export KEY_OU=”MyOrganizationalUnit”
# X509 Subject Field
export KEY_NAME=”EasyRSA”
10. 以下為開始做建立憑證的動作:
# cp /etc/openvpn/easy-rsa/openssl-1.0.0.cnf /etc/openvpn/easy-rsa/openssl.cnf
# cd /etc/openvpn/easy-rsa
# source ./vars
NOTE: If you run ./clean-all, I will be doing a rm -rf on /etc/openvpn/easy-rsa/keys
# ./clean-all
# ./build-ca
# ./build-key-server server
# ./build-dh
# cd /etc/openvpn/easy-rsa/keys
# cp dh2048.pem ca.crt server.crt server.key /etc/openvpn
# cd /etc/openvpn/easy-rsa
# ./build-key client
11. 產生 ta.key
# cd /etc/openvpn/
# openvpn –genkey –secret ta.key
12. 安裝 iptables 的相關 packages 與設定 iptables
# yum install iptables-services -y
# systemctl mask firewalld
# systemctl enable iptables
Created symlink from /etc/systemd/system/basic.target.wants/iptables.service to /usr/lib/systemd/system/iptables.service.
# systemctl stop firewalld
# systemctl start iptables
# iptables –flush
13. iptables 防火牆上的設定
將 Source IP range 為 10.8.0.0/24 的 IP 做 NAT 後,並由 ppp0 出去
# iptables -A FORWARD -i tun0 -s 10.8.0.0/24 -j ACCEPT
# iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o ppp0 -j MASQUERADE
# iptables-save > /etc/sysconfig/iptables
# systemctl restart iptables
14. 修改 /etc/sysctl.conf 設定
# vim /etc/sysctl.conf
—————————————–
......
net.ipv4.ip_forward = 1
......
—————————————–
15. 啟動 OpenVPN 服務,並設定開機時啟動
# systemctl start openvpn@server.service
# systemctl enable openvpn@server.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openvpn@server.service to /usr/lib/systemd/system/openvpn@.service.
16. 檢查 OpenVPN 服務狀態
# systemctl status openvpn@server.service
● openvpn@server.service – OpenVPN Robust And Highly Flexible Tunneling Application On server
Loaded: loaded (/usr/lib/systemd/system/openvpn@.service; enabled; vendor preset: disabled)
Active: active (running) since 日 2016-08-14 15:13:07 CST; 9s ago
Process: 2294 ExecStart=/usr/sbin/openvpn –daemon –writepid /var/run/openvpn/%i.pid –cd /etc/openvpn/ –config %i.conf (code=exited, status=0/SUCCESS)
Main PID: 2295 (openvpn)
CGroup: /system.slice/system-openvpn.slice/openvpn@server.service
mq2295 /usr/sbin/openvpn –daemon –writepid /var/run/openvpn/server.pid –cd /etc/openvpn/ –config server.conf
17. 檢查 OpenVPN 是否有正常啟動
# netstat -antulp | grep :1194
tcp 0 0 0.0.0.0:1194 0.0.0.0:* LISTEN 1039/openvpn
參考網站:
八克里: 在 CentOS 7 安裝 snmpd 服務(CentOS 7 SNMP install)
How To Install and Configure SNMP on RHEL 7 or CentOS 7
為了使用 cacti 和 nagios 來監測系統主機,隨時掌握主機及服務的存活狀態,所以加裝 snmpd 服務。
1. 安裝 snmpd 所需套件
# yum install net-snmp net-snmp-utils
2. 備份原設定檔 /etc/snmp/snmpd.conf
# cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.$(date +%F)[@more@]
3. 修改 /etc/snmp/snmpd.conf 設定檔
# grep -v “^$” /etc/snmp/snmpd.conf | grep -v ‘^ *#’
com2sec notConfigUser default public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
access notConfigGroup “” any noauth exact systemview none none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
或
將 41/47/48/55/56/62 行註解
# sed -i ’41s/^/#/’ /etc/snmp/snmpd.conf
# sed -i ’47s/^/#/’ /etc/snmp/snmpd.conf
# sed -i ’48s/^/#/’ /etc/snmp/snmpd.conf
# sed -i ’55s/^/#/’ /etc/snmp/snmpd.conf
# sed -i ’56s/^/#/’ /etc/snmp/snmpd.conf
# sed -i ’62s/^/#/’ /etc/snmp/snmpd.conf
取消 112,116~117,122~126,129~130,141~145,147 前面的註解
# sed -i ‘112s/^#//’ /etc/snmp/snmpd.conf
# sed -i ‘116,117s/^#//’ /etc/snmp/snmpd.conf
# sed -i ‘122,126s/^#//’ /etc/snmp/snmpd.conf
# sed -i ‘129,130s/^#//’ /etc/snmp/snmpd.conf
# sed -i ‘141,145s/^#//’ /etc/snmp/snmpd.conf
# sed -i ‘147s/^#//’ /etc/snmp/snmpd.conf
取消 151 行前面註解,並將rwview 改成 none
# sed -i -e ‘151s/^#//’ -e ‘s/rwview/none/’ /etc/snmp/snmpd.conf
4. 啟動 snmpd 服務及設定開機時啟動
# systemctl start snmpd.service
# systemctl enable snmpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/snmpd.service to /usr/lib/systemd/system/snmpd.service.
5. 檢查 snmpd 是否有正常啟動
# netstat -auntp | grep snmp
tcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN 1822/snmpd
udp 0 0 0.0.0.0:161 0.0.0.0:* 1822/snmpd
6. 防火牆上的設定,最好要設定可以連線的範圍
# firewall-cmd –permanent –add-port=161/udp
success
# firewall-cmd –reload
success
# firewall-cmd –list-all
public (default, active)
interfaces: eno16777736
sources:
services: dhcpv6-client ftp samba ssh
ports: 21/tcp 161/udp
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
7. 進行本機上的測試
# snmpwalk -v 1 -c public -O e 127.0.0.1
# snmpwalk -c public -v 2c 127.0.0.1
為了能更精確掌握硬碟的健康狀態,免得最後硬碟出現問題,不能用時才做處理,所以使用 smartd 服務。
參考網頁:
Smartctl – Monitoring & Analysis tool for Hard drive
Install SMART on CentOS 6.4 | Zwiegnet Blog
Linux 下用 smartd 监测硬盘状况 | vpsee.com
1. 安裝 smartmontools 套件
# yum install smartmontools
2. 啟動 smartd 服務及設定開機時啟動
# systemctl start smartd.service
# systemctl enable smartd.service[@more@]3. 檢查 smartd 服務狀態
# systemctl status smartd.service
● smartd.service – Self Monitoring and Reporting Technology (SMART) Daemon
Loaded: loaded (/usr/lib/systemd/system/smartd.service; enabled; vendor preset: enabled)
Active: active (running) since 日 2016-08-14 13:45:13 CST; 33s ago
Main PID: 2712 (smartd)
CGroup: /system.slice/smartd.service
mq2712 /usr/sbin/smartd -n -q never
8月 14 13:45:13 localhost.localdomain systemd[1]: Starting Self Monitoring and Reporting Technology (SMART) Daemon…
8月 14 13:45:13 localhost.localdomain smartd[2712]: smartd 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-327.28.2.el7.x86_64] (local build)
8月 14 13:45:13 localhost.localdomain smartd[2712]: Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
8月 14 13:45:13 localhost.localdomain smartd[2712]: Opened configuration file /etc/smartmontools/smartd.conf
8月 14 13:45:13 localhost.localdomain smartd[2712]: Configuration file /etc/smartmontools/smartd.conf was parsed, found DEVICESCAN, scanning devices
8月 14 13:45:13 localhost.localdomain smartd[2712]: Device: /dev/sda, opened
8月 14 13:45:13 localhost.localdomain smartd[2712]: Device: /dev/sda, [VMware, VMware Virtual S 1.0 ], 21.4 GB
8月 14 13:45:13 localhost.localdomain smartd[2712]: Device: /dev/sda, IE (SMART) not enabled, skip device
8月 14 13:45:13 localhost.localdomain smartd[2712]: Try ‘smartctl -s on /dev/sda’ to turn on SMART features
8月 14 13:45:13 localhost.localdomain smartd[2712]: Monitoring 0 ATA and 0 SCSI devices
4. 檢查硬碟資訊
# smartctl -i /dev/sda
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-327.28.2.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: TS128GSSD370S
Serial Number: xxxxx
Firmware Version: xxxxx
User Capacity: 128,035,676,160 bytes [128 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Sun Aug 14 13:49:10 2016 CST
SMART support is: Available – device has SMART capability.
SMART support is: Enabled
5. 顯示更詳盡的硬碟資訊
# smartctl -a -d ata /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-327.28.2.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: ST4000VN000-2AH166
Serial Number: xxxxx
LU WWN Device Id: xxxxx
Firmware Version: xxxxx
User Capacity: 4,000,787,030,016 bytes [4.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5980 rpm
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-3 (unknown minor revision code: 0x006d)
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Sun Aug 14 13:52:53 2016 CST
SMART support is: Available – device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 591) seconds.
Offline data collection
capabilities: (0x73) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 637) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x50bd) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 073 070 044 Pre-fail Always – 20940518
3 Spin_Up_Time 0x0003 095 095 000 Pre-fail Always – 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always – 6
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always – 0
7 Seek_Error_Rate 0x000f 064 060 045 Pre-fail Always – 2719493
9 Power_On_Hours 0x0032 100 100 000 Old_age Always – 14 (58 128 0)
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always – 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always – 6
184 End-to-End_Error 0x0032 100 100 099 Old_age Always – 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always – 0
188 Command_Timeout 0x0032 100 100 000 Old_age Always – 0
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always – 0
190 Airflow_Temperature_Cel 0x0022 065 058 040 Old_age Always – 35 (Min/Max 29/35)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always – 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always – 2
193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always – 24
194 Temperature_Celsius 0x0022 035 042 000 Old_age Always – 35 (0 27 0 0 0)
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always – 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline – 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always – 0
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline – 276698973077514
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline – 6425312
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline – 8038850139
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
6. 檢查硬碟狀況
# smartctl -H /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-327.28.2.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
7. 進行快速檢查
# smartctl -t short /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-327.28.2.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: “Execute SMART Short self-test routine immediately in off-line mode”.
Drive command “Execute SMART Short self-test routine immediately in off-line mode” successful.
Testing has begun.
Please wait 1 minutes for test to complete.
Test will complete after Sun Aug 14 13:59:57 2016
Use smartctl -X to abort test.
# smartctl -l selftest /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-327.28.2.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 14 –
設定檔
/etc/smartmontools/smartd.conf
為了方便遠端連線,所以為主機申請 No-IP 動態 DNS 服務。
1. 下載 noip x64 rpm
# wget ftp://ftp.pbone.net/mirror/atrpms.net/el7-x86_64/atrpms/stable/noip-2.1.9-8.el7.x86_64.rpm
2. 進行安裝
# rpm -ivh noip-2.1.9-8.el7.x86_64.rpm[@more@]3. 在 no-ip 網站申請並註冊
http://www.noip.com/
4. 進行設定
# /usr/bin/noip2 -C
Auto configuration for Linux client of no-ip.com.
Multiple network devices have been detected.
Please select the Internet interface from this list.
By typing the number associated with it.
0 eno16777736
1 ppp0
1 (要使用 no-ip 的網路介面)
Please enter the login/email string for no-ip.com xxxxx (在 no-ip 網站上註冊的帳號)
Please enter the password for user ‘xxxxx’ ************ (在 no-ip 網站上註冊的密碼)
Only one host [xxxxx.sytes.net] is registered to this account.
It will be used.
Please enter an update interval:[30]
Do you wish to run something at successful update?[N] (y/N) N
New configuration file ‘/etc/no-ip2.conf’ created.
5. 在 /etc/rc.d/rc.local 中加入下面一行
/usr/bin/noip2 &
# vim /etc/rc.d/rc.local
/usr/bin/noip2 &