Home > System Tutorial > LINUX > body text

Linux performance monitoring tool: pyDash

王林
Release: 2023-12-28 22:21:58
forward
1190 people have browsed it

pyDash is a lightweight, web-based Linux performance monitoring tool written in Python and Django plus Chart.js. After testing, it can run on the following mainstream Linux distributions: CentOS, Fedora, Ubuntu, Debian, Raspbian and Pidora.

pyDash : Linux 性能监测工具

You can use this tool to monitor your Linux PC/Server resources such as CPU, memory, network statistics, processes including online users and more. The dashboard is developed entirely with Python libraries provided by major Python distributions, so it has very few dependencies and you don't need to install many packages or libraries to run it.

In this article, I will show you how to install pyDash to monitor Linux server performance.

How to install pyDash under Linux system

1. First, install the required software packages git and Python pip as follows:

-------------- 在 Debian/Ubuntu 上 --------------
$ sudo apt-get install git python-pip
-------------- 在 CentOS/RHEL 上 --------------
# yum install epel-release
# yum install git python-pip
-------------- 在 Fedora 22+ 上 --------------
# dnf install git python-pip
Copy after login

2. If git and Python pip are installed, then install virtualenv as follows, which helps to handle dependencies for Python projects:

# pip install virtualenv
或
$ sudo pip install virtualenv
Copy after login

3. Now, use the git command as follows to clone the pyDash warehouse to the home directory:

# git clone https://github.com/k3oni/pydash.git
# cd pydash
Copy after login

4. Next, use the following virtualenv command to create a virtual environment called pydashtest for the project:

$ virtualenv pydashtest #give a name for your virtual environment like pydashtest
Copy after login

pyDash : Linux 性能监测工具

Create virtual environment

Important: Please note that in the screenshot above, the bin directory of the virtual environment is highlighted, yours may be different depending on where you clone the pyDash directory.

5. After creating the virtual environment (pydashtest), you need to activate it before use as follows:

$ source /home/aaronkilik/pydash/pydashtest/bin/activate
Copy after login

pyDash : Linux 性能监测工具

Activate virtual environment

From the screenshot above, you can notice that prompt string 1 (PS1) has changed, which indicates that the virtual environment has been activated and can be used.

6. Now, install the pydash project requirements; if you are curious, you can use the cat command to view the contents of requirements.txt, and then install it as shown below:

$ cat requirements.txt
$ pip install -r requirements.txt
Copy after login

7. Now, enter the pydash directory, which contains a file named settings.py. You can also directly run the following command to open this file, and then SECRET_KEY Change to a specific value:

$ vi pydash/settings.py
Copy after login

pyDash : Linux 性能监测工具

Set the key

Save the file and exit.

8. After that, run the following commands to create a project database and install Django’s authentication system, and create a superuser for the project:

$ python manage.py syncdb
Copy after login

Answer the following questions based on your situation:

Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'): admin
Email address: [email protected]
Password: ###########
Password (again): ############
Copy after login

pyDash : Linux 性能监测工具

Create project database

9、这个时候,一切都设置好了,然后,运行下面的命令来启用 Django 开发服务器:

$ python manage.py runserver
Copy after login

10、接下来,打开你的 web 浏览器,输入网址:http://127.0.0.1:8000/ 进入 web 控制台登录界面,输入你在第 8 步中创建数据库和安装 Django 身份验证系统时创建的超级用户名和密码,然后点击登录。

pyDash : Linux 性能监测工具

pyDash 登录界面

11、登录到 pydash 主页面以后,你将会可以看到监测系统的基本信息,包括 CPU、内存和硬盘使用量以及系统平均负载。

向下滚动便可查看更多部分的信息。

pyDash : Linux 性能监测工具

pydash 服务器性能概述

12、下一个屏幕截图显示的是一段 pydash 的跟踪界面,包括 IP 地址、互联网流量、硬盘读/写、在线用户以及 netstats 。

pyDash : Linux 性能监测工具

pyDash 网络概述

13、下一个 pydash 主页面的截图显示了一部分系统中被监视的活跃进程。

pyDash : Linux 性能监测工具

pyDash 监视活跃 Linux 进程

如果想了解更多信息,请在 GitHub 上查看 pydash:https://github.com/k3oni/pydash

这就是全部内容了。在这篇文章中,我们展示了在 Linux 中如何安装 pyDash 并测试它的主要特性。


The above is the detailed content of Linux performance monitoring tool: pyDash. For more information, please follow other related articles on the PHP Chinese website!

source:linuxprobe.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template