Serv00挂哪吒探针

1、登录serv00后台修改权限

登录serv00后台按照下面顺序点击将权限如图所示打开 Account information -> Run your own applications -> Enabled 1

2、登录ssh登录serv00机器

安装pm2

1
2
bash <(curl -s https://raw.githubusercontent.com/k0baya/alist_repl/main/serv00/install-pm2.sh)
pm2 --version

下载agent程序解压

1
2
wget -O nezha-agent.zip https://github.com/nezhahq/agent/releases/latest/download/nezha-agent_freebsd_amd64.zip
unzip nezha-agent.zip

从其他机器复制config.yml 修改uuid或复制下面配置修改client_secretservertlsuuid到nezha-agent 文件夹内
client_secret 为 复制安装命令中的:NZ_CLIENT_SECRET字段

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
client_secret: your_client_secret
debug: false
disable_auto_update: false
disable_command_execute: false
disable_force_update: false
disable_nat: false
disable_send_query: false
gpu: false
insecure_tls: false
ip_report_period: 1800
report_delay: 1
self_update_period: 0
server: dmian:port
skip_connection_count: false
skip_procs_count: false
temperature: false
tls: true
use_gitee_to_upgrade: false
use_ipv6_country_code: false
uuid: 0ea0c303-bdf9-11ef-9

添加权限

1
chmod +x nezha-agent

添加cron任务

添加shell程序

1
nano status.sh

复制下面shell

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
if ! pgrep -f ".*PM2.*God Daemon.*\.pm2" > /dev/null
then
    echo "PM2 is not running. Starting PM2..."
    ~/.npm-global/bin/pm2 resurrect
    echo "$(date) - restarted" >> ~/pm2_check.log
else
    echo "PM2 is running."
fi

# 检查 nezha-agent 是否在运行
if pgrep -x "nezha-agent" > /dev/null; then
    echo "nezha is running."
else
    echo "nezha-agent is not running, starting it now..."
    pm2 start nezha-agent/nezha-agent
    echo "nezha-agent has been started."
fi

添加权限

1
chmod +x status.sh

去serv00后台添加crontab 按照下图去添加运行上面脚本注意修改xxx 为你的目录

1
/bin/bash /home/xxx/status.sh

2 如v1后台没有显示需检测config配置

0%