備查用..
以後要認真看~~
sed 快速參考
http://sed.sourceforge.net/sed1line.txt (英文)
http://sed.sourceforge.net/sed1line_zh-CN.html (中文)
perl 參考
http://www.ibm.com/developerworks/linux/library/l-p102/index.html
備查用..
以後要認真看~~
sed 快速參考
http://sed.sourceforge.net/sed1line.txt (英文)
http://sed.sourceforge.net/sed1line_zh-CN.html (中文)
perl 參考
http://www.ibm.com/developerworks/linux/library/l-p102/index.html
How to check RHEL 5.x (or above) and IBM AIX NIC link status?
這個是滿實用的一個功能...
有時人不在機器旁邊又不確定線到底有沒有接,
又或是線到底有沒有感應到...就會派上用場了!
[xxooxp ~]# ethtool eth0 | egrep 'Link'
Link detected: yes
或是
[xxooxp ~]# mii-tool –v eth0
而在IBM AIX上,可透過下面的指令
root@aix61 / # netstat -v | egrep '(ETHERNET|Link)'
ETHERNET STATISTICS (ent3) :
Logical Port Link State: Up
Physical Port Link State: Down
ETHERNET STATISTICS (ent2) :
Logical Port Link State: Up
Physical Port Link State: Down
ETHERNET STATISTICS (ent0) :
Link Status : Up
ETHERNET STATISTICS (ent1) :
Link Status : UNKNOWN
標題有些繞舌...不過不影響我們的主題需求...
Linux上有個好用的指令叫做watch,
能夠持續的監控指令的輸出狀態,讓系統管理員能夠隨時嘗握狀況。
比方說我們想要監控 netstat -ant 的輸出狀況,隨時觀查連線狀態的變化。
則可以使用
# watch -d -n 1 ‘netstat –ant'
-n 表示每一秒更新一次輸出。
-d 表示將有變更的部份以高亮標示(Highlight)
輸出如下圖
可惜...在IBM AIX上沒有這個好東西...( AIX上的watch指令是別的奇怪用途..)
不過別擔心! 因為這種問題在網路上早就一堆解答了...
這篇只是把他們整理一下,方便日後查找而已 ;-)
其實也不難! 就是寫個迴圈來一直進行~
root@aix # cat watch.sh
#!/bin/ksh
#
# $1 = 監控的間隔時間,以秒為單位.
# $2 = 請將所有要輸入的指令以雙引號(")或單引號(')包起來.
#
# Exit the watch.sh use Ctrl + C
#
while true
do
clear
echo "Interval $1 sec, Command: $2"
eval $2
sleep $1
done
root@aix # #以下比方說要執行監控ls -l /home/user | grep .profile,每秒更新一次.
root@aix #
root@aix # ./watch.sh 1 "ls -l /home/user | egrep '.profile'"
參考資料如下:
Monitoring logs and command output
摘錄自 System Hardware information Center
POWER7 Accessing the ASMI using a web browser
POWER6 Accessing the ASMI using a web browser
POWER6及POWER7的共同注意事項:
If you plan to connect your server to your network, this PC or notebook temporarily connects directly to the server for setup purposes only. After setup, you can use any PC or notebook on your network that is running Netscape 9.0.0.4, Microsoft Internet Explorer 7.0, Opera 9.24, or Mozilla Firefox 2.0.0.11 as your ASMI console.
Note: Complete the following steps to disable the TLS 1.0 option in Microsoft Internet Explorer to access the ASMI using Microsoft Internet Explorer 7.0 running on Windows® XP:
- From the Tools menu in Microsoft Internet Explorer, select Internet Options.
- From the Internet Options window, click the Advanced tab.
- Clear the Use TLS 1.0 check box (in the Security category) and click OK.
POWER6及POWER7適用的ASMI Default IP
以下為POWER5專用
POWER5 Accessing the ASMI using a web browser
IBM 官方的 Log 蒐集工具,IBM Dynamic System Analysis (DSA) 可使用在 Linux, Windows, VMware ESX等平台。
而要蒐集 VMware ESXi 也是可以的,只要透過以下參數 (下列使用 Windows 版 DSA 示範):
以下是在命令提示字元:
C:\>ibm_utl_dsa_dsyt85t-3.40_portable_windows_x86-64.exe –h
注意下面這個參數的說明
--vmware-esxi <userid:password@IP [:port]>
Retrieve system information from the remote target system loaded
with VMWare Embedded Hypervisor.
C:\>ibm_utl_dsa_dsyt85t-3.40_portable_windows_x86-64.exe --vmware-esxi root:password@192.168.1.1
上例假設 ESXi 主機的帳號為 root 密碼為 password , @後為 ESXi 主機 IP。DSA 會使用 TCP 5989 與 ESXi 主機溝通。並將 Log 蒐集至本機的 C:\IBM_Support 目錄。
在 IBM 的系統中 System p 目前常用的一個詞,其實這不是單就字面上的”力量”,
而是由以下單字所組合而成的。
Performance Optimization With Enhanced RISC
MES是指 System p 伺服器的硬體更改 / 增加 / 或是升級,
使用 MES 升級系統的一個重要特色就是系統的序號不會改變。
也就是 Redundant Dual Active Controller (RDAC) for AIX
有時我們的程式會使用Unix timestamp來做為時間表示的方法,
Unix timestamp 也有人稱為 Unix time、POSIX time,
但不是每個人都能很快速的算出從GMT (格林威治) 1970年1月1日00時00分00秒 至今的秒數(應該沒人不同意吧?)。
為此在使用 Linux / Unix 的時候,就會想要快速的知道怎麼計算?
這邊有從網路上蒐集而來的方法,就來看看吧。
| # 轉換 Unix timestamp 為本地時間 (依系統時區)。 |
| [xxooxp@blogspot / ]# perl -le 'print scalar(localtime(1287234368))' |
| Sat Oct 16 21:06:08 2010 |
| # 轉換 Unix timestamp 為 GMT 時間。 |
| [xxooxp@blogspot / ]# perl -le 'print scalar(gmtime(1287234368))' |
| Sat Oct 16 13:06:08 2010 |
| # 按照本地時間 (依系統時區),計算出 Unix timestamp。 |
| [xxooxp@blogspot / ]# perl -le 'print time()' |
| 1287234778 |
| # 在 Linux 系統轉換 Unix timestamp 為本地時間更方便。 |
| [xxooxp@blogspot / ]# date –d @1287234778 |
| Sat Oct 16 21:12:58 CST 2010 |
參考資料:
Epoch & Unix Timestamp Conversion Tools
[xxooxp@blogspot / ]# info date
| Device | Port | IP | User | Password |
| BMC*1 M2*2 前 | MGMT | 10.1.1.97 | N / A | N / A |
| BMC M2 後 | MGMT | 169.254.95.118 | N / A | N / A |
| IMM*3 | MGMT | 192.168.70.125 | USERID | PASSW0RD |
| SAN Switch | 10.97.97.97 | admin | password | |
| SAN Switch | 10.77.77.77 | admin | password | |
| System Storage | Controller A Port 1 | 192.168.128.101 | N / A | N / A |
| System Storage | Controller A Port 2 | 192.168.129.101 | N / A | N / A |
| System Storage | Controller B Port 1 | 192.168.128.102 | N / A | N / A |
| System Storage | Controller B Port 2 | 192.168.129.102 | N / A | N / A |
| System p5 ASMI*4 | HMC1 | 192.168.2.147 | admin | admin |
| System p5 ASMI*4 | HMC2 | 192.168.3.147 | admin | admin |
| POWER 6 ASMI | HMC1 | 169.254.2.147 | adimn | admin |
| POWER 6 ASMI | HMC2 | 169.254.3.147 | admin | admin |
P.S
*1 IBM Baseboard Management Controller (BMC)。
*2 以 IBM System x3650 M2 為分界,管理IP是不同的。
*3 IBM Integrated Management Module (IMM)。
*4 Advanced System Management Interface (ASMI)。
VSS 與一般 Switch 相似處。
VSS 與一般 Switch 差異處。
VLAN 和 VSS 配合下,在官方的文件中,有下列幾種組合:
參考文件:
VMware Virtual Networking Concepts
VMware ESX Server 3: 802.1Q VLAN Solutions
VLAN Configuration on Virtual Switch, Physical Switch, and Virtual Machines