1. 程式人生 > >linux系統執行狀態檢查

linux系統執行狀態檢查

1 CPU狀態檢查

1.1 執行時間

資訊:

執行時間 / Uptime

工具:

uptime

示例:

[[email protected] ~]# uptime

 17:03:12 up 2 days, 20:08,  7 users,  load average: 0.06, 0.05, 0.00

處理方法:

        如小於預期,則深究

1.2 CPU佔用率

資訊:

CPU佔用率 / CPU Usage

工具:

sar -P ALL 2 5

#每隔兩秒對CPU的佔用率取樣一次,連續取樣五次,最後打印出CPU總的以及每個核的佔用情況

示例:

[[email protected] ~]# sar -P ALL 2 5

Linux 2.6.18-128.el5 (TVLD2)    10/20/2018

Average:          CPU     %user     %nice   %system   %iowait    %steal     %idle

Average:          all     17.42      0.00     17.92      0.00      0.00     64.66

Average:            0     19.20      0.00      4.80      0.00      0.00     76.00

Average:            1     23.30      0.00      8.30      0.00      0.00     68.40

Average:            2      6.20      0.00     45.40      0.00      0.00     48.40

Average:            3     21.08      0.00     13.09      0.00      0.00     65.83

計算方法:

        CPU佔用率 = 100% - %idle

 處理方法:

        如與預期不符或高於90%,則深究

1.3 單核佔用率

資訊:

單核佔用率 / Core Usage

工具:

sar -P ALL 2 5

#每隔兩秒對CPU的佔用率取樣一次,連續取樣五次,最後打印出CPU總的以及每個核的佔用情況

計算方法:

        CPU單核佔用率 = 100% - 單核%idle

處理方法:

        如與預期不符或高於90%,則深究

2 記憶體狀態檢查

2.1 記憶體佔用率

資訊:

記憶體佔用率 / Memory Usage

工具:

free

示例:

[[email protected] ~]# free

                                 total       used       free     shared    buffers     cached

Mem:                 510536     503232       7304          0      98656     297196

-/+ buffers/cache:                           107380     403156

Swap:                 1048568         0    1048568

計算方法:

        記憶體佔用率 = (used - buffers – cached) / total * 100%

處理方法:

        如與預期不符或高於90%,則深究

2.2 交換分割槽佔用率

資訊:

交換分割槽 / Swap Usage

工具:

free

示例:

[[email protected] ~]# free

                                 total       used       free     shared    buffers     cached

Mem:                 510536     503232       7304          0      98656     297196

-/+ buffers/cache:                           107380     403156

Swap:                 1048568         0    1048568

計算方法:

        記憶體佔用率 = (swap used / swap total ) * 100%

處理方法:

        如與預期不符或高於0%,則深究

3 磁碟狀態檢查

3.1 系統磁碟容量佔用率

資訊:

系統磁碟容量佔用率 / Sys Disk Usage

工具:

df -h

示例:

[[email protected] ~]# df -h

Filesystem             Size     Used    Avail    Use%     Mounted on

/dev/md0              902G    32G     824G      4%      /

tmpfs                 3.9G      0      3.9G      0%       /dev/shm

/dev/md1              9.9T     7.3T     2.2T     78%       /opt/fonsview/NE/vodld/data

統計方法:

        根據裝置名進行統計

        /dev/md0 4%

        /dev/md1 78%

處理方法:

        如與預期不符或高於95%,則深究

3.2 磁碟健康狀態

資訊:

磁碟健康狀態 / Health Check

工具:

fdisk -l               #獲取磁碟裝置名列表

smartctl -H /dev/sdX    #檢視具體磁碟的健康狀態

示例:

[[email protected] data]# smartctl -H /dev/sdc

smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===

SMART overall-health self-assessment test result: PASSED

[[email protected] data]# smartctl -Hc /dev/sda

smartctl 5.40 2010-10-16 r3189 [i686-pc-linux-gnu] (local build)

=== START OF READ SMART DATA SECTION ===

SMART overall-health self-assessment test result: FAILED!

Drive failure expected in less than 24 hours. SAVE ALL DATA.

Failed Attributes:

ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE

1  Raw_Read_Error_Rate 0x000f  035    030     051  Pre-fail  Always  FAILING_NOW     96231

取值:

        PASSED  表示磁碟健康

        FAILED   表示磁碟不健康

統計方法:

        根據裝置名顯示磁碟健康狀態

處理方法:

        如果FAILED!,立即更換磁碟

3.3 磁碟讀速率

資訊:

磁碟10秒內的平均讀速率 / Read Rate

工具:

sar -dp 2 5

示例:

[[email protected] data]# sar -dp 2 5

Linux 2.6.18-128.el5 (london.sz.fonsview.com)   10/20/2018

Average:          DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util

Average:          sda      7.60    420.80     70.40     64.63      0.04      5.50      4.43      3.37

Average:         sda1      7.60    420.80     70.40     64.63      0.04      5.50      4.43      3.37

Average:         sda2      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:          sdb      7.40    444.80     70.40     69.62      0.04      4.95      3.85      2.85

Average:         sdb1      7.40    444.80     70.40     69.62      0.04      4.95      3.85      2.85

Average:         sdb2      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:          sdc     16.20  16519.40      0.00   1019.72      0.14      8.37      7.38     11.96

Average:          sdd     15.50  15872.00      0.00   1024.00      0.15      9.86      7.59     11.76

Average:          sde     15.60  15974.40      0.00   1024.00      0.13      8.19      7.47     11.66

Average:          sdf     15.00  15261.90      0.00   1017.46      0.13      8.79      7.67     11.51

Average:          sdg     16.00  16300.10      0.00   1018.76      0.16     10.22      8.38     13.40

Average:          sdh     15.10  15116.70      0.00   1001.11      0.12      7.74      7.28     10.99

Average:          sdi     14.90  15257.60      0.00   1024.00      0.12      8.44      7.47     11.13

Average:          sdj     16.30  16659.60      0.00   1022.06      0.14      8.81      7.29     11.89

Average:          sdk     15.50  15872.00      0.00   1024.00      0.14      8.82      7.57     11.74

Average:          sdl     15.00  15168.20      0.00   1011.21      0.12      8.02      7.05     10.58

Average:          sdm     12.90  13169.80      0.00   1020.91      0.10      7.91      7.09      9.15

Average:          sdn     13.10  13414.40      0.00   1024.00      0.10      7.76      7.18      9.41

Average:          sdo     13.90  14233.60      0.00   1024.00      0.11      7.95      7.39     10.27

Average:          sdp     15.60  15974.40      0.00   1024.00      0.14      8.95      7.62     11.89

Average:          sdq     16.00  16288.10      0.00   1018.01      0.12      7.42      6.92     11.07

Average:          sdr     16.30  16691.20      0.00   1024.00      0.14      8.49      7.37     12.02

Average:          md0     16.10    865.60     60.80     57.54      0.00      0.00      0.00      0.00 

計算方法:

        磁碟讀速率 = (rd_sec/s) / 2

統計方法:

        顯示每塊磁碟10秒內的平均讀速率

處理方法:

        如與預期不符或大於50MB/s,則深究

3.4 磁碟寫速率

資訊:

磁碟10秒內的平均寫速率 / Write Rate

工具:

sar -dp 2 5 

示例:

[[email protected] data]# sar -dp 2 5

Linux 2.6.18-128.el5 (london.sz.fonsview.com)   10/20/2018

Average:          DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util

Average:          sda      7.60    420.80     70.40     64.63      0.04      5.50      4.43      3.37

Average:         sda1      7.60    420.80     70.40     64.63      0.04      5.50      4.43      3.37

Average:         sda2      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:          sdb      7.40    444.80     70.40     69.62      0.04      4.95      3.85      2.85

Average:         sdb1      7.40    444.80     70.40     69.62      0.04      4.95      3.85      2.85

Average:         sdb2      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:          sdc     16.20  16519.40      0.00   1019.72      0.14      8.37      7.38     11.96

Average:          sdd     15.50  15872.00      0.00   1024.00      0.15      9.86      7.59     11.76

Average:          sde     15.60  15974.40      0.00   1024.00      0.13      8.19      7.47     11.66

Average:          sdf     15.00  15261.90      0.00   1017.46      0.13      8.79      7.67     11.51

Average:          sdg     16.00  16300.10      0.00   1018.76      0.16     10.22      8.38     13.40

Average:          sdh     15.10  15116.70      0.00   1001.11      0.12      7.74      7.28     10.99

Average:          sdi     14.90  15257.60      0.00   1024.00      0.12      8.44      7.47     11.13

Average:          sdj     16.30  16659.60      0.00   1022.06      0.14      8.81      7.29     11.89

Average:          sdk     15.50  15872.00      0.00   1024.00      0.14      8.82      7.57     11.74

Average:          sdl     15.00  15168.20      0.00   1011.21      0.12      8.02      7.05     10.58

Average:          sdm     12.90  13169.80      0.00   1020.91      0.10      7.91      7.09      9.15

Average:          sdn     13.10  13414.40      0.00   1024.00      0.10      7.76      7.18      9.41

Average:          sdo     13.90  14233.60      0.00   1024.00      0.11      7.95      7.39     10.27

Average:          sdp     15.60  15974.40      0.00   1024.00      0.14      8.95      7.62     11.89

Average:          sdq     16.00  16288.10      0.00   1018.01      0.12      7.42      6.92     11.07

Average:          sdr     16.30  16691.20      0.00   1024.00      0.14      8.49      7.37     12.02

Average:          md0     16.10    865.60     60.80     57.54      0.00      0.00      0.00      0.00

計算方法:

        磁碟寫速率 = (wr_sec/s) / 2

統計方法:

        顯示每塊磁碟10秒內的平均寫速率

處理方法:

        如與預期不符或大於40MB/s,則深究

3.5 磁碟每秒IO數

資訊:

磁碟每秒IO數 / TPS

工具:

sar -dp 2 5     

示例:

[[email protected] data]# sar -dp 2 5

Linux 2.6.18-128.el5 (london.sz.fonsview.com)   10/20/2018

Average:          DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util

Average:          sda      7.60    420.80     70.40     64.63      0.04      5.50      4.43      3.37

Average:         sda1      7.60    420.80     70.40     64.63      0.04      5.50      4.43      3.37

Average:         sda2      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:          sdb      7.40    444.80     70.40     69.62      0.04      4.95      3.85      2.85

Average:         sdb1      7.40    444.80     70.40     69.62      0.04      4.95      3.85      2.85

Average:         sdb2      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:          sdc     16.20  16519.40      0.00   1019.72      0.14      8.37      7.38     11.96

Average:          sdd     15.50  15872.00      0.00   1024.00      0.15      9.86      7.59     11.76

Average:          sde     15.60  15974.40      0.00   1024.00      0.13      8.19      7.47     11.66

Average:          sdf     15.00  15261.90      0.00   1017.46      0.13      8.79      7.67     11.51

Average:          sdg     16.00  16300.10      0.00   1018.76      0.16     10.22      8.38     13.40

Average:          sdh     15.10  15116.70      0.00   1001.11      0.12      7.74      7.28     10.99

Average:          sdi     14.90  15257.60      0.00   1024.00      0.12      8.44      7.47     11.13

Average:          sdj     16.30  16659.60      0.00   1022.06      0.14      8.81      7.29     11.89

Average:          sdk     15.50  15872.00      0.00   1024.00      0.14      8.82      7.57     11.74

Average:          sdl     15.00  15168.20      0.00   1011.21      0.12      8.02      7.05     10.58

Average:          sdm     12.90  13169.80      0.00   1020.91      0.10      7.91      7.09      9.15

Average:          sdn     13.10  13414.40      0.00   1024.00      0.10      7.76      7.18      9.41

Average:          sdo     13.90  14233.60      0.00   1024.00      0.11      7.95      7.39     10.27

Average:          sdp     15.60  15974.40      0.00   1024.00      0.14      8.95      7.62     11.89

Average:          sdq     16.00  16288.10      0.00   1018.01      0.12      7.42      6.92     11.07

Average:          sdr     16.30  16691.20      0.00   1024.00      0.14      8.49      7.37     12.02

Average:          md0     16.10    865.60     60.80     57.54      0.00      0.00      0.00      0.00

統計方法:

        顯示每塊磁碟10秒內的平均每秒IO數

處理方法:

        如與預期不符或超過50,則深究

3.6 磁碟使用率

資訊:

磁碟使用率 / Disk Utilization

工具:

sar -dp 2 5     

示例:

[[email protected] data]# sar -dp 2 5

Linux 2.6.18-128.el5 (london.sz.fonsview.com)   10/20/2018

Average:          DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util

Average:          sda      7.60    420.80     70.40     64.63      0.04      5.50      4.43      3.37

Average:         sda1      7.60    420.80     70.40     64.63      0.04      5.50      4.43      3.37

Average:         sda2      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:          sdb      7.40    444.80     70.40     69.62      0.04      4.95      3.85      2.85

Average:         sdb1      7.40    444.80     70.40     69.62      0.04      4.95      3.85      2.85

Average:         sdb2      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:          sdc     16.20  16519.40      0.00   1019.72      0.14      8.37      7.38     11.96

Average:          sdd     15.50  15872.00      0.00   1024.00      0.15      9.86      7.59     11.76

Average:          sde     15.60  15974.40      0.00   1024.00      0.13      8.19      7.47     11.66

Average:          sdf     15.00  15261.90      0.00   1017.46      0.13      8.79      7.67     11.51

Average:          sdg     16.00  16300.10      0.00   1018.76      0.16     10.22      8.38     13.40

Average:          sdh     15.10  15116.70      0.00   1001.11      0.12      7.74      7.28     10.99

Average:          sdi     14.90  15257.60      0.00   1024.00      0.12      8.44      7.47     11.13

Average:          sdj     16.30  16659.60      0.00   1022.06      0.14      8.81      7.29     11.89

Average:          sdk     15.50  15872.00      0.00   1024.00      0.14      8.82      7.57     11.74

Average:          sdl     15.00  15168.20      0.00   1011.21      0.12      8.02      7.05     10.58

Average:          sdm     12.90  13169.80      0.00   1020.91      0.10      7.91      7.09      9.15

Average:          sdn     13.10  13414.40      0.00   1024.00      0.10      7.76      7.18      9.41

Average:          sdo     13.90  14233.60      0.00   1024.00      0.11      7.95      7.39     10.27

Average:          sdp     15.60  15974.40      0.00   1024.00      0.14      8.95      7.62     11.89

Average:          sdq     16.00  16288.10      0.00   1018.01      0.12      7.42      6.92     11.07

Average:          sdr     16.30  16691.20      0.00   1024.00      0.14      8.49      7.37     12.02

Average:          md0     16.10    865.60     60.80     57.54      0.00      0.00      0.00      0.00

計算方法:

        磁碟使用率 = %util

統計方法:

        顯示每塊磁碟10秒內的平均使用率

處理方法:

       如與預期不符或超過70%,則深究

4 網絡卡狀態檢查

4.1 網絡卡鏈路狀態

資訊:

網絡卡鏈路狀態 / Link Status

取值:

        yes 表示檢測到鏈路

        no  表示未檢測到鏈路

工具:

ip addr               #獲取網絡卡裝置名列表

ethtool ethX           #檢視具體網絡卡的狀態

示例:

[[email protected] root]# ethtool eth0

Settings for eth0:

        Supported ports: [ TP ]

        Supported link modes:   10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Full

        Supports auto-negotiation: Yes

        Advertised link modes:  10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Full

        Advertised auto-negotiation: Yes

        Speed: 1000Mb/s

        Duplex: Full

        Port: Twisted Pair

        PHYAD: 1

        Transceiver: internal

        Auto-negotiation: on

        Supports Wake-on: pumbag

        Wake-on: g

        Current message level: 0x00000001 (1)

        Link detected: yes

統計方法:

        顯示每塊網絡卡的鏈路狀態

處理方法:

        如與預期不符且未檢測到鏈路,則

a.檢查網線是否脫離網口

b.檢查網線的另一頭是否脫離網口

c.檢查網線的另一頭的機器是否關機

4.2 網絡卡啟用狀態

資訊:

網絡卡啟用狀態 / NIC Status  

取值:

        UP           表示網絡卡已啟用

       DOWN     表示網絡卡未啟用

工具:

ifconfig ethX           #檢視具體網絡卡的狀態

示例:

[[email protected] data]# ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 00:15:17:83:F1:58 

          inet addr:172.16.201.210  Bcast:172.16.201.255  Mask:255.255.255.0

          inet6 addr: fe80::215:17ff:fe83:f158/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:10223856 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1573906 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:10068100799 (9.3 GiB)  TX bytes:1008851902 (962.1 MiB)

          Memory:b8820000-b8840000

[[email protected] data]# ifconfig eth1

eth1      Link encap:Ethernet  HWaddr 00:25:90:1B:F1:5F 

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Memory:fbde0000-fbe00000

統計方法:

        顯示每塊網絡卡的啟用狀態

處理方法:

        如與預期不符且網絡卡DOWN,則嘗試ifup該網口

4.3 網絡卡速率

資訊:

網絡卡速率 / Speed

取值範圍:

1000Mb/s

100Mb/s

10Mb/s

Unknown!        表示網絡卡未啟用

工具:

ip addr               #獲取網絡卡裝置名列表

ethtool ethX           #檢視具體網絡卡的速率

示例:

[[email protected] root]# ethtool eth0

Settings for eth0:

        Supported ports: [ TP ]

        Supported link modes:   10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Full

        Supports auto-negotiation: Yes

        Advertised link modes:  10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Full

        Advertised auto-negotiation: Yes

        Speed: 1000Mb/s

        Duplex: Full

        Port: Twisted Pair

        PHYAD: 1

        Transceiver: internal

        Auto-negotiation: on

        Supports Wake-on: pumbag

        Wake-on: g

        Current message level: 0x00000001 (1)

        Link detected: yes

[[email protected] ~]# ethtool eth1

Settings for eth1:

        Supported ports: [ TP ]

        Supported link modes:   10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Half 1000baseT/Full

        Supports auto-negotiation: Yes

        Advertised link modes:  10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Half 1000baseT/Full

        Advertised auto-negotiation: Yes

        Speed: Unknown! (0)

        Duplex: Half

        Port: Twisted Pair

        PHYAD: 1

        Transceiver: internal

        Auto-negotiation: on

        Supports Wake-on: g

        Wake-on: g

        Current message level: 0x000000ff (255)

        Link detected: no

統計方法:

        顯示每塊網絡卡的速率

處理方法:

        如與預期不符,則重啟該網口,即先ifdown,再ifup該網口

4.4 網絡卡雙工狀態

資訊:

網絡卡雙工狀態 / Duplex

取值:

Full  表示全雙工

Half 表示半雙工

工具:

ip addr               #獲取網絡卡裝置名列表

ethtool ethX           #檢視具體網絡卡的速率

示例:

[[email protected] root]# ethtool eth0

Settings for eth0:

        Supported ports: [ TP ]

        Supported link modes:   10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Full

        Supports auto-negotiation: Yes

        Advertised link modes:  10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Full

        Advertised auto-negotiation: Yes

        Speed: 1000Mb/s

        Duplex: Full

        Port: Twisted Pair

        PHYAD: 1

        Transceiver: internal

        Auto-negotiation: on

        Supports Wake-on: pumbag

        Wake-on: g

        Current message level: 0x00000001 (1)

        Link detected: yes

統計方法:

        顯示每塊網絡卡雙工狀態

處理方法:

        如與預期不符,則深究

4.5 網絡卡傳送速率

資訊:

網絡卡傳送速率 /  txbyt/s

工具:

sar -n DEV 2 5

示例:

[[email protected] data]# sar -n DEV 2 5

Linux 2.6.18-128.el5 (london.sz.fonsview.com)   10/20/2011

Average:        IFACE   rxpck/s   txpck/s   rxbyt/s   txbyt/s   rxcmp/s   txcmp/s  rxmcst/s

Average:           lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:         eth0   5226.50  10013.40 383753.60 15166070.80      0.00      0.00     40.10

Average:         eth1   1394.40   7602.00  96752.80 11527150.00      0.00      0.00      0.10

Average:         eth2   4479.60   4537.30 307995.40 6881234.20      0.00      0.00      0.10

Average:         eth3   3038.80  11563.80 212539.60 17536266.00      0.00      0.00      0.10

Average:         eth4   2696.60   7827.60 184527.00 11871126.00      0.00      0.00      0.10

Average:         eth5   7789.00  18856.90 534560.60 28600892.20      0.00      0.00      0.10

Average:         sit0      0.00      0.00      0.00      0.00      0.00      0.00      0.00

計算方法:

        網絡卡傳送速率 = txbyt/s * 8

統計方法:

        顯示每塊網絡卡的傳送速率

4.5 網絡卡接收速率

資訊:

網絡卡接收速率 / rxbps

工具:

sar -n DEV 2 5

示例:

[[email protected] data]# sar -n DEV 2 5

Linux 2.6.18-128.el5 (london.sz.fonsview.com)   10/20/2011

Average:        IFACE   rxpck/s   txpck/s   rxbyt/s   txbyt/s   rxcmp/s   txcmp/s  rxmcst/s

Average:           lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:         eth0   5226.50  10013.40 383753.60 15166070.80      0.00      0.00     40.10

Average:         eth1   1394.40   7602.00  96752.80 11527150.00      0.00      0.00      0.10

Average:         eth2   4479.60   4537.30 307995.40 6881234.20      0.00      0.00      0.10

Average:         eth3   3038.80  11563.80 212539.60 17536266.00      0.00      0.00      0.10

Average:         eth4   2696.60   7827.60 184527.00 11871126.00      0.00      0.00      0.10

Average:         eth5   7789.00  18856.90 534560.60 28600892.20      0.00      0.00      0.10

Average:         sit0      0.00      0.00      0.00      0.00      0.00      0.00      0.00

計算方法:

        網絡卡接收速率 = rxbyt/s * 8

統計方法:

        顯示每塊網絡卡的接收速率

5 其他檢查

5.1 CORE檔案個數

資訊:

CORE檔案個數 / Core Files

工具:

ls -l /core*|wc -l

示例:

[[email protected] data]# ls -l /core*|wc -l

2

統計方法:

        顯示CORE檔案個數

處理方法:

        應用程式曾經出錯重啟,請深究。

5.2 時間同步狀態

資訊:

時間同步狀態 / NTP Syn Status

工具:

ntpq -p

示例:

同步成功:標有*號的行表示當前使用的伺服器

[[email protected] info_collector]# ntpq -pn          

     remote        refid           st  t  when  poll  reach   delay    offset     jitter

=========================================================================

*221.7.129.79      210.72.145.44    2  u   40    64    37   107.377   21.054    9.256

 210.72.145.44     .ACTS.          1  u  109   16     12   82.456    11.099   3.804

NTP服務未啟動:

[[email protected] info_collector]# ntpq -pn          

ntpq: read: Connection refused

同步不成功:

[[email protected] info_collector]# ntpq -pn 

[[email protected] info_collector]# ntpq -pn         

     remote           refid      st t when poll reach   delay   offset  jitter

==============================================================================

 221.7.129.79    210.72.145.44    2 u   22   64    7  116.205   37.519  18.623

 210.72.145.44   .INIT.          16 u    -   64    0    0.000    0.000   0.000

 202.120.2.101   61.153.197.226   3 u   24   64    7   52.665  112.022  11.560

 133.100.11.8    .GPS.            1 u   21   64    5  335.591   12.114   4.222

 66.92.68.246    .INIT.          16 u    -   64    0    0.000    0.000   0.000

取值:

        SYN:             同步

        UNSYN:          未同步

統計方法:

        顯示CORE檔案個數

處理方法:

        恢復正常時間同步

5.3 系統log日誌檢視

資訊:

 kernel 是否有Erro

工具:

vim /var/log/messages

事例:

主要檢視message日誌的 kernel 和應用程序日誌中是否有 erro 和異常的顯示,最常見的第三方應用軟體的相關如UCARP VRRP NTP等狀態變更都會有顯示,當磁碟、主機板在出現異常的時候也會有顯示。