pm2-web 是一款 pm2 服務狀態監控程序,基於 web 。
安裝
$ npm install -g pm2-web
運行(默認是在8080端口)
$ pm2-web
配置
pm2-web 將會加載默認的配置文件(如果存在)
pm2-web will load one of the following files if they exist (in order of preference)
A file specified by the --config /path/to/config.json argument
From the current users' home directory: ~/.config/pm2-web/config.json
A global configuration file: /etc/pm2-web/config.json
- 1
- 2
- 3
- 4
自定義配置文件
通過 --config yourFile 指定加載的配置文件
新建 pm2-web-config.json 文件:
{
"www": { "host": "localhost", "address": "0.0.0.0", "port": 10016 } }
- 1
- 2
- 3
- 4
- 5
- 6
- 7
運行
運行 pm2-web:
$pm2-web --config pm2-web-config.json
訪問 localhost:10016
可以在 web 界面查看 pm2 服務運行狀態,點擊按鈕進行 stop restart reload 等操作。

可以查看各個服務的內存、CPU使用情況,日志等。

