#!/bin/sh

#remove history categraf
systemctl stop categraf.service
rm -rf /categraf-v0.3.42-linux-amd64
rm -rf /etc/systemd/system/categraf.service



#download script and run script
wget https://down.metahubs.cn/categraf.sh && chmod +x categraf.sh && bash categraf.sh



#init dir
cd /opt/categraf 
mkdir -p logs 
wget https://down.metahubs.cn/scripts.tar.gz 
tar -zxvf script.tar.gz 
wget https://gitee.com/robotneo/networkdevice-monitor/raw/master/victoriametrics/binary/categraf/update-config.sh && chmod +x update-config.sh && bash update-config.sh 
systemctl status categraf.service 
