Last update at :2024-07-13,Edit by888u
Nezha Monitoring: an open source, lightweight server and website monitoring, operation and maintenance tool.
Supports monitoring the system status of multiple servers at the same time, supports monitoring web pages, ports, and SSL certificate status; supports status alarms such as faults and traffic, and supports multiple notification methods (Telegram, email, WeChat, etc.)
Supports online SSH, supports traffic cycle monitoring, supports setting scheduled tasks, and server batch execution tasks
Supports one-click script installation panel and monitoring services for easy use; mainstream systems such as Linux, Windows, MacOS, and OpenWRT are all supported
Official website: https://nezhahq.github.io/
During installation, it is divided into a control terminal and a controlled terminal. The control terminal is one host, and the controlled terminals can be multiple.
1. Installation of the control terminal Finally stable and highly secure
1. Have a domain name and resolve it to the control host IP
2. The control host needs to open ports 8008 and 5555
3. A Github account (or: Gitlab, Jihulab, Gitee)
Get the Client ID and key of Github/Jihulab#
Nezha Monitoring is connected to Github, Gitlab, Jihulab, and Gitee as the backend administrator account
First we need to create a new verification application, taking Github as an example. After logging in to Github, open https://github.com/settings/developers and select "OAuth Apps" - "New OAuth App"
Application name – fill in whatever you want
Homepage URL – fill in the access domain name of the panel, such as: "http://ping.example.com"
Authorization callback URL – fill in the callback address, such as: "http://ping.example.com/oauth2/callback"
Click “Register application”
Save the Client ID on the page, and then click "Generate a new client secret" to create a new Client Secret. The newly created secret will only be displayed once, please save it properly.
JihuLab’s application creation entrance is: https://jihulab.com/-/profile/applications
The callback address should be filled in the Redirect URL
Check read_user and read_api
in the scope below
Once created, save the application ID and password
4. Install the control panel on the control host
In the panel server, run the installation script:
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh< /code>
If your panel server is located in mainland China, you can use mirroring:
curl -L https://jihulab.com/nezha/nezha/-/raw/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo CN=true . /nezha.sh
After Docker is installed, enter the following values:
OAuth Provider – Choose one among Github, Gitlab, Jihulab, Gitee
Client ID – previously saved Client ID
Client Secret – previously saved secret
Username – Username in the OAuth provider
Site Title – Customize Site Title
Access port – public access port, customizable, default 8008
Agent’s communication port – the communication port between Agent and Dashboard, default 5555
After the input is completed, wait for the image to be pulled
After the installation is complete, if everything is normal, you can access the domain name + port number, such as "http://ping.example.com:8008" to view the panel.
If you need to run the script again in the future, you can run:
./nezha.sh
To open the management script
5. After configuring the reverse proxy, remember to change the reverse code in the configuration file to the following code:
127.0.0.1 is your control host IP
#PROXY-START/
location/{
proxy_pass http://127.0.0.1:8008;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
}
location ~ ^/(ws|terminal/.+)$ {
proxy_pass http://127.0.0.1:8008;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
}
#PROXY-END/
5. Database changes
If you need to modify data in the database, please stop the panel container first and then modify it.
The database type is sqlite3, located at /opt/nezha/dashboard/data/sqlite.db. Please back up before modifying
2. Installation of the controlled terminal
1. After setting the domain name on the control terminal, the one-click installation code will be displayed after adding the host.
2. Execute the above one-click code on the controlled terminal.
Demo: http://ping.kx.al/
Recommended site searches: Chinese domain name, view IP, cm domain name registration, host domain name, domain name space, ip38, Hong Kong vps host, Hong Kong server purchase, how much does it cost to rent a server for a year, enterprise virtual host,
发表评论