**Recommended configuration:** Preparation before installation _Two domains_,one can **access CDN** as _Public Access_,for example (status.nai.ba);Another one resolves to the panel server as Agent connect Dashboard use,**can't access CDN** Direct exposure panel host IP,for example(ip-to-dashboard.nai.ba)。
by executing `./nezha-agent --help` View supported parameters,If you use one-click scripting,can be edited `/etc/systemd/system/nezha-agent.service`,exist `ExecStart=` At the end of this line add
-`--report-delay` System information reporting interval,The default is 1 Second,can be set to 3 to further reduce agent End-system resource usage(Configuration interval 1-4)
-`--skip-conn` Do not monitor the number of connections,if Airport/connection-intensive machines High CPU usage,Recommended settings
-`--skip-procs` Do not monitor the number of processes,can also be reduced agent occupy
<summary>Alarm notification:Real-time monitoring of load, CPU, memory, hard disk, bandwidth, traffic, monthly traffic, number of processes, and number of connections。</summary>
`#NEZHA#` is the panel message placeholder,The panel will automatically replace the placeholder with the actual message when the notification is triggered
Body content is`JSON` formatted:**when the request type is FORM Time**,value is `key:value` form,`value` Placeholders can be placed inside,Automatically replace when notified。**when the request type is JSON 时** It will only be submitted directly to the`URL`。
- URL Parameter acquisition instructions:botXXXXXX Neutral XXXXXX is in telegram Follow the official @Botfather,enter/newbot ,Create new bot(bot)Time,will provide token(in prompt Use this token to access the HTTP API:next line)here 'bot' Three letters are indispensable。create bot 后,need first telegram neutral BOT have a conversation(Just send a message),then available API Send a message。YYYYYY Yes telegram user's number ID。with the robot@userinfobot Dialogue is available。
- transfer_in_cycle Inbound traffic during the period
- transfer_out_cycle Outbound traffic during the period
- transfer_all_cycle Bidirectional flow in cycles and
- cycle_start Fiscal Period Start Date(Can be the start date of your machine billing cycle),RFC3339 Time format,For example, Beijing time is`2022-01-11T08:00:00.00+08:00`
- cycle_interval How many cycle units every (for example, if the cycle unit is days, the value is 7, which means that the statistics will be counted every 7 days)
- cycle_unit Statistical period unit, default `hour`, optional(`hour`, `day`, `week`, `month`, `year`)
- min/max、cover、ignore Refer to Basic Rules Configuration
- Example: ID for 3 the machine(ignore inside the definition)of monthly 15 outbound monthly traffic billed 1T Call the police `[{"type":"transfer_out_cycle","max":1000000000000,"cycle_start":"2022-01-11T08:00:00.00+08:00","cycle_interval":1,"cycle_unit":"month","cover":1,"ignore":{"3":true}}]`
1. direct execution `/opt/nezha/agent/nezha-agent -s Panel IP or non-CDN domain name:Panel RPC port -p Agent key -d` Check if the log is DNS、Poor network causes timeout(timeout) question。
2.`nc -v domain name/IP Panel RPC port` or `telnet domain name/IP Panel RPC port` Check if it is a network problem,Check local and panel server inbound and outbound firewalls,If the single machine cannot judge, you can use the <https://port.ping.pe/> Provided port inspection tool for detection。
3. If the above steps detect normal,Agent normal online,try to close SELinux,[how to close SELinux?](https://www.google.com/search?q=%E5%85%B3%E9%97%ADSELINUX)
first in release Download the corresponding binary decompression zip After the package is placed in `/root`,Then `chmod +x /root/nezha-agent` give execute permission,then create `/etc/init.d/nezha-service`:
give execute permission `chmod +x /etc/init.d/nezha-service` then start the service `/etc/init.d/nezha-service enable && /etc/init.d/nezha-service start`
When using a reverse proxy, you need to target `/ws`,`/terminal` path WebSocket Specially configured to support real-time server status updates and **WebSSH**。
- First log in to the panel to enter the management background Open the settings page,exist `Panel server domain name that is not connected to CDN/IP` Fill in the previous step in Nginx or Caddy domain name configured in for example `ip-to-dashboard.nai.ba`,and save。
- then in the panel server,Open /opt/nezha/dashboard/data/config.yaml 文件,将 `proxygrpcport` change into Nginx or Caddy listening port,or as set in the previous step `443`;because we are Nginx or Caddy turned on SSL/TLS,So it is necessary to `tls` Set as `true`;Restart the panel after modification is complete。
- Login panel management background,Copy the one-click install command,Execute the one-click installation command on the corresponding server to reinstall agent end。
according to Cloudflare gRPC requirements:gRPC Service must listen 443 port and must support TLS and HTTP/2。
So if you need to turn it on CDN,must be configured Nginx or Caddy reverse proxy gRPC use when 443 port,and configure the certificate(Caddy Will automatically apply and configure the certificate)。
- Log in Cloudflare,Choose a domain name to use。Open `The internet` option will `gRPC` switch on,Open `DNS` options,turn up Nginx or Caddy Anti-generation gRPC The resolution record of the configured domain name,Open Orange Cloud Enable CDN。