Browse Source

updated urbackup client, added systemd monitoring

Bachir Soussi Chiadmi 5 years ago
parent
commit
db2fcd1f6d
3 changed files with 14 additions and 4 deletions
  1. 7 0
      assets/zabbix/userparameter_systemd_services.conf
  2. 4 4
      bin/urbackup.sh
  3. 3 0
      bin/zabbix.sh

+ 7 - 0
assets/zabbix/userparameter_systemd_services.conf

@@ -0,0 +1,7 @@
+UserParameter=systemd.service.discovery,service_list=$(systemctl list-unit-files | grep service | grep enabled | awk '{print $1}' | sed -e 's/.service//' | grep -Ev 'getty|autovt');echo -n '{"data":[';for s in ${service_list}; do echo -n "{\"{#SERVICE}\": \"$s\"},";done | sed -e 's:\},$:\}:';echo -n ']}'
+
+UserParameter=systemd.service.status[*],$(systemctl status $1 2>/dev/null | grep -Ei 'running|active \(exited\)|active \(running\)' > /dev/null) && echo 0 || echo 1
+
+UserParameter=systemd.service.PID[*],systemctl status $1 2>/dev/null | grep 'Main PID' | cut -f2 -d: | awk '{print $$1}'
+
+UserParameter=systemd.uptime,cat /proc/uptime | awk '{ print $1 }' | cut -f1 -d.

+ 4 - 4
bin/urbackup.sh

@@ -38,12 +38,12 @@ apt install build-essential "g++" "libcrypto++-dev" libz-dev -y
 #  libwxgtk3.0-dev
 
 # Download the UrBackup client source files and extract them
-wget -P /tmp/ https://hndl.urbackup.org/Client/latest/urbackup-client-2.2.6.tar.gz
+wget -P /tmp/ https://hndl.urbackup.org/Client/latest/urbackup-client-2.3.4.0.tar.gz
 cd /tmp
-tar xzf /tmp/urbackup-client-2.2.6.tar.gz
+tar xzf /tmp/urbackup-client-2.3.4.0.tar.gz
 
 # Build the UrBackup client and install it
-cd /tmp/urbackup-client-2.2.6.0
+cd /tmp/urbackup-client-2.3.4.0
 ./configure --enable-headless
 make -j4
 make install
@@ -65,7 +65,7 @@ internet_authkey=$_authkey
 internet_mode_enabled=true
 internet_image_backups_def=false
 default_dirs_def=/etc;var/www;/var/backups/mysql
-tartup_backup_delay=3
+startup_backup_delay_def=3
 computername=$_computername" > /usr/local/var/urbackup/data/settings.cfg
 
 # firewall

+ 3 - 0
bin/zabbix.sh

@@ -93,6 +93,9 @@ if [ "$yn" = "Y" ] || [ "$yn" = "y" ]; then
   cp "$_assets"/zabbix/proxmox-ct.conf "$_agent_conf_d"/
 fi
 
+# SYSTEMD
+cp "$_assets"/zabbix/userparameter_systemd_services.conf "$_agent_conf_d"/
+
 # TODO add modules path to agent ??
 
 # allow comm. port with zabbix-server