diff --git a/zabbix_agentd.conf.d/zabbix-agent-lxd.conf b/zabbix_agentd.conf.d/zabbix-agent-lxd.conf deleted file mode 100644 index d827126..0000000 --- a/zabbix_agentd.conf.d/zabbix-agent-lxd.conf +++ /dev/null @@ -1,4 +0,0 @@ -UserParameter=ct.memory.size[*],free -b | awk '$ 1 == "Mem:" {total=$ 2; used=($ 3+$ 5); pused=(($ 3+$ 5)*100/$ 2); free=$ 4; pfree=($ 4*100/$ 2); shared=$ 5; buffers=$ 6; cached=$ 6; available=$ 7; pavailable=($ 7*100/$ 2); if("$1" == "") {printf("%.0f", total )} else {printf("%.0f", $1 "" )} }' -UserParameter=ct.swap.size[*],free -b | awk '$ 1 == "Swap:" {total=$ 2; used=$ 3; free=$ 4; pfree=($ 4*100/$ 2); pused=($ 3*100/$ 2); if("$1" == "") {printf("%.0f", free )} else {printf("%.0f", $1 "" )} }' -UserParameter=ct.cpu.load[*],uptime | awk -F'[, ]+' '{avg1=$(NF-2); avg5=$(NF-1); avg15=$(NF)}{print $2/'$(nproc)'}' -UserParameter=ct.uptime,cut -d"." -f1 /proc/uptime diff --git a/zabbix_agentd.conf.d/zabbix-agent-mariadb.conf b/zabbix_agentd.conf.d/zabbix-agent-mariadb.conf deleted file mode 100644 index f071633..0000000 --- a/zabbix_agentd.conf.d/zabbix-agent-mariadb.conf +++ /dev/null @@ -1,7 +0,0 @@ -UserParameter=mysql.ping[*], mysqladmin -h"$1" -P"$2" ping -UserParameter=mysql.get_status_variables[*], mysql -h"$1" -P"$2" -sNX -e "show global status" -UserParameter=mysql.version[*], mysqladmin -s -h"$1" -P"$2" version -UserParameter=mysql.db.discovery[*], mysql -h"$1" -P"$2" -sN -e "show databases" -UserParameter=mysql.dbsize[*], mysql -h"$1" -P"$2" -sN -e "SELECT COALESCE(SUM(DATA_LENGTH + INDEX_LENGTH),0) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='$3'" -UserParameter=mysql.replication.discovery[*], mysql -h"$1" -P"$2" -sNX -e "show slave status" -UserParameter=mysql.slave_status[*], mysql -h"$1" -P"$2" -sNX -e "show slave status" diff --git a/zabbix_agentd.conf.d/zabbix-agent-nextcloud.conf b/zabbix_agentd.conf.d/zabbix-agent-nextcloud.conf deleted file mode 100644 index a6fb091..0000000 --- a/zabbix_agentd.conf.d/zabbix-agent-nextcloud.conf +++ /dev/null @@ -1,10 +0,0 @@ -UserParameter=nc_metric[*],/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/read_nc_metrics.py $1 -UserParameter=nc_quota_metric[*],cat /var/lib/zabbix/output/nc_quota_metrics.json -UserParameter=nc_teamfolders_metric[*],cat /var/lib/zabbix/output/nc_teamfolders_metrics.json -UserParameter=storage_metric[*],/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/read_storage_metrics.py $1 -UserParameter=db_full_version[*],mysql --version -UserParameter=db_metric[*],/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/read_db_metrics.py $1 $2 -UserParameter=db_metric_discovery,/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/discover_db_metrics.py -UserParameter=apache2_user_agent_metric_discovery,/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/discover_apache2_user_agent_metrics.py -UserParameter=apache2_user_agent_metric[*],/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/read_apache2_user_agent_metrics.py $1 -UserParameter=fts_indexing_status,cat /var/lib/zabbix/output/fts_indexing_status.json diff --git a/zabbix_agentd.conf.d/zabbix-agent-redis.conf b/zabbix_agentd.conf.d/zabbix-agent-redis.conf deleted file mode 100644 index fd74238..0000000 --- a/zabbix_agentd.conf.d/zabbix-agent-redis.conf +++ /dev/null @@ -1,3 +0,0 @@ -# See https://github.com/allenta/zabbix-template-for-redis -UserParameter=redis_server.discovery[*],/usr/local/bin/zabbix-redis.py -i '$1' -t server --redis-password discover $2 2> /dev/null -UserParameter=redis_server.stats[*],/usr/local/bin/zabbix-redis.py -i '$1' -t server --redis-password stats 2> /dev/null diff --git a/zabbix_agentd.d/zabbix-agent-lxd.conf b/zabbix_agentd.d/zabbix-agent-lxd.conf new file mode 100644 index 0000000..d827126 --- /dev/null +++ b/zabbix_agentd.d/zabbix-agent-lxd.conf @@ -0,0 +1,4 @@ +UserParameter=ct.memory.size[*],free -b | awk '$ 1 == "Mem:" {total=$ 2; used=($ 3+$ 5); pused=(($ 3+$ 5)*100/$ 2); free=$ 4; pfree=($ 4*100/$ 2); shared=$ 5; buffers=$ 6; cached=$ 6; available=$ 7; pavailable=($ 7*100/$ 2); if("$1" == "") {printf("%.0f", total )} else {printf("%.0f", $1 "" )} }' +UserParameter=ct.swap.size[*],free -b | awk '$ 1 == "Swap:" {total=$ 2; used=$ 3; free=$ 4; pfree=($ 4*100/$ 2); pused=($ 3*100/$ 2); if("$1" == "") {printf("%.0f", free )} else {printf("%.0f", $1 "" )} }' +UserParameter=ct.cpu.load[*],uptime | awk -F'[, ]+' '{avg1=$(NF-2); avg5=$(NF-1); avg15=$(NF)}{print $2/'$(nproc)'}' +UserParameter=ct.uptime,cut -d"." -f1 /proc/uptime diff --git a/zabbix_agentd.d/zabbix-agent-mariadb.conf b/zabbix_agentd.d/zabbix-agent-mariadb.conf new file mode 100644 index 0000000..f071633 --- /dev/null +++ b/zabbix_agentd.d/zabbix-agent-mariadb.conf @@ -0,0 +1,7 @@ +UserParameter=mysql.ping[*], mysqladmin -h"$1" -P"$2" ping +UserParameter=mysql.get_status_variables[*], mysql -h"$1" -P"$2" -sNX -e "show global status" +UserParameter=mysql.version[*], mysqladmin -s -h"$1" -P"$2" version +UserParameter=mysql.db.discovery[*], mysql -h"$1" -P"$2" -sN -e "show databases" +UserParameter=mysql.dbsize[*], mysql -h"$1" -P"$2" -sN -e "SELECT COALESCE(SUM(DATA_LENGTH + INDEX_LENGTH),0) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='$3'" +UserParameter=mysql.replication.discovery[*], mysql -h"$1" -P"$2" -sNX -e "show slave status" +UserParameter=mysql.slave_status[*], mysql -h"$1" -P"$2" -sNX -e "show slave status" diff --git a/zabbix_agentd.d/zabbix-agent-nextcloud.conf b/zabbix_agentd.d/zabbix-agent-nextcloud.conf new file mode 100644 index 0000000..a6fb091 --- /dev/null +++ b/zabbix_agentd.d/zabbix-agent-nextcloud.conf @@ -0,0 +1,10 @@ +UserParameter=nc_metric[*],/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/read_nc_metrics.py $1 +UserParameter=nc_quota_metric[*],cat /var/lib/zabbix/output/nc_quota_metrics.json +UserParameter=nc_teamfolders_metric[*],cat /var/lib/zabbix/output/nc_teamfolders_metrics.json +UserParameter=storage_metric[*],/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/read_storage_metrics.py $1 +UserParameter=db_full_version[*],mysql --version +UserParameter=db_metric[*],/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/read_db_metrics.py $1 $2 +UserParameter=db_metric_discovery,/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/discover_db_metrics.py +UserParameter=apache2_user_agent_metric_discovery,/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/discover_apache2_user_agent_metrics.py +UserParameter=apache2_user_agent_metric[*],/opt/pyvenv/ncmonitor/bin/python /var/lib/zabbix/scripts/read_apache2_user_agent_metrics.py $1 +UserParameter=fts_indexing_status,cat /var/lib/zabbix/output/fts_indexing_status.json diff --git a/zabbix_agentd.d/zabbix-agent-redis.conf b/zabbix_agentd.d/zabbix-agent-redis.conf new file mode 100644 index 0000000..88c3cf9 --- /dev/null +++ b/zabbix_agentd.d/zabbix-agent-redis.conf @@ -0,0 +1,3 @@ +# See https://github.com/allenta/zabbix-template-for-redis +UserParameter=redis_server.discovery[*],/var/lib/zabbix/scripts/zabbix-redis.py -i '$1' -t server --redis-password __REDIS_PASSWORD__ discover $2 2> /dev/null +UserParameter=redis_server.stats[*],/var/lib/zabbix/scripts/zabbix-redis.py -i '$1' -t server --redis-password __REDIS_PASSWORD__ stats 2> /dev/null