|
|
|
|
@ -710,7 +710,7 @@ sudo sed -i "s/COLOR_2 =.*/$variable5/g" /opt/FDMR-Monitor/fdmr-mon.cfg
|
|
|
|
|
chmod +x /opt/FDMR-Monitor/sysinfo/*
|
|
|
|
|
sh /opt/FDMR-Monitor/sysinfo/rrd-db.sh
|
|
|
|
|
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
systemctl daemon-reload &&
|
|
|
|
|
|
|
|
|
|
##############
|
|
|
|
|
if systemctl status mariadb.service |grep inactive >/dev/null 2>&1
|
|
|
|
|
@ -721,24 +721,30 @@ if systemctl status mariadb.service |grep disable >/dev/null 2>&1
|
|
|
|
|
then sudo systemctl enable mariadb.service
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
sudo systemctl disable fdmr_mon2.service
|
|
|
|
|
if ! systemctl status fdmr_mon.service | grep "service; enabled;" >/dev/null 2>&1; then
|
|
|
|
|
sudo systemctl enable fdmr_mon.service
|
|
|
|
|
if systemctl status fdmr_mon.service |grep "service; enabled;" >/dev/null 2>&1
|
|
|
|
|
then
|
|
|
|
|
sudo systemctl stop fdmr_mon.service
|
|
|
|
|
sudo systemctl start fdmr_mon.service
|
|
|
|
|
(crontab -l; echo "* */24 * * * rm /opt/FDMR-Monitor/data/*") | awk '!x[$0]++' | crontab -
|
|
|
|
|
(crontab -l; echo "*/2 * * * * sh /opt/FDMR-Monitor/sysinfo/cpu.sh") | awk '!x[$0]++' | crontab -
|
|
|
|
|
(crontab -l; echo "*/5 * * * * sh /opt/FDMR-Monitor/sysinfo/graph.sh") | awk '!x[$0]++' | crontab -
|
|
|
|
|
(crontab -l | grep -v "rm /opt/FDMR-Monitor2/data/*") | crontab -
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
if systemctl status fdmr_mon2.service |grep "service; enabled;" >/dev/null 2>&1
|
|
|
|
|
then
|
|
|
|
|
sudo systemctl stop fdmr_mon2.service
|
|
|
|
|
sudo systemctl start fdmr_mon2.service
|
|
|
|
|
(crontab -l; echo "* */24 * * * rm /opt/FDMR-Monitor2/data/*") | awk '!x[$0]++' | crontab -
|
|
|
|
|
(crontab -l | grep -v "rm /opt/FDMR-Monitor/data/*") | crontab -
|
|
|
|
|
(crontab -l | grep -v "sh /opt/FDMR-Monitor/sysinfo/cpu.sh") | crontab -
|
|
|
|
|
(crontab -l | grep -v "sh /opt/FDMR-Monitor/sysinfo/graph.sh") | crontab -
|
|
|
|
|
|
|
|
|
|
##############
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
systemctl daemon-reload &&
|
|
|
|
|
systemctl start fdmr_mon.service
|
|
|
|
|
sh /opt/extra-2.sh
|
|
|
|
|
|
|
|
|
|
cronedit.sh '*/5 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/graph.sh' add &&
|
|
|
|
|
cronedit.sh '*/2 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/cpu.sh' add &&
|
|
|
|
|
cronedit.sh '*/5 * * * *' 'sh /etc/freedmr/hbmon/sysinfo/graph.sh' remove &&
|
|
|
|
|
cronedit.sh '*/2 * * * *' 'sh /etc/freedmr/hbmon/sysinfo/cpu.sh' remove &&
|
|
|
|
|
cronedit.sh '* */24 * * *' 'rm /etc/freedmr/hbmon/data/*' remove &&
|
|
|
|
|
cronedit.sh '* */24 * * *' 'rm /opt/FDMR-Monitor/data/*' add &&
|
|
|
|
|
cronedit.sh '* */24 * * *' 'rm /opt/FDMR-Monitor2/data/*' remove
|
|
|
|
|
##############
|
|
|
|
|
sh /opt/extra-2.sh
|
|
|
|
|
|
|
|
|
|
if [ -f "/etc/nginx/sites-enabled/freedmr" ]; then
|
|
|
|
|
mv /etc/nginx/sites-enabled/freedmr /etc/nginx/sites-enabled/adn
|
|
|
|
|
@ -930,28 +936,37 @@ cd /opt/FDMR-Monitor2
|
|
|
|
|
python3 mon_db.py --create &&
|
|
|
|
|
python3 mon_db.py --update
|
|
|
|
|
|
|
|
|
|
sudo systemctl daemon-reload &&
|
|
|
|
|
#####################################
|
|
|
|
|
if systemctl status mariadb.service |grep inactive >/dev/null 2>&1
|
|
|
|
|
then sudo systemctl start mariadb.service
|
|
|
|
|
|
|
|
|
|
sudo systemctl disable fdmr_mon.service
|
|
|
|
|
if ! systemctl status fdmr_mon2.service | grep "service; enabled;" >/dev/null 2>&1; then
|
|
|
|
|
sudo systemctl enable fdmr_mon2.service
|
|
|
|
|
fi
|
|
|
|
|
if systemctl status mariadb.service |grep disable >/dev/null 2>&1
|
|
|
|
|
then sudo systemctl enable mariadb.service
|
|
|
|
|
|
|
|
|
|
variable1=$(grep "Web-Dashboar-Port:" /opt/wdp | grep -Eo '[A.0-9]{1,9}') &&
|
|
|
|
|
if [ -z "$variable1" ]
|
|
|
|
|
then variable1=80
|
|
|
|
|
fi
|
|
|
|
|
if systemctl status fdmr_mon.service |grep "service; enabled;" >/dev/null 2>&1
|
|
|
|
|
then
|
|
|
|
|
sudo systemctl stop fdmr_mon.service
|
|
|
|
|
sudo systemctl start fdmr_mon.service
|
|
|
|
|
(crontab -l; echo "* */24 * * * rm /opt/FDMR-Monitor/data/*") | awk '!x[$0]++' | crontab -
|
|
|
|
|
(crontab -l; echo "*/2 * * * * sh /opt/FDMR-Monitor/sysinfo/cpu.sh") | awk '!x[$0]++' | crontab -
|
|
|
|
|
(crontab -l; echo "*/5 * * * * sh /opt/FDMR-Monitor/sysinfo/graph.sh") | awk '!x[$0]++' | crontab -
|
|
|
|
|
(crontab -l | grep -v "rm /opt/FDMR-Monitor2/data/*") | crontab -
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
systemctl start fdmr_mon2.service
|
|
|
|
|
sh /opt/extra-3.sh
|
|
|
|
|
fi
|
|
|
|
|
if systemctl status fdmr_mon2.service |grep "service; enabled;" >/dev/null 2>&1
|
|
|
|
|
then
|
|
|
|
|
sudo systemctl stop fdmr_mon2.service
|
|
|
|
|
sudo systemctl start fdmr_mon2.service
|
|
|
|
|
(crontab -l; echo "* */24 * * * rm /opt/FDMR-Monitor2/data/*") | awk '!x[$0]++' | crontab -
|
|
|
|
|
(crontab -l | grep -v "rm /opt/FDMR-Monitor/data/*") | crontab -
|
|
|
|
|
(crontab -l | grep -v "sh /opt/FDMR-Monitor/sysinfo/cpu.sh") | crontab -
|
|
|
|
|
(crontab -l | grep -v "sh /opt/FDMR-Monitor/sysinfo/graph.sh") | crontab -
|
|
|
|
|
|
|
|
|
|
cronedit.sh '*/5 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/graph.sh' remove &&
|
|
|
|
|
cronedit.sh '*/2 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/cpu.sh' remove &&
|
|
|
|
|
cronedit.sh '*/5 * * * *' 'sh /etc/freedmr/hbmon/sysinfo/graph.sh' remove &&
|
|
|
|
|
cronedit.sh '*/2 * * * *' 'sh /etc/freedmr/hbmon/sysinfo/cpu.sh' remove &&
|
|
|
|
|
cronedit.sh '* */24 * * *' 'rm /etc/freedmr/hbmon/data/*' remove &&
|
|
|
|
|
cronedit.sh '* */24 * * *' 'rm /opt/FDMR-Monitor/data/*' remove &&
|
|
|
|
|
cronedit.sh '* */24 * * *' 'rm /opt/FDMR-Monitor2/data/*' add
|
|
|
|
|
fi
|
|
|
|
|
sh /opt/extra-3.sh
|
|
|
|
|
|
|
|
|
|
if [ -f "/etc/nginx/sites-enabled/freedmr" ]; then
|
|
|
|
|
mv /etc/nginx/sites-enabled/freedmr /etc/nginx/sites-enabled/adn
|
|
|
|
|
|