效果
Docker部署
创建挂载目录
mkdir -p /data/netdata/{netdatacache,netdatalib}
docker运行
docker run -d --name=netdata \-p 19999:19999 \-v /data/netdata/netdatalib:/var/lib/netdata \-v /data/netdata/netdatacache:/var/cache/netdata \-v /etc/passwd:/host/etc/passwd:ro \-v /etc/group:/host/etc/group:ro \-v /proc:/host/proc:ro \-v /sys:/host/sys:ro \-v /etc/os-release:/host/etc/os-release:ro \--restart always \--cap-add SYS_PTRACE \--security-opt apparmor=unconfined \netdata/netdata
通过ip:19999端口访问web界面
此时默认是英文界面,netdata暂不支持中文语言
netdata汉化
下载汉化文件,我这直接git拉取
git clone https://gitee.com/DXLinux/Netdata-chinese-patch.git[root@monster netdata]# ll Netdata-chinese-patch/
total 836
-rwxr-xr-x 1 root root 125124 Aug 7 16:24 dashboard_info.js
-rwxr-xr-x 1 root root 379728 Aug 7 16:24 dashboard.js
-rwxr-xr-x 1 root root 134097 Aug 7 16:24 index.html
-rw-r--r-- 1 root root 720 Aug 7 16:24 install-Netdata-chinese-patch.sh
-rwxr-xr-x 1 root root 20223 Aug 7 16:24 install-Netdata-chinese.sh
-rwxr-xr-x 1 root root 182742 Aug 7 16:24 main.js
-rwxr-xr-x 1 root root 1503 Aug 7 16:24 README.md
[root@monster netdata]#
修改dashboard.js文件
[root@monster Netdata-chinese-patch]# vi dashboard.js
快速搜索定位/NETDATA.jQuery ,将jquery版本修改成jquery-3.6.0.min.js
NETDATA.jQuery = NETDATA.serverStatic + 'lib/jquery-3.6.0.min.js';
进入netdata容器
docker exec -it netdata bash
切换到web目录下
cd /usr/share/netdata/web
将dashboard_info.js、、index.html、main.js这几个文件删除,退出容器
rm -rf dashboard_info.js
rm -rf dashboard.js
rm -rf index.html
rm -rf main.js
将汉化的4个文件拷贝进容器
docker cp dashboard_info.js netdata:/usr/share/netdata/web
docker cp dashboard.js netdata:/usr/share/netdata/web
docker cp index.html netdata:/usr/share/netdata/web
docker cp main.js netdata:/usr/share/netdata/web
重启netdata容器
docker restart netdata