29號早上9點對一臺Linux redhat 6 的VM(虛擬機)在調整CPU數(2->8)后發現,sar 查看當天CPU loading時,報錯:
[root@vswhInd4DBt ~]# sar
Invalid system activity file: /var/log/sa/sa29
查看SYSSTAT官網
http://sebastien.godard.pagesperso-orange.fr/faq.html
主要說可能是因為sysstat版本變化照成saxx文件(/var/log/sa/sa29)格式的變化,不兼容導致不可讀sarxx文件
Invalid system activity file: ...
You are trying to use a file which is not a system activity file, or whose format is no longer compatible with that of files created by current version of sar.
If you were trying to use the standard system activity files located in the /var/log/sa directory then the solution is easy: Just log in as root and remove by hand all the files located in the /var/log/sa directory:
#
rm /var/log/sa/sa??
If you are using sysstat 11.1.1 and later, you can also use the sadf command to convert an old system activity binary datafile (version 9.1.6 and later) to current up-to-date format. Use the following syntax:
$
sadf -c old_datafile > new_datafile
Note: Starting with sysstat version 8.1.1 and later, it is possible to know which version of sar or sadc has been used to create a data file. Just enter the following command:
$
sadf -H /your/datafile | grep sysstat
File created using sar/sadc from sysstat version 8.1.7
回到我的環境,sysstat版本并沒有變化。
懷疑因為CPU數的變化,導致saxx文件記錄及運算的變化,使saxx文件寫入失敗sar不可讀。
準備等30號再看是否正常,果然命令顯示正常:
[root@vswhInd4DBt ~]# sar
Linux 2.6.32-504.el6.x86_64 (vswhInd4DBt) 07/30/2018 _x86_64_ (8 CPU)
12:00:01 AM CPU %user %nice %system %iowait %steal %idle
12:10:01 AM all 0.48 0.00 0.11 0.12 0.00 99.29
12:20:01 AM all 0.27 0.00 0.10 0.06 0.00 99.57
12:30:02 AM all 0.21 0.00 0.08 0.02 0.00 99.68
...
當然,在29號對CPU調整后rm -rf /var/log/sa/sa29 ,sar命令應該也能顯示出調整后的信息
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。