Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to quickly monitor multiple hosts in Linux

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to quickly monitor multiple hosts in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!

There are many monitoring tools available to monitor local and remote Linux systems. A good example is Cockpit. However, the installation and use of these tools are complex, at least for novice administrators. Novice administrators may take some time to figure out how to configure these tools to monitor the system. If you want to quickly and roughly monitor more than one host at a time in a local area network, you may need to learn about the "rwho" tool. As soon as the rwho utility is installed, it will immediately and quickly monitor local and remote systems. You don't have to configure anything! All you have to do is install the "rwho" tool on the system you want to monitor.

Do not think of rwho as a feature-rich and complete monitoring tool. This is a simple tool that only monitors the "uptime" (uptime), "load" (load) and logged-in users of the remote system. Using the "rwho" user program, we can find out who is logged in on which computer; a list of monitored computers, listing the uptime (since the last reboot); how many users have logged in; and the average load over the past 1, 5, and 15 minutes. No more! Moreover, it only monitors systems in the same subnet. Therefore, it is very suitable for small and home office networks.

Monitoring multiple hosts in Linux

Let me explain how rwho works. Each system that uses rwho on the network broadcasts information about itself, which other computers can access using the rwhod daemon. Therefore, rwho must be installed on every computer on the network. In addition, in order to distribute or access information from other hosts, rwho ports, such as port 513/UDP, must be allowed through the firewall / router.

OK, let's install it.

I tested it on the Ubuntu 16.04 LTS server, and rwho is available in the default repository, so we can install it using an APT package manager like the one below.

$sudo apt-get install rwho

On RPM-based systems such as CentOS, Fedora, RHEL, use the following command to install it:

$sudo yum install rwho

If you are behind a firewall / router, make sure you are allowed to use port rwhod 513. Also, use the command to verify that the rwhod daemon is running:

$sudo systemctl status rwhod

If it is not already started, run the following command to enable and start the rwhod service:

$sudo systemctl enable rwhod$ sudo systemctl start rwhod

Now it's time to monitor the system. Run the following command to find out who is logged in on which computer:

$rwhoostechni ostechnix:pts/5 Mar 12 17:41root server:pts/0 Mar 12 17:42

As you can see, there are currently two systems in my local area network. The local system user is ostechnix (Ubuntu 16.04 LTS) and the remote system user is root (CentOS 7). As you may have guessed, rwho is similar to the who command, but it monitors remote systems.

Also, we can use the following command to find the uptime of all running systems on the network:

$ruptimeostechnix up 2:17, 1 user, load 0.09,0.03, 0.01server up 1:54, 1 user, load 0.00,0.01,0.05

Here, ruptime (similar to the uptime command) shows the total elapsed time of my Ubuntu (local) and CentOS (remote) systems. Do you get it? Wow! The following is a sample screenshot of my Ubuntu 16.04 LTS system:

You can find information about all other machines in the local area network at the following locations:

$ls / var/spool/rwho/whod.ostechnix whod.server

It is small, but very useful to find out who is logged in on which computer, as well as uptime and system load details.

Recommended reading:

Note that there is a serious loophole in this approach. Because information about each computer is broadcast over the network, it is possible for everyone in the subnet to get this information. Usually yes, but on the other hand, this may be an unnecessary side effect when information about the network is distributed to unauthorized users. Therefore, it is strongly recommended to use it in trusted and protected Lans.

For more information, find the man man page.

The above $man rwho is all the contents of the article "how to quickly monitor multiple hosts in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report