8)后發(fā)現(xiàn),sar 查看當(dāng)天CPU loading時,報錯: [root@vswhInd4DBt ~]# sar Invalid syste..."/>
溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

因?yàn)镃PU數(shù)變化導(dǎo)致執(zhí)行sar命令報錯:Invalid system activity file: /var/log/sa/saxx

發(fā)布時間:2020-08-11 21:03:04 來源:ITPUB博客 閱讀:273 作者:guocun09 欄目:建站服務(wù)器

29號早上9點(diǎn)對一臺Linux redhat 6 的VM(虛擬機(jī))在調(diào)整CPU數(shù)(2->8)后發(fā)現(xiàn),sar 查看當(dāng)天CPU loading時,報錯:


[root@vswhInd4DBt ~]# sar

Invalid system activity file: /var/log/sa/sa29


查看SYSSTAT官網(wǎng)

http://sebastien.godard.pagesperso-orange.fr/faq.html

主要說可能是因?yàn)閟ysstat版本變化照成saxx文件(/var/log/sa/sa29)格式的變化,不兼容導(dǎo)致不可讀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


回到我的環(huán)境,sysstat版本并沒有變化。

懷疑因?yàn)镃PU數(shù)的變化,導(dǎo)致saxx文件記錄及運(yùn)算的變化,使saxx文件寫入失敗sar不可讀。


準(zhǔn)備等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

...

當(dāng)然,在29號對CPU調(diào)整后rm -rf /var/log/sa/sa29 ,sar命令應(yīng)該也能顯示出調(diào)整后的信息

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI