Skip to content

Instantly share code, notes, and snippets.

@alice-xu
alice-xu / zabbix_custom_template_for_TCP_stats.xml
Created Feb 25, 2015
Custom Template - OS Linux TCP stats
View zabbix_custom_template_for_TCP_stats.xml
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2015-02-25T04:14:42Z</date>
<groups>
<group>
<name>Custom Templates</name>
</group>
</groups>
<templates>
@alice-xu
alice-xu / tcp_stats.sh
Created Feb 25, 2015
TCP state monitoring script for Zabbix
View tcp_stats.sh
#!/usr/bin/env bash
#
# tcp_stats.sh:
# TCP state monitoring script for Zabbix
#
POLLING_TIME=$( date '+%s' )
NETSTAT_TCP_RESULT=$( netstat -na|grep '^tcp' )
if [ $? -ne 0 ]; then
@alice-xu
alice-xu / tcp_listen_port_discovery.sh
Created Jul 30, 2014
TCP listen port discovery for Zabbix LLD
View tcp_listen_port_discovery.sh
#!/usr/bin/env bash
PROCNAME="$1"
PORT_LIST=$(ss -nap|grep LISTEN|grep \"${PROCNAME}\" \
|awk '{ print $4 }'|sed -e 's/.*://g'|sort|uniq)
[ -z "${PORT_LIST}" ] && echo ZBX_NOTSUPPORTED && exit 1
{
echo "{"
echo " \"data\":["
for PORT in ${PORT_LIST}; do
@alice-xu
alice-xu / get_system_uuid.sh
Created Jul 1, 2014
Get system uuid on Virtual Machine
View get_system_uuid.sh
#!/usr/bin/env bash
SYSTEM_UUID=$( cat /sys/devices/virtual/dmi/id/product_uuid 2> /dev/null | tr 'A-Z' 'a-z' \
|| cat /sys/hypervisor/uuid 2> /dev/null | tr 'A-Z' 'a-z' )
[ -z "${SYSTEM_UUID}" ] && SYSTEM_UUID='00000000-0000-0000-0000-000000000000'
echo ${SYSTEM_UUID}
@alice-xu
alice-xu / memcached_stats.sh
Created Jul 1, 2014
Memcached monitoring script for Zabbix
View memcached_stats.sh
#!/usr/bin/env bash
#
# memcached_stats.sh:
# Memcached monitoring script for Zabbix
#
# $1: Memcached host(default: 127.0.0.1)
# $2: Memcached port(default: 11211)
# $3: Timeout(default: 3[sec])
#
@alice-xu
alice-xu / proc_mem.sh
Created Jul 1, 2014
Process memory monitoring script for Zabbix
View proc_mem.sh
#!/usr/bin/env bash
#
# proc_mem.sh:
# Process memory monitoring script for Zabbix
#
# $1: process name
# $2: effective user name
# $3: mode(sum/max/min/avg)
# $4: args pattern
#
@alice-xu
alice-xu / virsh_vm_stats.sh
Created Jun 30, 2014
Virtual Machine monitoring script for Zabbix
View virsh_vm_stats.sh
#!/usr/bin/env bash
#
# virsh_vm_stats.sh:
# Virtual Machine monitoring script for Zabbix
#
# $1: Virtual Machine dom-uuid
#
# script settings.
export LANG='en_US.UTF-8'
@alice-xu
alice-xu / Template_SNMP_DELL_OpenManage.xml
Last active Mar 8, 2018
Zabbix SNMP monitoring template for DELL Openmanage Server Administrator
View Template_SNMP_DELL_OpenManage.xml
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2014-06-18T02:56:36Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
@alice-xu
alice-xu / zabbix_custom_template_for_OpenVPN.xml
Last active Feb 24, 2016
Custom Template - OpenVPN for Zabbix
View zabbix_custom_template_for_OpenVPN.xml
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2014-06-29T06:40:14Z</date>
<groups>
<group>
<name>Custom Templates</name>
</group>
<group>
<name>OpenVPN clients</name>
@alice-xu
alice-xu / openvpn_client_stats.sh
Created Jun 16, 2014
OpenVPN client stats monitoring script for Zabbix
View openvpn_client_stats.sh
#!/usr/bin/env bash
#
# openvpn_client_stats.sh:
# OpenVPN client stats monitoring script for Zabbix
#
# $1: OpenVPN server host IP/hostname. (default: 127.0.0.1)
# $2: OpenVPN management CLI port. (default: 7505)
# $3: Password file for OpenVPN management CLI. (default: <none>)
# $4: Timeout(sec) (default: 3)
# $5: OpenVPN client host parameter(<SERVER>_<IP>_<CN>)