From 78162279e7912c78582a2f42a05e7f930836a139 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Wed, 6 Dec 2017 11:58:01 +0800 Subject: [PATCH 1/3] Translated by qhwdw --- ...Linux containers with Ansible Container.md | 114 ----------------- ...Linux containers with Ansible Container.md | 116 ++++++++++++++++++ 2 files changed, 116 insertions(+), 114 deletions(-) delete mode 100644 sources/tech/20171005 How to manage Linux containers with Ansible Container.md create mode 100644 translated/tech/20171005 How to manage Linux containers with Ansible Container.md diff --git a/sources/tech/20171005 How to manage Linux containers with Ansible Container.md b/sources/tech/20171005 How to manage Linux containers with Ansible Container.md deleted file mode 100644 index 0f200d73a8..0000000000 --- a/sources/tech/20171005 How to manage Linux containers with Ansible Container.md +++ /dev/null @@ -1,114 +0,0 @@ -Translating by qhwdw How to manage Linux containers with Ansible Container -============================================================ - -### Ansible Container addresses Dockerfile shortcomings and offers complete management for containerized projects. - -![Ansible Container: A new way to manage containers](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/container-ship.png?itok=pqZYgQ7K "Ansible Container: A new way to manage containers") -Image by : opensource.com - -I love containers and use the technology every day. Even so, containers aren't perfect. Over the past couple of months, however, a set of projects has emerged that addresses some of the problems I've experienced. - -I started using containers with [Docker][11], since this project made the technology so popular. Aside from using the container engine, I learned how to use **[docker-compose][6]** and started managing my projects with it. My productivity skyrocketed! One command to run my project, no matter how complex it was. I was so happy. - -After some time, I started noticing issues. The most apparent were related to the process of creating container images. The Docker tool uses a custom file format as a recipe to produce container images—Dockerfiles. This format is easy to learn, and after a short time you are ready to produce container images on your own. The problems arise once you want to master best practices or have complex scenarios in mind. - -More on Ansible - -* [How Ansible works][1] - -* [Free Ansible eBooks][2] - -* [Ansible quick start video][3] - -* [Download and install Ansible][4] - -Let's take a break and travel to a different land: the world of [Ansible][22]. You know it? It's awesome, right? You don't? Well, it's time to learn something new. Ansible is a project that allows you to manage your infrastructure by writing tasks and executing them inside environments of your choice. No need to install and set up any services; everything can easily run from your laptop. Many people already embrace Ansible. - -Imagine this scenario: You invested in Ansible, you wrote plenty of Ansible roles and playbooks that you use to manage your infrastructure, and you are thinking about investing in containers. What should you do? Start writing container image definitions via shell scripts and Dockerfiles? That doesn't sound right. - -Some people from the Ansible development team asked this question and realized that those same Ansible roles and playbooks that people wrote and use daily can also be used to produce container images. But not just that—they can be used to manage the complete lifecycle of containerized projects. From these ideas, the [Ansible Container][12] project was born. It utilizes existing Ansible roles that can be turned into container images and can even be used for the complete application lifecycle, from build to deploy in production. - -Let's talk about the problems I mentioned regarding best practices in context of Dockerfiles. A word of warning: This is going to be very specific and technical. Here are the top three issues I have: - -### 1\. Shell scripts embedded in Dockerfiles. - -When writing Dockerfiles, you can specify a script that will be interpreted via **/bin/sh -c**. It can be something like: - -``` -RUN dnf install -y nginx -``` - -where RUN is a Dockerfile instruction and the rest are its arguments (which are passed to shell). But imagine a more complex scenario: - -``` -RUN set -eux; \ -    \ -# this "case" statement is generated via "update.sh" -    %%ARCH-CASE%%; \ -    \ -    url="https://golang.org/dl/go${GOLANG_VERSION}.${goRelArch}.tar.gz"; \ -    wget -O go.tgz "$url"; \ -    echo "${goRelSha256} *go.tgz" | sha256sum -c -; \ -``` - -This one is taken from [the official golang image][13]. It doesn't look pretty, right? - -### 2\. You can't parse Dockerfiles easily. - -Dockerfiles are a new format without a formal specification. This is tricky if you need to process Dockerfiles in your infrastructure (e.g., automate the build process a bit). The only specification is [the code][14] that is part of **dockerd**. The problem is that you can't use it as a library. The easiest solution is to write a parser on your own and hope for the best. Wouldn't it be better to use some well-known markup language, such as YAML or JSON? - -### 3\. It's hard to control. - -If you are familiar with the internals of container images, you may know that every image is composed of layers. Once the container is created, the layers are stacked onto each other (like pancakes) using union filesystem technology. The problem is, that you cannot explicitly control this layering—you can't say, "here starts a new layer." You are forced to change your Dockerfile in a way that may hurt readability. The bigger problem is that a set of best practices has to be followed to achieve optimal results—newcomers have a really hard time here. - -### Comparing Ansible language and Dockerfiles - -The biggest shortcoming of Dockerfiles in comparison to Ansible is that Ansible, as a language, is much more powerful. For example, Dockerfiles have no direct concept of variables, whereas Ansible has a complete templating system (variables are just one of its features). Ansible contains a large number of modules that can be easily utilized, such as [**wait_for**][15], which can be used for service readiness checks—e.g., wait until a service is ready before proceeding. With Dockerfiles, everything is a shell script. So if you need to figure out service readiness, it has to be done with shell (or installed separately). The other problem with shell scripts is that, with growing complexity, maintenance becomes a burden. Plenty of people have already figured this out and turned those shell scripts into Ansible. - -If you are interested in this topic and would like to know more, please come to [Open Source Summit][16] in Prague to see [my presentation][17] on Monday, Oct. 23, at 4:20 p.m. in Palmovka room. - - _Learn more in Tomas Tomecek's talk, [From Dockerfiles to Ansible Container][7], at [Open Source Summit EU][8], which will be held October 23-26 in Prague._ - - - -### About the author - - [![human](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/ja.jpeg?itok=4ATUEAbd)][18] Tomas Tomecek - Engineer. Hacker. Speaker. Tinker. Red Hatter. Likes containers, linux, open source, python 3, rust, zsh, tmux.[More about me][9] - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/10/dockerfiles-ansible-container - -作者:[Tomas Tomecek ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/tomastomecek -[1]:https://www.ansible.com/how-ansible-works?intcmp=701f2000000h4RcAAI -[2]:https://www.ansible.com/ebooks?intcmp=701f2000000h4RcAAI -[3]:https://www.ansible.com/quick-start-video?intcmp=701f2000000h4RcAAI -[4]:https://docs.ansible.com/ansible/latest/intro_installation.html?intcmp=701f2000000h4RcAAI -[5]:https://opensource.com/article/17/10/dockerfiles-ansible-container?imm_mid=0f9013&cmp=em-webops-na-na-newsltr_20171201&rate=Wiw_0D6PK_CAjqatYu_YQH0t1sNHEF6q09_9u3sYkCY -[6]:https://github.com/docker/compose -[7]:http://sched.co/BxIW -[8]:http://events.linuxfoundation.org/events/open-source-summit-europe -[9]:https://opensource.com/users/tomastomecek -[10]:https://opensource.com/user/175651/feed -[11]:https://opensource.com/tags/docker -[12]:https://www.ansible.com/ansible-container -[13]:https://github.com/docker-library/golang/blob/master/Dockerfile-debian.template#L14 -[14]:https://github.com/moby/moby/tree/master/builder/dockerfile -[15]:http://docs.ansible.com/wait_for_module.html -[16]:http://events.linuxfoundation.org/events/open-source-summit-europe -[17]:http://events.linuxfoundation.org/events/open-source-summit-europe/program/schedule -[18]:https://opensource.com/users/tomastomecek -[19]:https://opensource.com/users/tomastomecek -[20]:https://opensource.com/users/tomastomecek -[21]:https://opensource.com/article/17/10/dockerfiles-ansible-container?imm_mid=0f9013&cmp=em-webops-na-na-newsltr_20171201#comments -[22]:https://opensource.com/tags/ansible -[23]:https://opensource.com/tags/containers -[24]:https://opensource.com/tags/ansible -[25]:https://opensource.com/tags/docker -[26]:https://opensource.com/tags/open-source-summit diff --git a/translated/tech/20171005 How to manage Linux containers with Ansible Container.md b/translated/tech/20171005 How to manage Linux containers with Ansible Container.md new file mode 100644 index 0000000000..624d25694a --- /dev/null +++ b/translated/tech/20171005 How to manage Linux containers with Ansible Container.md @@ -0,0 +1,116 @@ +怎么去使用 Ansible Container 去管理 Linux 容器 +============================================================ + +### Ansible Container 处理 Dockerfile 的不足和对容器化项目提供完整的管理。 + +![Ansible Container: A new way to manage containers](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/container-ship.png?itok=pqZYgQ7K "Ansible Container: A new way to manage containers") +Image by : opensource.com + +我喜欢容器,并且每天都使用这个技术。在过去几个月,在一组项目中已经解决了我遇到的问题,即便如此,容器并不完美。 + +我刚开始时,用 [Docker][11] 使用容器,因为这个项目使这个技术非常流行。除此之外,使用这个容器引擎,我学到了怎么去使用 **[docker-compose][6]** 以及怎么去用它管理我的项目。使用它使我的生产力猛增!一个命令去运行我的项目,而不管它有多复杂。因此,我太高兴了。 + +使用一段时间之后,我发现了一些问题。最明显的问题是创建窗口镜像的过程。Docker 工具使用一个定制的文件格式作为一个 Recipe 去制作容器镜像 — Dockerfiles。这个格式很容易学会,并且很短的一段时间之后,你就可以为你自己制作容器镜像了。但是,一旦你希望去掌握最佳实践或者有复杂场景的想法,问题就会出现。 + +Ansible 的更多资源 + +* [Ansible 是怎么工作的][1] + +* [免费的 Ansible 电子书][2] + +* [Ansible 快速上手视频][3] + +* [下载和安装 Ansible][4] + +让我们先休息一会儿,先去了解一个不同的东西:[Ansible][22] 的世界。你知道它吗?它棒极了,是吗?你不这么认为?好吧,是时候去学习一些新事物了。Ansible 是一个项目,它允许你通过写一些任务去管理你的基础设施,并在你选择的环境中运行它们。不需要去安装和设置任何的服务;你可以从你的笔记本电脑中去很很容易地做任何事情。许多人已经接受 Ansible 了。 + +想像一下这样的场景:你在 Ansible 中,你写了很多的 Ansible 角色和 playbooks,你可以用它们去管理你的基础设施,并且想把它们运用到容器中。你应该怎么做?开始通过 shell 脚本和 Dockerfiles 去写容器镜像定义?听起来好像不对。 + +来自 Ansible 开发团队的一些人问到这个问题,并且它们意识到,人们每天使用那些同样的 Ansible 角色和 playbooks 也可以用来制作容器镜像。但是 Ansible 能做到的不止这些 — 它可以被用于去管理容器化项目的完整的生命周期。从这些想法中,[Ansible Container][12] 项目诞生了。它使用已有的可以变成容器镜像的 Ansible 角色,甚至可以被用于应用程序在生产系统中从构建到部署的完整生命周期。 + +现在让我们讨论一下,在 Dockerfiles 环境中关于最佳实践时可能存在的问题。这里有一个警告:这将是非常具体且技术性的。出现最多的三个问题有: + +### 1\. 在 Dockerfiles 中内嵌的 Shell 脚本。 + +当写 Dockerfiles 时,你可以通过 **/bin/sh -c** 解释指定的脚本。它可以做类似这样的事情: + +``` +RUN dnf install -y nginx +``` + +RUN 处是一个 Dockerfile 指令并且其它的都是参数(它传递给 shell)。但是,想像一个更复杂的场景: + +``` +RUN set -eux; \ +    \ +# this "case" statement is generated via "update.sh" +    %%ARCH-CASE%%; \ +    \ +    url="https://golang.org/dl/go${GOLANG_VERSION}.${goRelArch}.tar.gz"; \ +    wget -O go.tgz "$url"; \ +    echo "${goRelSha256} *go.tgz" | sha256sum -c -; \ +``` + +这仅是从 [the official golang image][13] 中拿来的一个。它看起来并不好看,是不是? + +### 2\. 你解析 Dockerfiles 并不容易。 + +Dockerfiles 是一个没有正式规范的新格式。如果你需要在你的基础设施(比如,让构建过程自动化一点)中去处理 Dockerfiles 将会很复杂。仅有的规划是 [这个代码][14],它是 **dockerd** 的一部分。问题是你不能使用它作为一个库(library)。最容易的解决方案是你自己写一个解析器,然后祈祷它运行的很好。使用一些众所周知的标记语言不是更好吗?比如,YAML 或者 JSON。 + +### 3\. 管理困难。 + +如果你熟悉容器镜像的内部结构,你可能知道每个镜像是由层(layers)构成的。一旦容器被创建,这些层就使用联合文件系统技术堆叠在一起(像煎饼一样)。问题是,你并不能显式地管理这些层 — 你不能说,“这儿开始一个新层”,你被迫使用一种可读性不好的方法去改变你的 Dockerfile。最大的问题是,必须遵循一套最佳实践以去达到最优结果 — 新来的人在这个地方可能很困难。 + +### Ansible 语言和 Dockerfiles 比较 + +相比 Ansible,Dockerfiles 的最大缺点,也是 Ansible 的优点,作为一个语言,Ansible 更强大。例如,Dockerfiles 没有直接的变量概念,而 Ansible 有一个完整的模板系统(变量只是它其中的一个特性)。Ansible 包含了很多更易于使用的模块,比如,[**wait_for**][15],它可以被用于服务就绪检查,比如,在处理之前等待服务准备就绪。在 Dockerfiles 中,做任何事情都通过一个 shell 脚本。因此,如果你想去找出已准备好的服务,它必须使用 shell(或者独立安装)去做。使用 shell 脚本的其它问题是,它会变得很复杂,维护成为一种负担。很多人已经找到了这个问题,并将这些 shell 脚本转到 Ansible。 + +如果你对这个主题感兴趣,并且想去了解更多内容,请访问 [Open Source Summit][16],在 Prague 去看 [我的演讲][17],时间是 10 月 23 日,星期一,4:20 p.m. 在 Palmovka room 中。 + + _看更多的 Tomas Tomecek 演讲,[从 Dockerfiles 到 Ansible Container][7],在 [Open Source Summit EU][8],它将在 10 月 23-26 日在 Prague 召开。_ + + + +### 关于作者 + + [![human](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/ja.jpeg?itok=4ATUEAbd)][18] Tomas Tomecek - 工程师、Hacker、演讲者、Tinker、Red Hatter。喜欢容器、linux、开源软件、python 3、rust、zsh、tmux。[More about me][9] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/10/dockerfiles-ansible-container + +作者:[Tomas Tomecek][a] +译者:[qhwdw](https://github.com/qhwdw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/tomastomecek +[1]:https://www.ansible.com/how-ansible-works?intcmp=701f2000000h4RcAAI +[2]:https://www.ansible.com/ebooks?intcmp=701f2000000h4RcAAI +[3]:https://www.ansible.com/quick-start-video?intcmp=701f2000000h4RcAAI +[4]:https://docs.ansible.com/ansible/latest/intro_installation.html?intcmp=701f2000000h4RcAAI +[5]:https://opensource.com/article/17/10/dockerfiles-ansible-container?imm_mid=0f9013&cmp=em-webops-na-na-newsltr_20171201&rate=Wiw_0D6PK_CAjqatYu_YQH0t1sNHEF6q09_9u3sYkCY +[6]:https://github.com/docker/compose +[7]:http://sched.co/BxIW +[8]:http://events.linuxfoundation.org/events/open-source-summit-europe +[9]:https://opensource.com/users/tomastomecek +[10]:https://opensource.com/user/175651/feed +[11]:https://opensource.com/tags/docker +[12]:https://www.ansible.com/ansible-container +[13]:https://github.com/docker-library/golang/blob/master/Dockerfile-debian.template#L14 +[14]:https://github.com/moby/moby/tree/master/builder/dockerfile +[15]:http://docs.ansible.com/wait_for_module.html +[16]:http://events.linuxfoundation.org/events/open-source-summit-europe +[17]:http://events.linuxfoundation.org/events/open-source-summit-europe/program/schedule +[18]:https://opensource.com/users/tomastomecek +[19]:https://opensource.com/users/tomastomecek +[20]:https://opensource.com/users/tomastomecek +[21]:https://opensource.com/article/17/10/dockerfiles-ansible-container?imm_mid=0f9013&cmp=em-webops-na-na-newsltr_20171201#comments +[22]:https://opensource.com/tags/ansible +[23]:https://opensource.com/tags/containers +[24]:https://opensource.com/tags/ansible +[25]:https://opensource.com/tags/docker +[26]:https://opensource.com/tags/open-source-summit + + From 772f3f418786300abf49a2f89391ab9f21d6aa95 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Wed, 6 Dec 2017 19:46:58 +0800 Subject: [PATCH 2/3] Translating by qhwdw --- sources/tech/20171005 Reasons Kubernetes is cool.md | 1 + sources/tech/20171203 Best Network Monitoring Tools For Linux.md | 1 + 2 files changed, 2 insertions(+) diff --git a/sources/tech/20171005 Reasons Kubernetes is cool.md b/sources/tech/20171005 Reasons Kubernetes is cool.md index a9d10b9cdb..e1e63e77e8 100644 --- a/sources/tech/20171005 Reasons Kubernetes is cool.md +++ b/sources/tech/20171005 Reasons Kubernetes is cool.md @@ -1,3 +1,4 @@ +Translating by qhwdw Reasons Kubernetes is cool ============================================================ diff --git a/sources/tech/20171203 Best Network Monitoring Tools For Linux.md b/sources/tech/20171203 Best Network Monitoring Tools For Linux.md index aec39b9822..d53e4e0534 100644 --- a/sources/tech/20171203 Best Network Monitoring Tools For Linux.md +++ b/sources/tech/20171203 Best Network Monitoring Tools For Linux.md @@ -1,3 +1,4 @@ +Translating by qhwdw Best Network Monitoring Tools For Linux =============================== From 7a2ab51c29191ca888798df33faf2250853b0ffe Mon Sep 17 00:00:00 2001 From: qhwdw Date: Thu, 7 Dec 2017 11:44:08 +0800 Subject: [PATCH 3/3] Translated by qhwdw --- ...Best Network Monitoring Tools For Linux.md | 189 ------------------ ...Best Network Monitoring Tools For Linux.md | 127 ++++++++++++ 2 files changed, 127 insertions(+), 189 deletions(-) delete mode 100644 sources/tech/20171203 Best Network Monitoring Tools For Linux.md create mode 100644 translated/tech/20171203 Best Network Monitoring Tools For Linux.md diff --git a/sources/tech/20171203 Best Network Monitoring Tools For Linux.md b/sources/tech/20171203 Best Network Monitoring Tools For Linux.md deleted file mode 100644 index d53e4e0534..0000000000 --- a/sources/tech/20171203 Best Network Monitoring Tools For Linux.md +++ /dev/null @@ -1,189 +0,0 @@ -Translating by qhwdw -Best Network Monitoring Tools For Linux -=============================== - - -Keeping control of our network is vital to prevent any program from overusing it and slows down the overall system operation. There are several - -**network monitoring tools** - -for different operating systems today. In this article, we will talk about - -**10 network monitoring tools for Linux** - -that will run from a terminal, ideal for users who do not use GUI or for those who want to keep a control of the network use of a server through from ssh. - -### Iftop - - [![iftop network monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/iftop_orig.png)][2] - -Linux users are generally familiar with Top. This tool is a system monitor that allows us to know in real time all the processes that are running in our system and can manage them easily. Iftop is an application similar to Top but specialized in the monitoring of the network, being able to know a multitude of details regarding the network and all the processes that are making use of it. - -We can obtain more information about this tool and download the necessary packages from the - -[following link][3] - -. - -### Vnstat - - [![vnstat network monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/editor/vnstat.png?1511885309)][4] **Vnstat** - -is a network monitor that is included, by default, in most Linux distributions. It allows us to obtain a real-time control of the traffic sent and received in a period of time, chosen by the user. - -​ - -We can obtain more information about this tool and download the necessary packages from the - -[following link.][5] - -### Iptraf - - [![iptraf monitoring tool for linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/iptraf_orig.gif)][6] **IPTraf** - -is a console-based, real-time network monitoring utility for Linux. (IP LAN) - Collects a wide variety of information as an IP traffic monitor that passes through the network, including TCP flags information, ICMP details, TCP / UDP traffic faults, TCP connection packet and Byne account. It also collects statistics information from the general and detailed interface of TCP, UDP,,, checksum errors IP not IP ICMP IP, interface activity, etc. - -​ - -We can obtain more information about this tool and download the necessary packages from the - -[following link.][7] - -### Monitorix - System and Monitoring Network - - [![monitorix system monitoring tool for linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/monitorix_orig.png)][8] - -Monitorix is a lightweight free utility that is designed to run and monitor system and network resources with as many Linux / Unix servers as possible. An HTTP web server has been added that regularly collects system and network information and displays them in the graphs. It will track the average system load and its usage, memory allocation, disk health, system services, network ports, mail statistics (Sendmail, Postfix, Dovecot, etc.), MySQL statistics and many more. It is designed to control the overall performance of the system and helps in detecting faults, bottlenecks, abnormal activities, etc. - -​ - -Download and more - -[information here][9] - -. - -### Dstat - - [![dstat network monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/dstat_orig.png)][10] - -A monitor is somewhat less known than the previous ones but also usually comes by default in many distributions. - -​ - -We can obtain more information about this tool and download the necessary packages from the - -[following link][11] - -. - -### Bwm-ng - - [![bwm-ng monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/bwm-ng_orig.png)][12] - -One of the simplest tools. It allows you to get data from the connection interactively and, at the same time, export them to a certain format for easier reference on another device. - -​ - -We can obtain more information about this tool and download the necessary packages from the - -[following link][13] - -. - -### Ibmonitor - - [![ibmonitor tool for linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/ibmonitor_orig.jpg)][14] - -Similar to the above, it shows network traffic filtered by connection interface and clearly separates the traffic sent from the received traffic. - -​ - -We can obtain more information about this tool and download the necessary packages from the - -[following link​][15] - -. - -### Htop - Linux Process Tracking - - [![htop linux processes monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/htop_orig.png)][16] - -Htop is a much more advanced, interactive and real-time Linux tool for tracking processes. It is similar to the top Linux command but has some advanced features such as an easy-to-use interface for process management, shortcut keys, vertical and horizontal view of processes and much more. Htop is a third-party tool and is not included on Linux systems, you must install it using - -**YUM** - -(or - -**APT-GET)** - -or whatever your package management tool. For more information on installation, read - -[this article][17] - -. - -We can obtain more information about this tool and download the necessary packages from the - -[following link.][18] - -### Arpwatch - Ethernet Activity Monitor - - [![arpwatch ethernet monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/arpwatch_orig.png)][19] - -Arpwatch is a program that is designed to control the resolution of addresses (MAC and changes in the IP address) of Ethernet network traffic in a Linux network. It is continuously monitoring the Ethernet traffic and records the changes in the IP addresses and MAC addresses, the changes of pairs along with the timestamps in a network. It also has a function to send an e-mail notifying the administrator, when a couple is added or changes. It is very useful in detecting ARP impersonation in a network. - -We can obtain more information about this tool and download the necessary packages from the - -[following link.​][20] - -### Wireshark - Network Monitoring tool - - [![wireshark network monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/editor/how-to-use-wireshark_1.jpg?1512299583)][21] **[Wireshark][1]** - -is a free application that enables you to catch and view the information going forward and backward on your system, giving the capacity to bore down and read the substance of every parcel – separated to meet your particular needs. It is generally used to investigate arrange issues and additionally to create and test programming. This open-source convention analyzer is generally acknowledged as the business standard, prevailing upon what's coming to it's of honors the years. - -Initially known as Ethereal, Wireshark highlights an easy to understand interface that can show information from many diverse conventions on all real system sorts. - -### Conclusion - -​In this article, we have taken a gander at a few open source network monitoring tools. Because we concentrated on these instruments as the "best" does not really mean they are the best for your need. For instance, there are numerous other open source monitoring apparatuses that exist, for example, OpenNMS, Cacti, and Zennos and you need to consider the advantages of everyone from the point of view of your prerequisite. - -Additionally, there are different apparatuses that might be more good for your need that is not open source. - -​ - -What more network monitors do you use or know to use in Linux in terminal format? - --------------------------------------------------------------------------------- - -via: http://www.linuxandubuntu.com/home/best-network-monitoring-tools-for-linux - -作者:[​​LinuxAndUbuntu][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxandubuntu.com -[1]:https://www.wireshark.org/ -[2]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/iftop_orig.png -[3]:http://www.ex-parrot.com/pdw/iftop/ -[4]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/vnstat.png -[5]:http://humdi.net/vnstat/ -[6]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/iptraf_orig.gif -[7]:http://iptraf.seul.org/ -[8]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/monitorix_orig.png -[9]:http://www.monitorix.org -[10]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/dstat_orig.png -[11]:http://dag.wiee.rs/home-made/dstat/ -[12]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/bwm-ng_orig.png -[13]:http://sourceforge.net/projects/bwmng/ -[14]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/ibmonitor_orig.jpg -[15]:http://ibmonitor.sourceforge.net/ -[16]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/htop_orig.png -[17]:http://wesharethis.com/knowledgebase/htop-and-atop/ -[18]:http://hisham.hm/htop/ -[19]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/arpwatch_orig.png -[20]:http://linux.softpedia.com/get/System/Monitoring/arpwatch-NG-7612.shtml -[21]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/how-to-use-wireshark_1_orig.jpg diff --git a/translated/tech/20171203 Best Network Monitoring Tools For Linux.md b/translated/tech/20171203 Best Network Monitoring Tools For Linux.md new file mode 100644 index 0000000000..8fc2cd25e3 --- /dev/null +++ b/translated/tech/20171203 Best Network Monitoring Tools For Linux.md @@ -0,0 +1,127 @@ +Linux 中最佳的网络监视工具 +=============================== + +保持对我们的网络的管理,防止任何程序过度使用网络、导致整个系统操作变慢,对管理员来说是至关重要的。对不同的系统操作,这是有几个网络监视工具。在这篇文章中,我们将讨论从 Linux 终端中运行的 10 个网络监视工具。它对不使用 GUI 而希望通过 SSH 来保持对网络管理的用户来说是非常理想的。 + +### Iftop + + [![iftop network monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/iftop_orig.png)][2] + +与 Linux 用户经常使用的 Top 是非常类似的。这是一个系统监视工具,它允许我们知道在我们的系统中实时运行的进程,并可以很容易地管理它们。Iftop 与 Top 应用程序类似,但它是专门监视网络的,通过它可以知道更多的关于网络的详细情况和使用网络的所有进程。 + +我们可以从 [这个链接][3] 获取关于这个工具的更多信息以及下载必要的包。 + +### Vnstat + + [![vnstat network monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/editor/vnstat.png?1511885309)][4] + +**Vnstat** 是一个缺省包含在大多数 Linux 发行版中的网络监视工具。它允许我们在一个用户选择的时间周期内获取一个实时管理的发送和接收的流量。 + +我们可以从 [这个链接][5] 获取关于这个工具的更多信息以及下载必要的包。 + +### Iptraf + + [![iptraf monitoring tool for linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/iptraf_orig.gif)][6] + +**IPTraf** 是一个 Linux 的、基于控制台的、实时网络监视程序。(IP LAN) - 收集经过这个网络的各种各样的信息作为一个 IP 流量监视器,包括 TCP 标志信息、ICMP 详细情况、TCP / UDP 流量故障、TCP 连接包和 Byne 报告。它也收集接口上全部的 TCP、UDP、…… 校验和错误、接口活动等等的详细情况。 + +我们可以从 [这个链接][7] 获取这个工具的更多信息以及下载必要的包。 + +### Monitorix - 系统和网络监视 + + [![monitorix system monitoring tool for linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/monitorix_orig.png)][8] + +Monitorix 是一个轻量级的免费应用程序,它设计用于去监视尽可能多的 Linux / Unix 服务器的系统和网络资源。一个 HTTP web 服务器可以被添加到它里面,定期去收集系统和网络信息,并且在一个图表中显示它们。它跟踪平均的系统负载、内存分配、磁盘健康状态、系统服务、网络端口、邮件统计信息(Sendmail、Postfix、Dovecot、等等)、MySQL 统计信息以及其它的更多内容。它设计用于去管理系统的整体性能,以及帮助检测故障、瓶颈、异常活动、等等。 + +下载及更多 [信息在这里][9]。 + +### Dstat + + [![dstat network monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/dstat_orig.png)][10] + +这个监视器相比前面的几个知名度低一些,但是,在一些发行版中已经缺省包含了。 + +我们可以从 [这个链接][11] 获取这个工具的更多信息以及下载必要的包。 + +### Bwm-ng + + [![bwm-ng monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/bwm-ng_orig.png)][12] + +这是最简化的工具中的一个。它允许你去从交互式连接中取得数据,并且,为了便于其它设备使用,在取得数据的同时,能以某些格式导出它们。 + +我们可以从 [这个链接][13] 获取这个工具的更多信息以及下载必要的包。 + +### Ibmonitor + + [![ibmonitor tool for linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/ibmonitor_orig.jpg)][14] + +与上面的类似,它显示连接接口上过滤后的网络流量,并且,从接收到的流量中明确地区分区开发送流量。 + +我们可以从 [这个链接][15] 获取这个工具的更多信息以及下载必要的包。 +​ +### Htop - Linux 进程跟踪 + + [![htop linux processes monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/htop_orig.png)][16] + +Htop 是一个更高级的、交互式的、实时的 Linux 进程跟踪工具。它类似于 Linux 的 top 命令,但是有一些更高级的特性,比如,一个更易于使用的进程管理接口、快捷键、水平和垂直的进程视图、等更多特性。Htop 是一个第三方工具,它不包含在 Linux 系统中,你必须使用 **YUM** 或者 **APT-GET** 或者其它的包管理工具去安装它。关于安装它的更多信息,读[这篇文章][17]。 + +我们可以从 [这个链接][18] 获取这个工具的更多信息以及下载必要的包。 + +### Arpwatch - 以太网活动监视器 + + [![arpwatch ethernet monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/arpwatch_orig.png)][19] + +Arpwatch 是一个设计用于在 Linux 网络中去管理以太网通讯的地址解析的程序。它持续监视以太网通讯并记录 IP 地址和 MAC 地址的变化。在一个网络中,它们的变化同时伴随记录一个时间戳。它也有一个功能是当一对 IP 和 MAC 地址被添加或者发生变化时,发送一封邮件给系统管理员。在一个网络中发生 ARP 攻击时,这个功能非常有用。 + +我们可以从 [这个链接][20] 获取这个工具的更多信息以及下载必要的包。 + +### Wireshark - 网络监视工具 + + [![wireshark network monitoring tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/editor/how-to-use-wireshark_1.jpg?1512299583)][21] + +**[Wireshark][1]** 是一个免费的应用程序,它允许你去捕获和查看前往你的系统和从你的系统中返回的信息,它可以去深入到通讯包中并查看每个包的内容 – 分开它们来满足你的特殊需要。它一般用于去研究协议问题和去创建和测试程序的特别情况。这个开源分析器是一个被公认的分析器商业标准,它的流行是因为纪念那些年的荣誉。 + +最初它被认识是因为 Ethereal,Wireshark 有轻量化的、易于去理解的界面,它能分类显示来自不同的真实系统上的协议信息。 + +### 结论 + +​在这篇文章中,我们看了几个开源的网络监视工具。由于我们从这些工具中挑选出来的认为是“最佳的”,并不意味着它们都是最适合你的需要的。例如,现在有很多的开源监视工具,比如,OpenNMS、Cacti、和 Zennos,并且,你需要去从你的个体情况考虑它们的每个工具的优势。 + +另外,还有不同的、更适合你的需要的不开源的工具。 + +你知道的或者使用的在 Linux 终端中的更多网络监视工具还有哪些? + +-------------------------------------------------------------------------------- + +via: http://www.linuxandubuntu.com/home/best-network-monitoring-tools-for-linux + +作者:[​​LinuxAndUbuntu][a] +译者:[qhwdw](https://github.com/qhwdw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxandubuntu.com +[1]:https://www.wireshark.org/ +[2]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/iftop_orig.png +[3]:http://www.ex-parrot.com/pdw/iftop/ +[4]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/vnstat.png +[5]:http://humdi.net/vnstat/ +[6]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/iptraf_orig.gif +[7]:http://iptraf.seul.org/ +[8]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/monitorix_orig.png +[9]:http://www.monitorix.org +[10]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/dstat_orig.png +[11]:http://dag.wiee.rs/home-made/dstat/ +[12]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/bwm-ng_orig.png +[13]:http://sourceforge.net/projects/bwmng/ +[14]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/ibmonitor_orig.jpg +[15]:http://ibmonitor.sourceforge.net/ +[16]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/htop_orig.png +[17]:http://wesharethis.com/knowledgebase/htop-and-atop/ +[18]:http://hisham.hm/htop/ +[19]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/arpwatch_orig.png +[20]:http://linux.softpedia.com/get/System/Monitoring/arpwatch-NG-7612.shtml +[21]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/how-to-use-wireshark_1_orig.jpg + +