vps交流

群晖dsm7安装哪吒监控 简易教程


本帖最后由 jhsyue 于 2022-2-9 03:57 编辑

研究了下 其实挺简单

dsm7的群晖 启动项管理 变成了 systemd

路径在 /usr/lib/systemd/system/

那么就简单了

  1. // ssh登陆群晖 然后切换成root
  2. sudo -s
  3. cd  /volume1/@apphome
  4. mkdir NezhaAgent
  5. // 这里得注意 下载你群晖对应架构的agent
  6. wget https://github.com/naiba/nezha/releases/download/v0.12.3/nezha-agent_linux_amd64.tar.gz
  7. tar -zxvf nezha-agent_linux_amd64.tar.gz
  8. chmod +x nezha-agent
  9. //下面就设置systemd脚本
  10. vim /usr/lib/systemd/system/nezha-agent.service
  11. [Unit]
  12. Description=Nezha Agent
  13. After=syslog.target
  14. #After=network.target
  15. #After=nezha-dashboard.service
  16. [Service]
  17. # Modify these two values and uncomment them if you have
  18. # repos with lots of files and get an HTTP error 500 because
  19. # of that
  20. ###
  21. #LimitMEMLOCK=infinity
  22. #LimitNOFILE=65535
  23. Type=simple
  24. User=root
  25. Group=root
  26. WorkingDirectory=/volume1/@apphome/NezhaAgent
  27. ExecStart=/volume1/@apphome/NezhaAgent/nezha-agent –report-delay 3 –disable-command-execute –skip-conn –skip-procs -s 你自己的服务器:443 -p 你自己的密钥 –tls
  28. Restart=always
  29. #Environment=DEBUG=true
  30. # Some distributions may not support these hardening directives. If you cannot start the service due
  31. # to an unknown option, comment out the ones not supported by your version of systemd.
  32. #ProtectSystem=full
  33. #PrivateDevices=yes
  34. #PrivateTmp=yes
  35. #NoNewPrivileges=true
  36. [Install]
  37. WantedBy=multi-user.target
  38. //然后启用就行了
  39. systemctl daemon-reload
  40. systemctl enable nezha-agent
  41. systemctl start nezha-agent
  42. // 看下状态
  43. systemctl status nezha-agent

复制代码

就这么简单

不好意思,鄙人看不懂