mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-15 01:50:08 +08:00
commit
daca8ade0c
@ -1,32 +1,32 @@
|
||||
RHCE 第三部分 - 如何使用 Linux 工具集产生和发送系统活动报告
|
||||
RHCE 系列(三):如何使用 Linux 工具集生成和发送系统活动报告
|
||||
================================================================================
|
||||
作为一个系统工程师,你经常需要生成一些显示系统资源利用率的报告,以便确保:1)正最佳利用它们,2)防止出现瓶颈,3)确保可扩展性,以及其它原因。
|
||||
作为一个系统工程师,你经常需要生成一些显示系统资源利用率的报告,以便确保:1)正在合理利用系统,2)防止出现瓶颈,3)确保可扩展性,以及其它原因。
|
||||
|
||||

|
||||
|
||||
RHCE 第三部分:监视 Linux 性能活动报告
|
||||
*RHCE 第三部分:监视 Linux 性能活动报告*
|
||||
|
||||
除了著名的用于检测磁盘、内存和 CPU 使用率的原生 Linux 工具 - 可以给出很多例子,红帽企业版 Linux 7 还提供了两个额外的工具集用于为你的报告增加可以收集的数据:sysstat 和 dstat。
|
||||
除了著名的用于检测磁盘、内存和 CPU 使用率的原生 Linux 工具 - 可以给出很多例子,红帽企业版 Linux 7 还提供了另外两个可以为你的报告更多数据的工具套装:sysstat 和 dstat。
|
||||
|
||||
在这篇文章中,我们会介绍两者,但首先让我们来回顾一下传统工具的使用。
|
||||
|
||||
### 原生 Linux 工具 ###
|
||||
|
||||
使用 df,你可以报告磁盘空间以及文件系统的 inode 使用情况。你需要监视两者,因为缺少磁盘空间会阻止你保存更多文件(甚至会导致系统崩溃),就像耗尽 inode 意味着你不能将文件链接到对应的数据结构,从而导致同样的结果:你不能将那些文件保存到磁盘中。
|
||||
使用 df,你可以报告磁盘空间以及文件系统的 inode 使用情况。你需要监视这两者,因为缺少磁盘空间会阻止你保存更多文件(甚至会导致系统崩溃),就像耗尽 inode 意味着你不能将文件链接到对应的数据结构,从而导致同样的结果:你不能将那些文件保存到磁盘中。
|
||||
|
||||
# df -h [以人类可读形式显示输出]
|
||||
# df -h --total [生成总计]
|
||||
|
||||

|
||||
|
||||
检查 Linux 总的磁盘使用
|
||||
*检查 Linux 总的磁盘使用*
|
||||
|
||||
# df -i [显示文件系统的 inode 数目]
|
||||
# df -i --total [生成总计]
|
||||
|
||||

|
||||
|
||||
检查 Linux 总的 inode 数目
|
||||
*检查 Linux 总的 inode 数目*
|
||||
|
||||
用 du,你可以估计文件、目录或文件系统的文件空间使用。
|
||||
|
||||
@ -37,7 +37,7 @@ RHCE 第三部分:监视 Linux 性能活动报告
|
||||
|
||||

|
||||
|
||||
检查 Linux 目录磁盘大小
|
||||
*检查 Linux 目录磁盘大小*
|
||||
|
||||
别错过了:
|
||||
|
||||
@ -56,7 +56,7 @@ RHCE 第三部分:监视 Linux 性能活动报告
|
||||
|
||||

|
||||
|
||||
检查 Linux 系统性能
|
||||
*检查 Linux 系统性能*
|
||||
|
||||
正如你从上面图片看到的,vmstat 的输出分为很多列:proc(process)、memory、swap、io、system、和 CPU。每个字段的意义可以在 vmstat man 手册的 FIELD DESCRIPTION 部分找到。
|
||||
|
||||
@ -66,20 +66,20 @@ RHCE 第三部分:监视 Linux 性能活动报告
|
||||
|
||||

|
||||
|
||||
Vmstat Linux 性能监视
|
||||
*Vmstat Linux 性能监视*
|
||||
|
||||
请注意当磁盘上的文件被更改时,活跃内存的数量增加,写到磁盘的块数目(bo)和属于用户进程的 CPU 时间(us)也是这样。
|
||||
|
||||
或者一个保存大文件到磁盘时(dsync 引发):
|
||||
或者直接保存一个大文件到磁盘时(由 dsync 标志引发):
|
||||
|
||||
# vmstat -a 1 5
|
||||
# dd if=/dev/zero of=dummy.out bs=1M count=1000 oflag=dsync
|
||||
|
||||

|
||||
|
||||
Vmstat Linux 磁盘性能监视
|
||||
*Vmstat Linux 磁盘性能监视*
|
||||
|
||||
在这个例子中,我们可以看到很大数目的块被写入到磁盘(bo),这正如预期的那样,同时 CPU 处理任务之前等待 IO 操作完成的时间(wa)也增加了。
|
||||
在这个例子中,我们可以看到大量的块被写入到磁盘(bo),这正如预期的那样,同时 CPU 处理任务之前等待 IO 操作完成的时间(wa)也增加了。
|
||||
|
||||
**别错过**: [Vmstat – Linux 性能监视][3]
|
||||
|
||||
@ -90,22 +90,22 @@ Vmstat Linux 磁盘性能监视
|
||||
sysstat 软件包包含以下工具:
|
||||
|
||||
- sar (收集、报告、或者保存系统活动信息)。
|
||||
- sadf (以多种方式显式 sar 收集的数据)。
|
||||
- sadf (以多种方式显示 sar 收集的数据)。
|
||||
- mpstat (报告处理器相关的统计信息)。
|
||||
- iostat (报告 CPU 统计信息和设备以及分区的 IO统计信息)。
|
||||
- pidstat (报告 Linux 任务统计信息)。
|
||||
- nfsiostat (报告 NFS 的输出/输出统计信息)。
|
||||
- cifsiostat (报告 CIFS 统计信息)
|
||||
- sa1 (收集并保存系统活动日常文件的二进制数据)。
|
||||
- sa2 (在 /var/log/sa 目录写每日报告)。
|
||||
- sa1 (收集并保存二进制数据到系统活动每日数据文件中)。
|
||||
- sa2 (在 /var/log/sa 目录写入每日报告)。
|
||||
|
||||
dstat 为这些工具提供的功能添加了一些额外的特性,以及更多的计数器和更大的灵活性。你可以通过运行 yum info sysstat 或者 yum info dstat 找到每个工具完整的介绍,或者安装完成后分别查看每个工具的 man 手册。
|
||||
dstat 比这些工具所提供的功能更多一些,并且提供了更多的计数器和更大的灵活性。你可以通过运行 yum info sysstat 或者 yum info dstat 找到每个工具完整的介绍,或者安装完成后分别查看每个工具的 man 手册。
|
||||
|
||||
安装两个软件包:
|
||||
|
||||
# yum update && yum install sysstat dstat
|
||||
|
||||
sysstat 主要的配置文件是 /etc/sysconfig/sysstat。你可以在该文件中找到下面的参数:
|
||||
sysstat 主要的配置文件是 `/etc/sysconfig/sysstat`。你可以在该文件中找到下面的参数:
|
||||
|
||||
# How long to keep log files (in days).
|
||||
# If value is greater than 28, then log files are kept in
|
||||
@ -119,17 +119,17 @@ sysstat 主要的配置文件是 /etc/sysconfig/sysstat。你可以在该文件
|
||||
# Compression program to use.
|
||||
ZIP="bzip2"
|
||||
|
||||
sysstat 安装完成后,/etc/cron.d/sysstat 中会添加和启用两个 cron 作业。第一个作业每 10 分钟运行系统活动计数工具并在 /var/log/sa/saXX 中保存报告,其中 XX 是该月的一天。
|
||||
sysstat 安装完成后,`/etc/cron.d/sysstat` 中会添加和启用两个 cron 任务。第一个任务每 10 分钟运行系统活动计数工具,并在 `/var/log/sa/saXX` 中保存报告,其中 XX 是该月的一天。
|
||||
|
||||
因此,/var/log/sa/sa05 会包括该月份第 5 天所有的系统活动报告。这里假设我们在上面的配置文件中对 HISTORY 变量使用默认的值:
|
||||
因此,`/var/log/sa/sa05` 会包括该月份第 5 天所有的系统活动报告。这里假设我们在上面的配置文件中对 HISTORY 变量使用默认的值:
|
||||
|
||||
*/10 * * * * root /usr/lib64/sa/sa1 1 1
|
||||
|
||||
第二个作业在每天夜间 11:53 生成每日进程计数总结并把它保存到 /var/log/sa/sarXX 文件,其中 XX 和之前例子中的含义相同:
|
||||
第二个任务在每天夜间 11:53 生成每日进程计数总结并把它保存到 `/var/log/sa/sarXX` 文件,其中 XX 和之前例子中的含义相同:
|
||||
|
||||
53 23 * * * root /usr/lib64/sa/sa2 -A
|
||||
|
||||
例如,你可能想要输出该月份第 6 天从上午 9:30 到晚上 5:30 的系统统计信息到一个 LibreOffice Calc 或 Microsoft Excel 可以查看的 .csv 文件(它也允许你创建表格和图片):
|
||||
例如,你可能想要输出该月份第 6 天从上午 9:30 到晚上 5:30 的系统统计信息到一个 LibreOffice Calc 或 Microsoft Excel 可以查看的 .csv 文件(这样就可以让你创建表格和图片了):
|
||||
|
||||
# sadf -s 09:30:00 -e 17:30:00 -dh /var/log/sa/sa06 -- | sed 's/;/,/g' > system_stats20150806.csv
|
||||
|
||||
@ -137,7 +137,7 @@ sysstat 安装完成后,/etc/cron.d/sysstat 中会添加和启用两个 cron
|
||||
|
||||

|
||||
|
||||
Linux 系统统计信息
|
||||
*Linux 系统统计信息*
|
||||
|
||||
最后,让我们看看 dstat 提供什么功能。请注意如果不带参数运行,dstat 默认使用 -cdngy(表示 CPU、磁盘、网络、内存页、和系统统计信息),并每秒添加一行(可以在任何时候用 Ctrl + C 中断执行):
|
||||
|
||||
@ -145,15 +145,15 @@ Linux 系统统计信息
|
||||
|
||||

|
||||
|
||||
Linux 磁盘统计检测
|
||||
*Linux 磁盘统计检测*
|
||||
|
||||
要输出统计信息到 .csv 文件,可以用 -output 标记后面跟一个文件名称。让我们来看看在 LibreOffice Calc 中该文件看起来是怎样的:
|
||||
|
||||

|
||||
|
||||
检测 Linux 统计信息输出
|
||||
*检测 Linux 统计信息输出*
|
||||
|
||||
我强烈建议你查看 dstat 的 man 手册,为了方便你的阅读用 PDF 格式包括本文以及 sysstat 的 man 手册。你会找到其它能帮助你创建自定义的详细系统活动报告的选项。
|
||||
为了更多的阅读体验,我强烈建议你查看 [dstat][5] 和 [sysstat][6] 的 pdf 格式 man 手册。你会找到其它能帮助你创建自定义的详细系统活动报告的选项。
|
||||
|
||||
**别错过**: [Sysstat – Linux 的使用活动检测工具][4]
|
||||
|
||||
@ -161,7 +161,7 @@ Linux 磁盘统计检测
|
||||
|
||||
在该指南中我们解释了如何使用 Linux 原生工具以及 RHEL 7 提供的特定工具来生成系统使用报告。在某种情况下,你可能像依赖最好的朋友那样依赖这些报告。
|
||||
|
||||
你很可能使用过这篇指南中我们没有介绍到的其它工具。如果真是这样的话,用下面的表格和社区中的其他成员一起分享吧,也可以是任何其它的建议/疑问/或者评论。
|
||||
你很可能使用过这篇指南中我们没有介绍到的其它工具。如果真是这样的话,用下面的表单和社区中的其他成员一起分享吧,也可以是任何其它的建议/疑问/或者评论。
|
||||
|
||||
我们期待你的回复。
|
||||
|
||||
@ -171,12 +171,14 @@ via: http://www.tecmint.com/linux-performance-monitoring-and-file-system-statist
|
||||
|
||||
作者:[Gabriel Cánepa][a]
|
||||
译者:[ictlyh](https://github.com/ictlyh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/gacanepa/
|
||||
[1]:http://www.tecmint.com/how-to-check-disk-space-in-linux/
|
||||
[1]:https://linux.cn/article-6466-1.html
|
||||
[2]:http://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/
|
||||
[3]:http://www.tecmint.com/linux-performance-monitoring-with-vmstat-and-iostat-commands/
|
||||
[4]:http://www.tecmint.com/install-sysstat-in-linux/
|
||||
[3]:https://linux.cn/article-4024-1.html
|
||||
[4]:https://linux.cn/article-4028-1.html
|
||||
[5]:http://www.tecmint.com/wp-content/pdf/dstat.pdf
|
||||
[6]:http://www.tecmint.com/wp-content/pdf/sysstat.pdf
|
@ -1,131 +0,0 @@
|
||||
translating wi-cuckoo
|
||||
Display Linux Distribution Logo ASCII Art In Terminal
|
||||
================================================================================
|
||||

|
||||
|
||||
See the picture above? You might have seen people sharing such desktop screenshot with terminal showing the logo of the Linux distribution used in ASCII characters. Looking at those screenshots, you may wonder **how to show the logo of Linux distribution in terminal in ASCII characters**.
|
||||
|
||||
In this tutorial, I’ll show you a couple of tools that will display Linux logo in command line.
|
||||
|
||||
### 1. Use screenfetch to display Linux distro logo in ASCII art ###
|
||||
|
||||
[screenfetch][1] is the easiest way to display Linux distribution logo in the terminal. You don’t have to specify anything, it will auto-detect the Linux distribution. And not just logo, screenfetch also displays some basic hardware information alongside it.
|
||||
|
||||
#### Install screenfetch ####
|
||||
|
||||
To install screenfetch in Ubuntu based distributions such as Linux Mint, elementary OS, Linux Lite, Zorin OS etc, you can use the command below:
|
||||
|
||||
sudo apt-get install screenfetch
|
||||
|
||||
**Note**: For Ubuntu 14.04 based distros, you’ll have to add a PPA (as suggested by Benjamin in the comments). Use the command below:
|
||||
|
||||
sudo apt-add-repository ppa:djcj/screenfetch
|
||||
sudo apt-get update
|
||||
apt-get install screenfetch
|
||||
|
||||
To install screenfetch in Arch based distributions such as Antergos, Manjaro, Chakra etc, use the command below:
|
||||
|
||||
sudo pacman -S screenfetch
|
||||
|
||||
To install screenfetch in Fedora based Linux distributions such as Korora etc, use the command below:
|
||||
|
||||
sudo dnf install screenfetch
|
||||
|
||||
#### Using screenfetch ####
|
||||
|
||||
Using screenfetch is utterly simple. Open a terminal and use the command below:
|
||||
|
||||
screenfetch
|
||||
|
||||
That’s it. You’ll see the logo of your Linux distribution displayed in ASCII art along with some information about your system:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
#### Taking screenshot with screenfetch [Optional] ####
|
||||
|
||||
Now this is optional because you can use the Screenshot tools to take screenshot of the displayed ASCII art in terminal. But if you install command line screenshot utility, scrot (it is available in the default repository of several Linux distributions), you can automatically take a screenshot of the displayed Linux logo along with your desktop with the command below:
|
||||
|
||||
screenfetch -s
|
||||
|
||||
If I combine screenfetch with vintage looking [cool-retro-term][2], the result is even more awesome:
|
||||
|
||||

|
||||
|
||||
### 2. Use linux_logo to display Linux distro logo in ASCII art ###
|
||||
|
||||
linux_logo is another command line tool to display ASCII art of Linux distributions. Unlike screenfetch, linux_logo doesn’t automatically identifies and displays the correct Linux distro logo.
|
||||
|
||||
For Ubuntu, it displayed Debian and for Antergos, it displayed sort of BSD-ish logo.
|
||||
|
||||

|
||||
|
||||
Debian instead of Ubuntu?
|
||||
|
||||
But linux_logo has a number of options that you can use. You can choose to display the logo of any Linux distribution available in the list. Before we see how to do that, let me show you how to install it first.
|
||||
|
||||
#### Install linux_logo ####
|
||||
|
||||
To install linux_logo in Ubuntu based Linux distributions, use the command below:
|
||||
|
||||
sudo apt-get install linuxlogo
|
||||
|
||||
To install linux_logo in Arch based Linux distributions, use the command below:
|
||||
|
||||
sudo pacman -S linux_logo
|
||||
|
||||
To install linux_logo in Fedora based Linux distributions, use the command below:
|
||||
|
||||
sudo dnf install linux_logo
|
||||
|
||||
#### Using linux_logo ####
|
||||
|
||||
Once installed, use the command below to list all the options:
|
||||
|
||||
linux_logo -L list
|
||||
|
||||
The output would be like:
|
||||
|
||||

|
||||
|
||||
As you can see there are a number of options. You can choose the number of the Linux distribution and use it in the following way:
|
||||
|
||||
linux_logo -L 25
|
||||
|
||||
This will display OpenSUSE logo:
|
||||
|
||||

|
||||
|
||||
There are more options to display certain sort of info and hide other etc. I left it up to you to explore it.
|
||||
|
||||
### Which one did you like more? ###
|
||||
|
||||
screenfetch or linux_logo? Which one you liked more? Personally, I prefer screenfetch. It’s easier to use and does what it is expected of it. What about you?
|
||||
|
||||
注:投票
|
||||
Which one you prefer?
|
||||
|
||||
- screenfetch
|
||||
- linux_logo
|
||||
- Don't care
|
||||
|
||||
投票代码:
|
||||
<div class="PDS_Poll" id="PDI_container9144518" style="display:inline-block;"></div>
|
||||
<div id="PD_superContainer"></div>
|
||||
<script type="text/javascript" charset="UTF-8" src="//static.polldaddy.com/p/9144518.js"></script>
|
||||
<noscript><a href="http://polldaddy.com/poll/9144518">Take Our Poll</a></noscript></p>
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/display-linux-logo-in-ascii/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://itsfoss.com/author/abhishek/
|
||||
[1]:https://github.com/KittyKatt/screenFetch
|
||||
[2]:http://itsfoss.com/cool-retro-term/
|
@ -1,18 +1,18 @@
|
||||
如何在GNOME 3 中显示桌面
|
||||
如何在 GNOME 3 中显示桌面
|
||||
================================================================================
|
||||

|
||||
|
||||
你**该如何在GNOME 3中显示桌面**?GNOME是一个很棒的桌面环境但是它专注于在程序间切换。如果你想关闭所有窗口并显示桌面呢?
|
||||
你**如何在 GNOME 3 中显示桌面**?GNOME是一个很棒的桌面环境但是它更加专注于在程序间切换。如果你想关闭所有运行中的窗口,仅仅显示桌面呢?
|
||||
|
||||
在Windows中,你可以按下Windows+D。在Ubuntu Unity中,可以用Ctrl+Super+D快捷键。但是由于一些原因,GNOME禁用了显示桌面的快捷键。
|
||||
在Windows中,你可以按下Windows+D。在Ubuntu Unity中,可以用Ctrl+Super+D快捷键。不过由于一些原因,GNOME禁用了显示桌面的快捷键。
|
||||
|
||||
当你按下Super+D或者Ctrl+Super+D,不会发生什么。如果你想要看到桌面,你得一个个最小化窗口。如果你有好几个打开的窗口那么这会非常不方便。
|
||||
当你按下Super+D或者Ctrl+Super+D,什么都不会发生。如果你想要看到桌面,你得一个个最小化窗口。如果你有好几个打开的窗口那么这会非常不方便。
|
||||
|
||||
在本教程中,我们向你展示[GNOME 3][1]中添加显示桌面的快捷键。
|
||||
在本教程中,我将会向你展示在[GNOME 3][1]中添加显示桌面的快捷键。
|
||||
|
||||
### 在GNOME 3 中添加显示桌面的快捷键 ###
|
||||
|
||||
我在本教程的使用的是GNOME 3.18的[Antergos Linux][2],但是步骤对于任何GNOME 3版本的Linux发行版都是有用的。同时也使用了[Numix主题][3]作为默认主题。因此你也许不会看到常规的GNOME图标。但是我相信步骤很直接你可以很方便地尝试。
|
||||
我在本教程的使用的是GNOME 3.18的[Antergos Linux][2]但是这些步骤对于任何GNOME 3版本的Linux发行版都适用。同时也使用了[Numix主题][3]作为默认主题。因此你也许不会看到平常的GNOME图标。但是我相信步骤是一目了然的,很容易就能理解。
|
||||
|
||||
#### 第一步 ####
|
||||
|
||||
@ -22,27 +22,27 @@
|
||||
|
||||
#### 第二步 ####
|
||||
|
||||
当你在系统设置中时,寻找设置。
|
||||
当你在系统设置中时,寻找Keyboard设置。
|
||||
|
||||

|
||||
|
||||
#### 第三步 ####
|
||||
|
||||
在这里,选择**Shortcuts**标签并在左边拦选择**Navigation**。向下滚动一点查找**Hide all normal windows**。你会看见它已经被禁用了
|
||||
在这里,选择**Shortcuts**标签并在左边拦选择**Navigation**。向下滚动一点查找**Hide all normal windows**。你会看见它已经被禁用了。
|
||||
|
||||

|
||||
|
||||
#### 第四步 ####
|
||||
|
||||
在“Hide all normla windows”上面点击一下。你会看到它变成了**New accelerator**。现在无论你按下哪个键,他都会被分配成显示桌面。
|
||||
在“Hide all normla windows”上面点击一下。你会看到它变成了**New accelerator**。现在无论你按下哪个键,他都会被指定为显示桌面。
|
||||
|
||||
如果你意外按下了错误的键,只要按下退格它就会被禁用。再次点击并使用需要的组合键。
|
||||
如果你不小心按下了错误的组合键,只要按下退格它就会被禁用。再次点击并使用需要的组合键。
|
||||
|
||||

|
||||
|
||||
#### 第五步 ####
|
||||
|
||||
一旦设置了组合键,只要关闭系统设置。没有设置保存因为更改是立即生效的。在本例中,我使用Ctrl+Super+D来校准到与Ubuntu Unity一致。
|
||||
一旦设置了组合键,只要关闭系统设置。没有保存设置因为更改是立即生效的。在本例中,我使用Ctrl+Super+D来与我在Ubuntu Unity中的使用习惯保持一致。
|
||||
|
||||

|
||||
|
||||
@ -54,7 +54,7 @@ via: http://itsfoss.com/show-desktop-gnome-3/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user