From 320d8f0247ba676a9d72e84a33e3e60371d0b4b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kamil=20Porembi=C5=84ski?= <kamil@thecamels.org>
Date: Sat, 22 Nov 2014 23:14:05 +0100
Subject: [PATCH] Common UserParameter and visual fix for README.md

---
 README.md                       | 10 ++++++----
 zabbix_agentd.conf.d/linux.conf | 15 +++++++++++++++
 2 files changed, 21 insertions(+), 4 deletions(-)
 create mode 100644 zabbix_agentd.conf.d/linux.conf

diff --git a/README.md b/README.md
index e6f09ba..a4a0472 100644
--- a/README.md
+++ b/README.md
@@ -6,18 +6,20 @@ Script and templates for Zabbix 2.2.x. and 2.4.x
 - In Templates there are XML files ready to import using Zabbix GUI
 - In zabbix_agentd.conf.d there are custom User Parameters (need to be installed on agent)
 
-Templates was tested on Red Hat 5.x, 6.x and CentOS 5.x, 6.x. Please let us know if you have any questions or concerns.
+Templates was tested on Red Hat 5.x, 6.x and CentOS 5.x, 6.x. Common UserParameter were added to ```zabbix_agentd.conf.d/linux.conf``` file. Please add it to your own Zabbix Agent installation.
+
+Please let us know if you have any questions or concerns.
 
 The Camels Team
 http://thecamels.org
 
 Template App APC
 ======
-Monitoring memory usage of APC (http://pecl.php.net/package/APC) module. File apc-stats.php need to be accessed via HTTP for example http://127.0.0.1/apc-stats.php
+Monitoring memory usage of APC (http://pecl.php.net/package/APC) module. File ```bin/apc-stats.php``` need to be accessed via HTTP for example http://127.0.0.1/apc-stats.php
 
 Template App Brocade HBA
 ======
-Monitoring for Network Adapters - Brocade.
+Monitoring for Network Adapters - Brocade. Template is usind Discovery to create Items and Triggers.
 
 Template App Nscd
 ======
@@ -27,7 +29,7 @@ You need also add SUDO for zabbix user: ```zabbix  ALL=(ALL) NOPASSWD: /usr/sbin
 
 Template App OPcache
 ======
-Monitoring memory usage of OPcache (http://php.net/manual/en/book.opcache.php). File opcache.php need to be accessed via HTTP for example http://127.0.0.1/opcache.php. Curl need to be installed on server.
+Monitoring memory usage of OPcache (http://php.net/manual/en/book.opcache.php). File ```bin/opcache.php``` need to be accessed via HTTP for example http://127.0.0.1/opcache.php. Curl need to be installed on server.
 
 Template App RabbitMQ
 ======
diff --git a/zabbix_agentd.conf.d/linux.conf b/zabbix_agentd.conf.d/linux.conf
new file mode 100644
index 0000000..ecbc060
--- /dev/null
+++ b/zabbix_agentd.conf.d/linux.conf
@@ -0,0 +1,15 @@
+UserParameter=nfs[*], df | grep -cw $1
+UserParameter=netstat[*], ss -nat | grep -c $1
+UserParameter=mysqlnetstat[*], ss -nat | grep 3306 | grep -c $1
+UserParameter=mailqueue,mailq | grep -v 'Mail queue is empty' | grep -c '^[0-9A-Z]'
+UserParameter=chkconfig[*], chkconfig --list | grep "$1" | cut -d ":" -f 4 | grep -c on
+UserParameter=sockstat.sockets,cat /proc/net/sockstat|grep sockets|cut -d' ' -f 3
+UserParameter=sockstat.tcp.inuse,cat /proc/net/sockstat|grep TCP|cut -d' ' -f 3
+UserParameter=sockstat.tcp.orphan,cat /proc/net/sockstat|grep TCP|cut -d' ' -f 5
+UserParameter=sockstat.tcp.timewait,cat /proc/net/sockstat|grep TCP|cut -d' ' -f 7
+UserParameter=sockstat.tcp.allocated,cat /proc/net/sockstat|grep TCP|cut -d' ' -f 9
+UserParameter=sockstat.tcp.mem,cat /proc/net/sockstat|grep TCP|cut -d' ' -f 11
+UserParameter=sockstat.udp.inuse,cat /proc/net/sockstat|grep UDP:|cut -d' ' -f 3
+UserParameter=sockstat.udp.mem,cat /proc/net/sockstat|grep UDP:|cut -d' ' -f 5
+UserParameter=check_chmod[*], stat --format '%a' $1
+UserParameter=os-full, cat /etc/issue | head -1
-- 
GitLab