📄 faq
字号:
This is sysstat's Frequently Asked Questions!Be sure to read this carefully before asking for help...If you don't find the solution to your problem here then send me an email(please remember to include sysstat's version number, a sample outputshowing the bug, and the contents of the /proc/stat file for your system.Also tell me what version your kernel is).1. GENERAL QUESTIONS1.1. When I compile sysstat, it fails with the following message: "make: msgfmt: Command not found".1.2. When I try to compile sysstat, it fails and says it cannot find some include files.1.3. I don't understand why sysstat displays the time sometimes as HH:MM:SS and sometimes as HH:MM:SS AM/PM... 2. QUESTIONS RELATING TO SAR/SADC/SADF2.1. The sar command complains with the following message: "Invalid system activity file: ...".2.2. The sar command complains with the following message: "Cannot append data to that file".2.3. The sar command complains with the following message: "Invalid data format".2.4. I get the following error message when I try to run sar: "Cannot open /var/log/sa/sa30: No such file or directory".2.5. Are sar daily data files fully compatible with Sun Solaris format sar files?2.6. I have some trouble running sar on my SMP box. My server crashes with a kernel oops.2.7. The "Average:" results from the sar command are just rubbish...2.8. My database (e.g. MySQL) doesn't appear to understand the time zone displayed by 'sadf -d'...2.9. I tried to use the -p option of the sadf command, together with the options -s and -e. Unfortunately, I have nothing displayed at all.2.10. I cannot see all my disks when I use the sar -d command...2.11. Do you know a tool which can graphically plot the data collected by sar?2.12. When I launch sadc, I get the error message: "flock: Resource temporarily unavailable".2.13. How should I run sysstat / sar so that I get a reading for 00:00:00?2.14. The sar command complains with the following message: "Requested activities not available in file".2.15. Does sar need a lot of resources to run?2.16. Are the measurements gathered by sadc cumulative or instantaneous?2.17. Some fields are always displayed as 0.00 when I use the sar -d command.3. QUESTIONS RELATING TO IOSTAT3.1. I can't see all my disks when I use the iostat command...3.2. iostat -x doesn't report disk I/O statistics...3.3. Why can't iostat display extended statistics for partitions with 2.6.x kernels?3.4. I don't understand the output of iostat. It doesn't match what I expect it to be...3.5. Why values displayed by iostat are so different in the first report from those displayed in subsequent ones?3.6. iostat -x displays huge numbers for some fields...1. GENERAL QUESTIONS####################1.1. When I compile sysstat, it fails with the following message:make: msgfmt: Command not foundmake: ***[locales] Error 127The msgfmt command belongs to the GNU gettext package.If you don't have it on your system, just answer 'n' (for "no") at thequestion"Enable National Language Support (NLS)? [y]"during config stage (make config), then compile sysstat as usual (make ;make install).Please read the README-nls file included in sysstat source package to learnsome more about National Language Support.~~~1.2. When I try to compile sysstat, it fails and says it cannot find someinclude files:In file included from /usr/include/bits/errno.h:25, from /usr/include/errno.h:36, from common.c:26:/usr/include/linux/errno.h:4: asm/errno.h: No such file or directory<SNIP>common.c: In function `get_kb_shift':common.c:180: `PAGE_SIZE' undeclared (first use in this function)common.c:178: warning: `size' might be used uninitialized in this functionmake: *** [common.o] Error 1Make sure that you have the Linux kernel sources installed in/usr/src/linux. Also make sure that the symbolic link exists in the/usr/src/linux/include directory and points to the right architecture, e.g.:# ll /usr/src/linux/include/asmlrwxrwxrwx 1 root root 8 May 5 18:31 /usr/src/linux/include/asm -> asm-i386In fact, only the Linux kernel headers should be necessary to be ableto compile sysstat.~~~1.3. I don't understand why sysstat displays the time sometimes as HH:MM:SSand sometimes as HH:MM:SS AM/PM...The time format used by sysstat tools depends on the locale of your system.The locale is defined by several environment variables, among which the LANGvariable is perhaps the most widely used. See the following example:$ export LANG=en_US$ sarLinux 2.4.9 (brooks.seringas.fr) 07/20/0404:32:11 PM LINUX RESTART05:00:00 PM CPU %user %nice %system %iowait %idle05:10:00 PM all 0.24 0.00 89.64 0.00 10.12Average: all 0.24 0.00 89.64 0.00 10.12$ export LANG=fr_FR$ sarLinux 2.4.9 (brooks.seringas.fr) 20.07.200416:32:11 LINUX RESTART17:00:00 CPU %user %nice %system %iowait %idle17:10:00 all 0,24 0,00 89,64 0,00 10,12Moyenne: all 0,24 0,00 89,64 0,00 10,12As you can notice, the time format but also the date, the decimal point, andeven some words (like "Average") have changed according to the specifiedlocale.2. QUESTIONS RELATING TO SAR/SADC/SADF######################################2.1. The sar command complains with the following message:Invalid system activity file: ...The format of the daily data files created by the sar command you arenow using is not compatible with the format of the files created by aprevious version of sar.The solution is easy: just log in as root and remove by hand all the fileslocated in the /var/log/sa directory:# rm /var/log/sa/sa??~~~2.2. The sar command complains with the following message:Cannot append data to that fileThe internal structure of the data file does not allow sar to appenddata to it. The data file may come from another machine, or the componentsof the current box, such as the number of processors, may have changed.Use another data file, or delete the current daily data file, and try again.~~~2.3. The sar command complains with the following message:Invalid data formatThis error message means that sadc (the system activity data collector thatsar is using) is not consistent with the sar command. In most cases this isbecause the sar and sadc commands do not belong to the same release of thesysstat package. Remember that sar may search for sadc in predefineddirectories (/usr/local/lib/sa, /usr/lib/sa, ...) before looking in thecurrent directory!~~~2.4. I get the following error message when I try to run sar:Cannot open /var/log/sa/sa30: No such file or directoryPlease read the sar(1) manual page! Daily data files are created in the/var/log/sa directory using the data collector (sadc) or using option-o with sar. Once they are created, sar can display statistics savedin those files.But sar can also display statistics collected "on the fly": just enterthe proper option on the command line to indicate which statistics areto be displayed, and also specify an <interval> and <count> number.E.g.:# sar 2 5 --> will report CPU utilization every two seconds, five times.# sar -n DEV 3 0 --> will report network device utilization every3 seconds, in an infinite loop.~~~2.5. Are sar daily data files fully compatible with Sun Solaris formatsar files?No, the format of the binary data files created by sysstat's sar commandis not compatible with formats from other Unixes, because it containsdata which are closely linked to Linux.For the same reason, sysstat cannot work on platforms other than Linux...~~~2.6. I have some trouble running sar on my SMP box. My server crasheswith a kernel oops:Feb 17 04:05:00 bolums1 kernel: Unable to handle kernel paging requestat virtual address fffffc1cFeb 17 04:05:00 bolums1 kernel: current->tss.cr3 = 19293000, %cr3 = 19293000Feb 17 04:05:00 bolums1 kernel: *pde = 0026b067Feb 17 04:05:00 bolums1 kernel: *pte = 00000000Feb 17 04:05:00 bolums1 kernel: Oops: 0000Feb 17 04:05:00 bolums1 kernel: CPU: 0Feb 17 04:05:00 bolums1 kernel: EIP:<...>The trouble you have is triggered by a *Linux* kernel bug, not a sysstatone... The best solution is to upgrade your kernel to the latest stablerelease.Also, if you cannot upgrade your box, try to compile sysstat afteranswering 'y' to the question:"Linux SMP race in serial driver workaround?"at the config stage (make config). Indeed, we found that 2.2.x kernels(with x <= 15) have an SMP race condition, which the sar commandmay trigger when it reads the /proc/tty/driver/serial file.~~~2.7. The "Average:" results from the sar command are just rubbish...E.g.: 11:00:00 AM CPU %user %nice %system %idle 11:10:00 AM all 0.54 0.00 0.89 98.57 11:20:01 AM all 3.02 8.05 22.85 66.08 11:30:01 AM all 8.15 0.00 2.31 89.54 11:40:01 AM all 8.03 0.00 2.42 89.55 11:50:01 AM all 16.04 0.00 2.81 81.16 12:00:00 PM all 21.11 0.00 3.23 75.66 03:40:01 PM all 100.01 100.01 100.01 0.00 04:40:00 PM all 100.00 0.00 100.00 0.00 04:50:00 PM all 5.87 0.00 1.26 92.87 05:00:00 PM all 4.70 0.00 1.48 93.82 05:10:00 PM all 4.93 0.00 1.29 93.78 Average: all 100.22 100.20 100.13 0.00Your sar command was not installed properly. Whenever your computeris restarted (as it is the case here between 12:00:00 PM and 03:40:01 PM),the 'sysstat' shell script must be called by the system, so that theLINUX RESTART message can be inserted into the daily data file, indicating
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -