Useful Commands/System Status: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
(Created page with "{| class="wikitable" ! 情境 || 指令 |- | 觀察 CPU 使用狀態,每個 core 數據分開 || <source lang="bash"> vmstat -P 1 # FreeBSD mpstat -P ALL 1 # Linux </sou...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{| class="wikitable"
{| class="wikitable"
! 情境 || 指令
! Purpose || Command
|-
|-
| 觀察 CPU 使用狀態,每個 core 數據分開 ||
| Get Ubuntu version ||
<source lang="bash">
<syntaxhighlight lang="bash">
lsb_release -a
</syntaxhighlight>
|-
| Cet CPU usage by core. ||
<syntaxhighlight lang="bash">
vmstat -P 1    # FreeBSD
vmstat -P 1    # FreeBSD
mpstat -P ALL 1 # Linux
mpstat -P ALL 1 # Linux
</source>
</syntaxhighlight>
|-
|-
| 取得 SNMP v3 資訊<br/>(認證與傳輸都加密) ||
| Get info of SNMP v3 with encryption ||
<source lang="bash">
<syntaxhighlight lang="bash">
snmpwalk -v 3 -l authPriv -u ${USERNAME} \
snmpwalk -v 3 -l authPriv -u ${USERNAME} \
   -a SHA -A ${PASSWORD} \ # 密碼加密方式與密碼 (摘要演算法)
   -a SHA -A ${PASSWORD} \ # hash
   -x AES -X random123 \ # 傳輸加密方式與密鑰 (對稱加密演算法)
   -x AES -X random123 \   # cipher
   ${HOST} \
   ${HOST} \
   ${OID}
   ${OID}
</source>
</syntaxhighlight>
[http://www.alvestrand.no/objectid/top.html OID 查詢系統]
[http://www.alvestrand.no/objectid/top.html OID Query]
|-
|-
| 取得 SNMP v2 資訊 ||
| Get info of SNMP v2 ||
<source lang="bash">
<syntaxhighlight lang="bash">
snmpwalk -v2c -cpublic 192.168.93.172 system
snmpwalk -v2c -cpublic 192.168.93.172 system
</source>
</syntaxhighlight>
|}
|}

Latest revision as of 03:56, 22 July 2026

Purpose Command
Get Ubuntu version
lsb_release -a
Cet CPU usage by core.
vmstat -P 1     # FreeBSD
mpstat -P ALL 1 # Linux
Get info of SNMP v3 with encryption
snmpwalk -v 3 -l authPriv -u ${USERNAME} \
   -a SHA -A ${PASSWORD} \ # hash
   -x AES -X random123 \   # cipher
   ${HOST} \
   ${OID}

OID Query

Get info of SNMP v2
snmpwalk -v2c -cpublic 192.168.93.172 system