全球主机交流论坛

标题: 有没有探针是可以用vnstat的数据的? [打印本页]

作者: licong    时间: 2023-6-17 10:54
标题: 有没有探针是可以用vnstat的数据的?
https://github.com/cppla/ServerStatus
https://github.com/zdz/ServerStatus-Rust
找了两个,第二个倒是说可以支持VNSTAT,但是配置起来一直出错,有老哥推荐的么?

作者: 炒土豆丝    时间: 2023-6-17 11:07
https://github.com/cokemine/ServerStatus-Hotaru
作者: licong    时间: 2023-6-17 11:10
炒土豆丝 发表于 2023-6-17 11:07
https://github.com/cokemine/ServerStatus-Hotaru

这个似乎又缺了3网延迟。。。。
作者: hacn    时间: 2023-6-17 11:54
这两个都可以吧 其他好像没了
作者: licong    时间: 2023-6-17 12:13
hacn 发表于 2023-6-17 11:54
这两个都可以吧 其他好像没了

第二个我用 rust后者python 都出错。。。哎
作者: AaronYYDS    时间: 2023-6-17 13:24
rust的没有问题啊 报错贴出来 帮你看看
作者: licong    时间: 2023-6-17 13:50
AaronYYDS 发表于 2023-6-17 13:24
rust的没有问题啊 报错贴出来 帮你看看

● stat_server.service - ServerStatus-Rust Server
     Loaded: loaded (/etc/systemd/system/stat_server.service; disabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Sat 2023-06-17 01:50:01 EDT; 6ms ago
    Process: 14016 ExecStart=/opt/ServerStatus/stat_server -c /opt/ServerStatus/config.toml (code=exited, status=203/EXEC)
   Main PID: 14016 (code=exited, status=203/EXEC)

作者: licong    时间: 2023-6-17 14:01
AaronYYDS 发表于 2023-6-17 13:24
rust的没有问题啊 报错贴出来 帮你看看

换了python版的就一直在跑码。。。。。也是不行
作者: AaronYYDS    时间: 2023-6-17 14:38
licong 发表于 2023-6-17 13:50
● stat_server.service - ServerStatus-Rust Server
     Loaded: loaded (/etc/systemd/system/stat_se ...

手动执行 /opt/ServerStatus/stat_server -c /opt/ServerStatus/config.toml 看看

权限给了吗
作者: licong    时间: 2023-6-17 15:28
AaronYYDS 发表于 2023-6-17 14:38
手动执行 /opt/ServerStatus/stat_server -c /opt/ServerStatus/config.toml 看看

权限给了吗 ...

root@ubuntu:/opt/ServerStatus# /opt/ServerStatus/stat_server -c /opt/ServerStatus/config.toml
-bash: /opt/ServerStatus/stat_server: cannot execute binary file: Exec format error
root@ubuntu:/opt/ServerStatus# bash -ex one-touch.sh ./stat_server -c config.toml
+ set -ex
+ WORKSPACE=/opt/ServerStatus
+ mkdir -p /opt/ServerStatus
+ cd /opt/ServerStatus
+ OS_ARCH=x86_64
++ sed 's/\"//g;s/,//g;s/ //g'
++ awk -F : '{print $2}'
++ head -n 1
++ grep tag_name
++ curl -m 10 -sL https://api.github.com/repos/zdz/ServerStatus-Rust/releases/latest
+ latest_version=v1.7.2
+ wget --no-check-certificate -qO server-x86_64-unknown-linux-musl.zip https://github.com/zdz/ServerStatus-Rust/releases/download/v1.7.2/server-x86_64-unknown-linux-musl.zip
+ wget --no-check-certificate -qO client-x86_64-unknown-linux-musl.zip https://github.com/zdz/ServerStatus-Rust/releases/download/v1.7.2/client-x86_64-unknown-linux-musl.zip
+ unzip -o server-x86_64-unknown-linux-musl.zip
Archive:  server-x86_64-unknown-linux-musl.zip
  inflating: stat_server            
  inflating: stat_server.service     
  inflating: config.toml            
+ unzip -o client-x86_64-unknown-linux-musl.zip
Archive:  client-x86_64-unknown-linux-musl.zip
  inflating: stat_client            
  inflating: stat_client.service     
+ mv -v stat_server.service /etc/systemd/system/stat_server.service
renamed 'stat_server.service' -> '/etc/systemd/system/stat_server.service'
+ mv -v stat_client.service /etc/systemd/system/stat_client.service
renamed 'stat_client.service' -> '/etc/systemd/system/stat_client.service'
+ systemctl daemon-reload
+ systemctl start stat_server
+ systemctl start stat_client
+ systemctl status stat_server
● stat_server.service - ServerStatus-Rust Server
     Loaded: loaded (/etc/systemd/system/stat_server.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-06-17 03:27:05 EDT; 46ms ago
   Main PID: 11061 ((t_server))
      Tasks: 1 (limit: 6999)
     Memory: 48.0K
     CGroup: /system.slice/stat_server.service

Jun 17 03:27:05 ubuntu systemd[1]: Started ServerStatus-Rust Server.
Jun 17 03:27:05 ubuntu systemd[11061]: stat_server.service: Failed to execute command: Exec format error
Jun 17 03:27:05 ubuntu systemd[11061]: stat_server.service: Failed at step EXEC spawning /opt/ServerStatus/stat_server: Exec format error
+ systemctl status stat_client
● stat_client.service - ServerStatus-Rust Client
     Loaded: loaded (/etc/systemd/system/stat_client.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Sat 2023-06-17 03:27:05 EDT; 1ms ago
    Process: 11065 ExecStart=/opt/ServerStatus/stat_client -a http://127.0.0.1:8080/report -u h1 -p p1 (code=exited, status=203/EXEC)
   Main PID: 11065 (code=exited, status=203/EXEC)

Jun 17 03:27:05 ubuntu systemd[1]: stat_client.service: Main process exited, code=exited, status=203/EXEC
Jun 17 03:27:05 ubuntu systemd[1]: stat_client.service: Failed with result 'exit-code'.
root@ubuntu:/opt/ServerStatus#

好像报错差不多
作者: Faker007    时间: 2023-6-18 16:01
https://github.com/zdz/ServerStatus-Rust

这个没问题的,要先装vnstat




欢迎光临 全球主机交流论坛 (https://fd.vvwvv.eu.org/) Powered by Discuz! X3.4