mirror of https://github.com/midoks/mdserver-web
parent
a10f31f4fb
commit
1ff24a2835
@ -0,0 +1,27 @@ |
||||
# Emulating built-in agent parameter 'system.users.num' |
||||
UserParameter=system.test,who | wc -l |
||||
|
||||
# Get size of a directory |
||||
# Defaults to /tmp |
||||
UserParameter=vfs.dir.size[*],dir="$1"; du -s -B 1 "${dir:-/tmp}" | cut -f1 |
||||
|
||||
# Total CPU utilisation by all processes with a given name. |
||||
# Returns empty value if no such processes are present, numeric items will turn unsupported |
||||
# Defaults to zabbix_agentd |
||||
UserParameter=proc.cpu[*],proc="$1"; ps -o pcpu= -C "${proc:-zabbix_agentd}" | awk '{sum += $$1} END {print sum}' |
||||
|
||||
# Mail queue length from mailq |
||||
UserParameter=unix_mail.queue,mailq | grep -v "Mail queue is empty" | grep -c '^[0-9A-Z]' |
||||
|
||||
# Partition discovery on Linux |
||||
UserParameter=vfs.partitions.discovery.linux,for partition in $(awk 'NR > 2 {print $4}' /proc/partitions); do partitionlist="$partitionlist,"'{"{#PARTITION}":"'$partition'"}'; done; echo '{"data":['${partitionlist#,}']}' |
||||
|
||||
# Partition discovery on Solaris (using iostat output) |
||||
# On Solaris bash usually is not the one linked from /bin/sh, so a wrapper script is suggested |
||||
UserParameter=vfs.partitions.discovery.solaris,/somewhere/solaris_partitions.sh |
||||
# Wrapper script (solaris_partitions.sh) contents: |
||||
##!/bin/bash |
||||
#for partition in $(iostat -x | tail +3 | awk '{print $1}'); do |
||||
# partitionlist="$partitionlist,"'{"{#PARTITION}":"'$partition'"}' |
||||
#done |
||||
#echo '{"data":['${partitionlist#,}']}' |
@ -0,0 +1,15 @@ |
||||
#template_db_mysql.conf created by Zabbix for "Template DB MySQL" and Zabbix 4.2 |
||||
#For OS Linux: You need create .my.cnf in zabbix-agent home directory (/var/lib/zabbix by default) |
||||
#For OS Windows: You need add PATH to mysql and mysqladmin and create my.cnf in %WINDIR%\my.cnf,C:\my.cnf,BASEDIR\my.cnf https://dev.mysql.com/doc/refman/5.7/en/option-files.html |
||||
#The file must have three strings: |
||||
#[client] |
||||
#user=zbx_monitor |
||||
#password=<password> |
||||
# |
||||
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 SUM(DATA_LENGTH + INDEX_LENGTH) 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" |
Before Width: | Height: | Size: 246 B |
Loading…
Reference in new issue