diff --git a/Conf/userparameter_backup_age.conf b/Conf/userparameter_backup_age.conf deleted file mode 100644 index 90b4871..0000000 --- a/Conf/userparameter_backup_age.conf +++ /dev/null @@ -1,3 +0,0 @@ -UserParameter=status_file.discovery,{{ zabbix_script_dir }}/lld_backup_status_file.py -UserParameter=check_age[*],sudo {{ zabbix_script_dir }}/check_age_quiet.py "$1" - diff --git a/Conf/userparameter_certificates.conf b/Conf/userparameter_certificates.conf deleted file mode 100644 index fc3e573..0000000 --- a/Conf/userparameter_certificates.conf +++ /dev/null @@ -1,2 +0,0 @@ -UserParameter=certificate.discovery,{{ zabbix_script_dir }}/lld_certlist.py - diff --git a/Conf/userparameter_diskstats.conf b/Conf/userparameter_diskstats.conf deleted file mode 100644 index 5528ce5..0000000 --- a/Conf/userparameter_diskstats.conf +++ /dev/null @@ -1,13 +0,0 @@ -UserParameter=custom.vfs.discover_disks,{{ zabbix_script_dir }}/lld-disks.py - -UserParameter=custom.vfs.dev.read.ops[*],awk '{print $$1}' /sys/class/block/$1/stat -UserParameter=custom.vfs.dev.read.merged[*],awk '{print $$2}' /sys/class/block/$1/stat -UserParameter=custom.vfs.dev.read.sectors[*],awk '{print $$3}' /sys/class/block/$1/stat -UserParameter=custom.vfs.dev.read.ms[*],awk '{print $$4}' /sys/class/block/$1/stat -UserParameter=custom.vfs.dev.write.ops[*],awk '{print $$5}' /sys/class/block/$1/stat -UserParameter=custom.vfs.dev.write.merged[*],awk '{print $$6}' /sys/class/block/$1/stat -UserParameter=custom.vfs.dev.write.sectors[*],awk '{print $$7}' /sys/class/block/$1/stat -UserParameter=custom.vfs.dev.write.ms[*],awk '{print $$8}' /sys/class/block/$1/stat -UserParameter=custom.vfs.dev.io.active[*],awk '{print $$9}' /sys/class/block/$1/stat -UserParameter=custom.vfs.dev.io.ms[*],awk '{print $$10}' /sys/class/block/$1/stat -UserParameter=custom.vfs.dev.weight.io.ms[*],awk '{print $$11}' /sys/class/block/$1/stat diff --git a/Conf/userparameter_filelist.conf b/Conf/userparameter_filelist.conf deleted file mode 100644 index 79c0849..0000000 --- a/Conf/userparameter_filelist.conf +++ /dev/null @@ -1 +0,0 @@ -UserParameter=lld_file_list.discovery[*],{{ zabbix_script_dir }}/lld_filelist.py "$1" diff --git a/Conf/userparameter_mountpoint.conf b/Conf/userparameter_mountpoint.conf deleted file mode 100644 index 45e85b0..0000000 --- a/Conf/userparameter_mountpoint.conf +++ /dev/null @@ -1,2 +0,0 @@ -UserParameter=check_mountpoint[*],grep -q "$1" /proc/mounts ; echo $? - diff --git a/Conf/userparameter_mysql.conf b/Conf/userparameter_mysql.conf deleted file mode 100644 index 9c59bf3..0000000 --- a/Conf/userparameter_mysql.conf +++ /dev/null @@ -1,21 +0,0 @@ -# For all the following commands HOME should be set to the directory that has .my.cnf file with password information. - -# Flexible parameter to grab global variables. On the frontend side, use keys like mysql.status[Com_insert]. -# Key syntax is mysql.status[variable]. -UserParameter=mysql.status[*],echo "show global status where Variable_name='$1';" | HOME={{ zabbix_home_dir }} mysql -N | awk '{print $$2}' -UserParameter=mysql.status_on[*],echo "show global status where Variable_name='$1';" | HOME={{ zabbix_home_dir }} mysql -N | awk '{print $$2}'| sed 's/ON/1/' | sed 's/OFF/0/' - -# Flexible parameter to determine database or table size. On the frontend side, use keys like mysql.size[zabbix,history,data]. -# Key syntax is mysql.size[,,]. -# Database may be a database name or "all". Default is "all". -# Table may be a table name or "all". Default is "all". -# Type may be "data", "index", "free" or "both". Both is a sum of data and index. Default is "both". -# Database is mandatory if a table is specified. Type may be specified always. -# Returns value in bytes. -# 'sum' on data_length or index_length alone needed when we are getting this information for whole database instead of a single table -UserParameter=mysql.size[*],bash -c 'echo "select sum($(case "$3" in both|"") echo "data_length+index_length";; data|index) echo "$3_length";; free) echo "data_free";; esac)) from information_schema.tables$([[ "$1" = "all" || ! "$1" ]] || echo " where table_schema=\"$1\"")$([[ "$2" = "all" || ! "$2" ]] || echo "and table_name=\"$2\"");" | HOME={{ zabbix_home_dir }} mysql -N' - -UserParameter=mysql.ping,HOME={{ zabbix_home_dir }} mysqladmin ping | grep -c alive -UserParameter=mysql.version,mysql -V - - diff --git a/Conf/userparameter_postfix.conf b/Conf/userparameter_postfix.conf deleted file mode 100644 index 8d49dc9..0000000 --- a/Conf/userparameter_postfix.conf +++ /dev/null @@ -1,2 +0,0 @@ -UserParameter=postfix.queue,mailq | grep -v "Mail queue is empty" | egrep -c '^[0-9A-F]{10}' - diff --git a/Conf/userparameter_processlist.conf b/Conf/userparameter_processlist.conf deleted file mode 100644 index da03ff6..0000000 --- a/Conf/userparameter_processlist.conf +++ /dev/null @@ -1 +0,0 @@ -UserParameter=processlist.discovery[*],{{ zabbix_script_dir }}/lld_filelist.py {{ zabbix_process_list_file }} diff --git a/Conf/userparameter_smart.conf b/Conf/userparameter_smart.conf deleted file mode 100644 index 1728f83..0000000 --- a/Conf/userparameter_smart.conf +++ /dev/null @@ -1,7 +0,0 @@ -UserParameter=uHDD[*], sudo smartctl -A $1| grep -i "$2"| tail -1| cut -c 88-|cut -f1 -d' ' -UserParameter=uHDD.model.[*],sudo smartctl -i $1 |grep -i "Device Model"| cut -f2 -d: |tr -d " " -UserParameter=uHDD.sn.[*],sudo smartctl -i $1 |grep -i "Serial Number"| cut -f2 -d: |tr -d " " -UserParameter=uHDD.health.[*],sudo smartctl -H $1 |grep -i "test"| cut -f2 -d: |tr -d " " || true -UserParameter=uHDD.errorlog.[*],sudo smartctl -l error $1 |grep -i "ATA Error Count"| cut -f2 -d: |tr -d " " -### Discovery -UserParameter=uHDD.discovery,sudo {{ zabbix_script_dir }}/smartctl-disks-discovery.pl \ No newline at end of file diff --git a/README.md b/README.md index 7519d8d..87acc6c 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,8 @@ Custom discovery and check scripts used by zabbix -Scripts/* should go in /etc/zabbix/scripts/ +Should be cloned in /etc/zabbix/scripts/ -Conf/* should go in /etc/zabbix/zabbix_agentd.d/ - Scripts/check_ssl_cert.sh - Scripts/lld_backup_status_file.py - list all .status files in /var/run - diff --git a/Scripts/check_ssl_cert.sh b/check_ssl_cert.sh similarity index 100% rename from Scripts/check_ssl_cert.sh rename to check_ssl_cert.sh diff --git a/Scripts/lld_backup_status_file.py b/lld_backup_status_file.py similarity index 100% rename from Scripts/lld_backup_status_file.py rename to lld_backup_status_file.py diff --git a/Scripts/lld_certlist.py b/lld_certlist.py similarity index 100% rename from Scripts/lld_certlist.py rename to lld_certlist.py diff --git a/Scripts/lld_filelist.py b/lld_filelist.py similarity index 100% rename from Scripts/lld_filelist.py rename to lld_filelist.py diff --git a/Scripts/lld_php_fpm_url.py b/lld_php_fpm_url.py similarity index 100% rename from Scripts/lld_php_fpm_url.py rename to lld_php_fpm_url.py diff --git a/Scripts/lld_smart_disks.pl b/lld_smart_disks.pl similarity index 100% rename from Scripts/lld_smart_disks.pl rename to lld_smart_disks.pl