diff --git a/assets/zabbix/userparameter_systemd_services.conf b/assets/zabbix/userparameter_systemd_services.conf new file mode 100644 index 0000000..f3478e8 --- /dev/null +++ b/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. diff --git a/bin/urbackup.sh b/bin/urbackup.sh index f6598e2..83a36af 100755 --- a/bin/urbackup.sh +++ b/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 diff --git a/bin/zabbix.sh b/bin/zabbix.sh index 4b5a359..d65f57f 100755 --- a/bin/zabbix.sh +++ b/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