vfhky / serv00_ct8_nezha

serv00和ct8主机一键安装哪吒探针和多主机保活
https://typecodes.com/python/serv00ct8nezha.html
71 stars 14 forks source link

哪吒探针安装完dashboard和agent后显示离线 #1

Closed behinder85 closed 2 months ago

behinder85 commented 2 months ago

image

附上日志信息(已做隐名处理)

[username@s9]:<~/serv00_ct8_nezha>$ python3 main.py ===> 从[config]目录生成配置文件成功.... ===> 开始初始化所有配置 ===> 结束初始化所有配置 是否生成私钥(一般是安装面板需要生成,安装agent时不需要)? (Y/y 执行,N/n 不执行): n ===> 开始读取host.conf主机配置文件.... 是否拷贝公私钥文件到各个主机(一般是安装面板需要生成,安装agent时不需要)? (Y/y 执行,N/n 不执行): n 是否安装哪吒dashboard? (Y/y 执行,N/n 不执行): y ===> 开始安装哪吒dashboard.... 当前最新版本为: v0.19.8 ===> dashboard https://github.com/naiba/nezha/archive/refs/tags/v0.19.8.zip 下载完成 修改面板配置 关于 GitHub Oauth2 应用:在 https://github.com/settings/developers 创建,无需审核,Callback 填 http(s)://域名或IP/oauth2/callback ===> 请输入 OAuth2 提供商(github/gitlab/jihulab/gitee): github ===> 请输入 Oauth2 应用的 Client ID: **** ===> 请输入 Oauth2 应用的 Client Secret: **** ===> 请输入 GitHub/Gitee 登录名作为管理员,多个以逗号隔开: username ===> 请输入站点标题(如 TypeCodes Monitor): 哪吒面板 ===> 请输入站点访问端口: 25914 ===> 请输入用于 Agent 接入的 RPC 端口: 37012 面板配置 修改成功,请稍等重启生效 ====> 开始把进程[nezha-dashboard]写入到监控配置文件中/usr/home/username/serv00_ct8_nezha/config/monitor.conf 监控配置 [/home/username/nezha_app/dashboard|nezha-dashboard|./nezha-dashboard|background] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/monitor.conf] 中,本次不予写入 更新了CHECK_MONITOR_URL_DNS=1在配置文件中 是否安装哪吒agent? (Y/y 执行,N/n 不执行): y ===> 开始安装哪吒agent.... 正在获取监控Agent版本号 当前最新版本为: v0.19.3 正在下载Agent.... ===> Agent https://github.com/nezhahq/agent/releases/download/v0.19.3/nezha-agent_FreeBSD_amd64.zip 下载完成 ===> 请输入面板的域名: serv00-nezha.nezha.xyz ===> 面板的GRPCPort通信端口: 37012 ===> 面板的设置agent密钥,也可以后期再修改: ** ===> 启用针对 gRPC 端口的 SSL/TLS加密,无特殊情况请选择N-否: n ====> 开始把进程[nezha-agent]写入到监控配置文件中/usr/home/username/serv00_ct8_nezha/config/monitor.conf 监控配置 [/home/username/nezha_app/agent|nezha-agent|sh nezha-agent.sh|foreground] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/monitor.conf] 中,本次不予写入 ==> 开始把所有主机信息写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf ====> [1]号主机[username@s9.serv00.com]是当前主机,跳过不处理 ====> 开始把[2]号主机[username@s10.serv00.com]写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf 心跳配置 [s10.serv00.com|22|username] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf] 中,本次不予写入 ====> 开始把[3]号主机[username@s11.serv00.com]写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf 心跳配置 [s11.serv00.com|22|username] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf] 中,本次不予写入 ===> 开始通过进程监控配置文件,开启进程.... 即将执行 /usr/home/username/serv00_ct8_nezha/heart_beat_logic.py Process 'nezha-dashboard' is running. Process 'nezha-agent' is running. 定时任务已更新: /5 * /usr/home/username/serv00_ct8_nezha/heart_beat_entry.sh =======> 安装结束.... Masz nową pocztę w /var/mail/username

vfhky commented 2 months ago

image

附上日志信息(已做隐名处理)

[username@s9]:<~/serv00_ct8_nezha>$ python3 main.py ===> 从[config]目录生成配置文件成功.... ===> 开始初始化所有配置 ===> 结束初始化所有配置 是否生成私钥(一般是安装面板需要生成,安装agent时不需要)? (Y/y 执行,N/n 不执行): n ===> 开始读取host.conf主机配置文件.... 是否拷贝公私钥文件到各个主机(一般是安装面板需要生成,安装agent时不需要)? (Y/y 执行,N/n 不执行): n 是否安装哪吒dashboard? (Y/y 执行,N/n 不执行): y ===> 开始安装哪吒dashboard.... 当前最新版本为: v0.19.8 ===> dashboard https://github.com/naiba/nezha/archive/refs/tags/v0.19.8.zip 下载完成 修改面板配置 关于 GitHub Oauth2 应用:在 https://github.com/settings/developers 创建,无需审核,Callback 填 http(s)://域名或IP/oauth2/callback ===> 请输入 OAuth2 提供商(github/gitlab/jihulab/gitee): github ===> 请输入 Oauth2 应用的 Client ID: **** ===> 请输入 Oauth2 应用的 Client Secret: **** ===> 请输入 GitHub/Gitee 登录名作为管理员,多个以逗号隔开: username ===> 请输入站点标题(如 TypeCodes Monitor): 哪吒面板 ===> 请输入站点访问端口: 25914 ===> 请输入用于 Agent 接入的 RPC 端口: 37012 面板配置 修改成功,请稍等重启生效 ====> 开始把进程[nezha-dashboard]写入到监控配置文件中/usr/home/username/serv00_ct8_nezha/config/monitor.conf 监控配置 [/home/username/nezha_app/dashboard|nezha-dashboard|./nezha-dashboard|background] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/monitor.conf] 中,本次不予写入 更新了CHECK_MONITOR_URL_DNS=1在配置文件中 是否安装哪吒agent? (Y/y 执行,N/n 不执行): y ===> 开始安装哪吒agent.... 正在获取监控Agent版本号 当前最新版本为: v0.19.3 正在下载Agent.... ===> Agent https://github.com/nezhahq/agent/releases/download/v0.19.3/nezha-agent_FreeBSD_amd64.zip 下载完成 ===> 请输入面板的域名: serv00-nezha.nezha.xyz ===> 面板的GRPCPort通信端口: 37012 ===> 面板的设置agent密钥,也可以后期再修改: ** ===> 启用针对 gRPC 端口的 SSL/TLS加密,无特殊情况请选择N-否: n ====> 开始把进程[nezha-agent]写入到监控配置文件中/usr/home/username/serv00_ct8_nezha/config/monitor.conf 监控配置 [/home/username/nezha_app/agent|nezha-agent|sh nezha-agent.sh|foreground] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/monitor.conf] 中,本次不予写入 ==> 开始把所有主机信息写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf ====> [1]号主机[username@s9.serv00.com]是当前主机,跳过不处理 ====> 开始把[2]号主机[Opium5171@s10.serv00.com]写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf 心跳配置 [s10.serv00.com|22|Opium5171] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf] 中,本次不予写入 ====> 开始把[3]号主机[pium517@s11.serv00.com]写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf 心跳配置 [s11.serv00.com|22|pium517] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf] 中,本次不予写入 ===> 开始通过进程监控配置文件,开启进程.... 即将执行 /usr/home/username/serv00_ct8_nezha/heart_beat_logic.py Process 'nezha-dashboard' is running. Process 'nezha-agent' is running. 定时任务已更新: /5 * /usr/home/username/serv00_ct8_nezha/heart_beat_entry.sh =======> 安装结束.... Masz nową pocztę w /var/mail/username

agent那里填写的dashboard的域名要serv00的域名,或者你现在这个域名反代serv00的域名

behinder85 commented 2 months ago

譬如我的是在s9上的,就填s9.serv00.com

===> Agent https://github.com/nezhahq/agent/releases/download/v0.19.3/nezha-agent_FreeBSD_amd64.zip 下载完成 ===> 请输入面板的域名: s9.serv00.com ===> 面板的GRPCPort通信端口: 37012 ===> 面板的设置agent密钥,也可以后期再修改: kB5J1l1Z17h2T259Ys ===> 启用针对 gRPC 端口的 SSL/TLS加密,无特殊情况请选择N-否: n ====> 开始把进程[nezha-agent]写入到监控配置文件中/usr/home/username/serv00_ct8_nezha/config/monitor.conf 监控配置 [/home/username/nezha_app/agent|nezha-agent|sh nezha-agent.sh|foreground] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/monitor.conf] 中,本次不予写入 ==> 开始把所有主机信息写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf ====> [1]号主机[username@s9.serv00.com]是当前主机,跳过不处理 ====> 开始把[2]号主机[Opium5171@s10.serv00.com]写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf 心跳配置 [s10.serv00.com|22|Opium5171] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf] 中,本次不予写入 ====> 开始把[3]号主机[pium517@s11.serv00.com]写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf 心跳配置 [s11.serv00.com|22|pium517] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf] 中,本次不予写入 ===> 开始通过进程监控配置文件,开启进程.... 即将执行 /usr/home/username/serv00_ct8_nezha/heart_beat_logic.py Process 'nezha-dashboard' is running. Process 'nezha-agent' is running. 定时任务已更新: /5 * /usr/home/username/serv00_ct8_nezha/heart_beat_entry.sh =======> 安装结束....

好像还是不行耶

vfhky commented 2 months ago

譬如我的是在s9上的,就填s9.serv00.com

===> Agent https://github.com/nezhahq/agent/releases/download/v0.19.3/nezha-agent_FreeBSD_amd64.zip 下载完成 ===> 请输入面板的域名: s9.serv00.com ===> 面板的GRPCPort通信端口: 37012 ===> 面板的设置agent密钥,也可以后期再修改: kB5J1l1Z17h2T259Ys ===> 启用针对 gRPC 端口的 SSL/TLS加密,无特殊情况请选择N-否: n ====> 开始把进程[nezha-agent]写入到监控配置文件中/usr/home/username/serv00_ct8_nezha/config/monitor.conf 监控配置 [/home/username/nezha_app/agent|nezha-agent|sh nezha-agent.sh|foreground] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/monitor.conf] 中,本次不予写入 ==> 开始把所有主机信息写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf ====> [1]号主机[username@s9.serv00.com]是当前主机,跳过不处理 ====> 开始把[2]号主机[Opium5171@s10.serv00.com]写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf 心跳配置 [s10.serv00.com|22|Opium5171] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf] 中,本次不予写入 ====> 开始把[3]号主机[pium517@s11.serv00.com]写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf 心跳配置 [s11.serv00.com|22|pium517] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf] 中,本次不予写入 ===> 开始通过进程监控配置文件,开启进程.... 即将执行 /usr/home/username/serv00_ct8_nezha/heart_beat_logic.py Process 'nezha-dashboard' is running. Process 'nezha-agent' is running. 定时任务已更新: /5 * /usr/home/username/serv00_ct8_nezha/heart_beat_entry.sh =======> 安装结束....

好像还是不行耶

你在serv00的panel面板新增一个域名(可任意,例如我的是status.vfhky.serv00.net),然后选择proxy,port选择dashboard 的端口,你的好像是25941

vfhky commented 2 months ago

或者用那个默认的域名应该也可以,你登录panel的域名那里就可以看到

behinder85 commented 2 months ago

譬如我的是在s9上的,就填s9.serv00.com

===> Agent https://github.com/nezhahq/agent/releases/download/v0.19.3/nezha-agent_FreeBSD_amd64.zip 下载完成 ===> 请输入面板的域名: s9.serv00.com ===> 面板的GRPCPort通信端口: 37012 ===> 面板的设置agent密钥,也可以后期再修改: kB5J1l1Z17h2T259Ys ===> 启用针对 gRPC 端口的 SSL/TLS加密,无特殊情况请选择N-否: n ====> 开始把进程[nezha-agent]写入到监控配置文件中/usr/home/username/serv00_ct8_nezha/config/monitor.conf 监控配置 [/home/username/nezha_app/agent|nezha-agent|sh nezha-agent.sh|foreground] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/monitor.conf] 中,本次不予写入 ==> 开始把所有主机信息写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf ====> [1]号主机[username@s9.serv00.com]是当前主机,跳过不处理 ====> 开始把[2]号主机[Opium5171@s10.serv00.com]写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf 心跳配置 [s10.serv00.com|22|Opium5171] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf] 中,本次不予写入 ====> 开始把[3]号主机[pium517@s11.serv00.com]写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf 心跳配置 [s11.serv00.com|22|pium517] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf] 中,本次不予写入 ===> 开始通过进程监控配置文件,开启进程.... 即将执行 /usr/home/username/serv00_ct8_nezha/heart_beat_logic.py Process 'nezha-dashboard' is running. Process 'nezha-agent' is running. 定时任务已更新: /5 * /usr/home/username/serv00_ct8_nezha/heart_beat_entry.sh =======> 安装结束....

好像还是不行耶

你在serv00的panel面板新增一个域名(可任意,例如我的是status.vfhky.serv00.net),然后选择proxy,port选择dashboard 的端口,你的好像是25941

image

[username@s9]:<~/serv00_ct8_nezha>$ python3 main.py ===> 从[config]目录生成配置文件成功.... ===> 开始初始化所有配置 ===> 结束初始化所有配置 是否生成私钥(一般是安装面板需要生成,安装agent时不需要)? (Y/y 执行,N/n 不执行): n ===> 开始读取host.conf主机配置文件.... 是否拷贝公私钥文件到各个主机(一般是安装面板需要生成,安装agent时不需要)? (Y/y 执行,N/n 不执行): n 是否安装哪吒dashboard? (Y/y 执行,N/n 不执行): n 是否安装哪吒agent? (Y/y 执行,N/n 不执行): y ===> 开始安装哪吒agent.... 正在获取监控Agent版本号 /usr/home/username/serv00_ct8_nezha/download_nezha.sh: fork: retry: Resource temporarily unavailable /usr/home/username/serv00_ct8_nezha/download_nezha.sh: fork: retry: Resource temporarily unavailable 当前最新版本为: v0.19.3 正在下载Agent.... ===> Agent https://github.com/nezhahq/agent/releases/download/v0.19.3/nezha-agent_FreeBSD_amd64.zip 下载完成 ===> 请输入面板的域名: status.behinder29.serv00.net ===> 面板的GRPCPort通信端口: 37012 ===> 面板的设置agent密钥,也可以后期再修改: kB5J1l1Z17h2T259Ys ===> 启用针对 gRPC 端口的 SSL/TLS加密,无特殊情况请选择N-否: N /usr/home/username/serv00_ct8_nezha/download_nezha.sh: fork: retry: Resource temporarily unavailable ====> 开始把进程[nezha-agent]写入到监控配置文件中/usr/home/username/serv00_ct8_nezha/config/monitor.conf 监控配置 [/home/username/nezha_app/agent|nezha-agent|sh nezha-agent.sh|foreground] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/monitor.conf] 中,本次不予写入 ==> 开始把所有主机信息写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf ====> [1]号主机[username@s9.serv00.com]是当前主机,跳过不处理 ====> 开始把[2]号主机[username@s10.serv00.com]写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf 心跳配置 [s10.serv00.com|22|username] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf] 中,本次不予写入 ====> 开始把[3]号主机[username@s11.serv00.com]写入到心跳配置文件中/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf 心跳配置 [s11.serv00.com|22|username] 已经存在于 [/usr/home/username/serv00_ct8_nezha/config/heartbeat.conf] 中,本次不予写入 ===> 开始通过进程监控配置文件,开启进程.... md5sum: Unable to initialize casper: Resource temporarily unavailable Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: paramiko==3.4.1 in /home/username/.local/lib/python3.11/site-packages (from -r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 1)) (3.4.1) Requirement already satisfied: python-telegram-bot==21.4 in /home/username/.local/lib/python3.11/site-packages (from -r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 2)) (21.4) Requirement already satisfied: pytz==2024.1 in /usr/local/lib/python3.11/site-packages (from -r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 3)) (2024.1) Requirement already satisfied: Requests==2.32.3 in /usr/local/lib/python3.11/site-packages (from -r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 4)) (2.32.3) Requirement already satisfied: bcrypt>=3.2 in /usr/local/lib/python3.11/site-packages (from paramiko==3.4.1->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 1)) (3.2.2) Requirement already satisfied: cryptography>=3.3 in /usr/local/lib/python3.11/site-packages (from paramiko==3.4.1->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 1)) (42.0.8) Requirement already satisfied: pynacl>=1.5 in /usr/local/lib/python3.11/site-packages (from paramiko==3.4.1->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 1)) (1.5.0) Requirement already satisfied: httpx~=0.27 in /usr/local/lib/python3.11/site-packages (from python-telegram-bot==21.4->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 2)) (0.27.0) Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/site-packages (from Requests==2.32.3->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 4)) (3.3.2) Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/site-packages (from Requests==2.32.3->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 4)) (3.7) Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from Requests==2.32.3->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 4)) (1.26.18) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from Requests==2.32.3->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 4)) (2024.6.2) Requirement already satisfied: cffi>=1.1 in /usr/local/lib/python3.11/site-packages (from bcrypt>=3.2->paramiko==3.4.1->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 1)) (1.16.0) Requirement already satisfied: anyio in /usr/local/lib/python3.11/site-packages (from httpx~=0.27->python-telegram-bot==21.4->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 2)) (4.4.0) Requirement already satisfied: httpcore==1. in /usr/local/lib/python3.11/site-packages (from httpx~=0.27->python-telegram-bot==21.4->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 2)) (1.0.5) Requirement already satisfied: sniffio in /usr/local/lib/python3.11/site-packages (from httpx~=0.27->python-telegram-bot==21.4->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 2)) (1.3.1) Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.11/site-packages (from httpcore==1.->httpx~=0.27->python-telegram-bot==21.4->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 2)) (0.14.0) Requirement already satisfied: pycparser in /usr/local/lib/python3.11/site-packages (from cffi>=1.1->bcrypt>=3.2->paramiko==3.4.1->-r /usr/home/username/serv00_ct8_nezha/requirements.txt (line 1)) (2.22) 即将执行 /usr/home/username/serv00_ct8_nezha/heart_beat_logic.py Process 'nezha-dashboard' is running. Process 'nezha-agent' is running. 定时任务已更新: /5 * /usr/home/username/serv00_ct8_nezha/heart_beat_entry.sh

好像还是不行 image

behinder85 commented 2 months ago

只有本机的不行 其他的可以,好奇怪

behinder85 commented 2 months ago

只有本机的不行 其他的可以,好奇怪

还是域名的问题,不能用CF反代的域名 而且需要杀死进程重新配置才能实现重连

vfhky commented 2 months ago

只有本机的不行 其他的可以,好奇怪

还是域名的问题,不能用CF反代的域名 而且需要杀死进程重新配置才能实现重连

是的,改配置直接用bash utils.sh modify_config 命令就行了,参考文章 https://typecodes.com/python/serv00ct8nezha4.html 。重装不会kill掉已有进程,得手工停掉等定时任务重新拉起进程或者手工拉起进程(命令:bash heart_beat_entry.sh )。