哪吒监控Agent多开

夏沫花火zzz🌙 (Muska_Ami) Lv4

复制原Agent服务配置

1
cp /etc/systemd/system/nezha-agent.service /etc/systemd/system/<NEW-SERVICE>.service

编辑服务

1
vim /etc/systemd/system/<NEW-SERVICE>.service

编辑 ExecStart 部分
若RPC启用了tls,还要在后面加上 --tls

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[Unit]
Description=Nezha Agent
After=syslog.target
#After=network.target
#After=nezha-dashboard.service

[Service]
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
Type=simple
User=root
Group=root
WorkingDirectory=/opt/nezha/agent/
ExecStart=/opt/nezha/agent/nezha-agent -s <RPC_HOST>:<RPC_PORT> -p <RPC_SECRET>
Restart=always
#Environment=DEBUG=true

# Some distributions may not support these hardening directives. If you cannot start the service due
# to an unknown option, comment out the ones not supported by your version of systemd.
#ProtectSystem=full
#PrivateDevices=yes
#PrivateTmp=yes
#NoNewPrivileges=true

[Install]
WantedBy=multi-user.target

启动服务

1
2
# 开机自启并立即启动
systemctl enable --now <NEW-SERVICE>.service
  • 标题: 哪吒监控Agent多开
  • 作者: 夏沫花火zzz🌙 (Muska_Ami)
  • 创建于 : 2024-02-01 05:24:28
  • 更新于 : 2024-10-03 16:39:27
  • 链接: https://blog.1l1.icu/2024/01/31/na-zha-jian-kong-duo-kai/
  • 版权声明: 本文章采用 CC BY-SA 4.0 进行许可。
 评论
此页目录
哪吒监控Agent多开