diff --git a/README.md b/README.md index 3c56e0e..0e05f40 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,22 @@ # zaf-plugins Zabbix Agent Framework plugins repository. It contains working set of default plugins. Feel free to contribute. Or write your public and maintain control file on your site. +Look into plugin directory to see its possibilities and usage. + +## fail2ban +Plugin which can autodiscover fail2ban jails and than reports number of banned IPs per jail. + +## fsx +Extended filesystem functions. This plugin can autodiscover files or directories somwhere in filesystem. Next to this, it can report disk usage and number of items in that object. + +## openssh +Plugin to discover openssh options and their values. Good for security audits. Each option will be discovered and than you can make triggers to check right settings like cleartext authentication or protocol version. + +## psx +Extended process list. Plugin will discover runing procesess and userids. Than it reports usage by process and user. + +## zaf +Default plugin for zaf. It can autodiscover installed plugins and get their versions. + + + diff --git a/fail2ban/README.md b/fail2ban/README.md index 1a2b4f3..d3cc326 100644 --- a/fail2ban/README.md +++ b/fail2ban/README.md @@ -1,6 +1,6 @@ # Plugin fail2ban -Zaf plugin for monitoring fail2ban with LLD +Zaf plugin for monitoring fail2ban with LLD. It will discover jails and then reports its usage and banned IPs. # Credits 2014 dron, jiri.slezka@slu.cz diff --git a/fsx/README.md b/fsx/README.md new file mode 100644 index 0000000..f41f974 --- /dev/null +++ b/fsx/README.md @@ -0,0 +1,27 @@ +# Plugin fsx + +This plugin can autodiscover filesystem objects. Please note that this report can be very time consuming. This is only proof of concept. +Next to this, zabbix user must have permissions to that directories. +General fsx.discovery item has this options: +``` +fsx.discovery[/dir,mask,maxdepth,type] +``` +You must use % instead od * to get globing for mask. + +## Example1 +This example will discover directories under /var/* (one level) and than it will report their usage. +``` +discovery: fsx.discovery[/var,%,1,d] +discovered: fsx.pathinfo_du[/var/mail], fsx.pathinfo_du[/var/spool], fsx.pathinfo_du[/var/log], ... +``` + +## Example2 +Find all DEADJOE files in /etc and all subdirs +discovery: fsx.discovery[/etc,DEADJOE,,f] +discovered: fsx.pathinfo_du[/etc/DEADJOE], fsx.pathinfo_du[/etc/postfix/DEADJOE], ... + + + + + + diff --git a/fsx/template.xml b/fsx/template.xml index b9fb1c3..ac8bc43 100644 --- a/fsx/template.xml +++ b/fsx/template.xml @@ -1,7 +1,7 @@ 3.0 - 2016-04-04T13:01:57Z + 2016-04-09T10:03:07Z Templates @@ -17,7 +17,17 @@ Templates - + + + Filesystems + + + fsx + + + ZAF + + @@ -54,7 +64,7 @@ Discover directories under /var - Path {#PATH} items + Path {#PATH} disk usage 7 0 @@ -88,7 +98,67 @@ 0 - + + + Filesystems + + + fsx + + + ZAF + + + + + + + + Path {#PATH} items + 7 + + 0 + + fsx.pathinfo_items[{#PATH}] + 600 + 90 + 365 + 0 + 3 + + B + 0 + + + 0 + 0 + + 0 + + 1 + + + + 0 + 0 + + + + + + + 0 + + + Filesystems + + + fsx + + + ZAF + + diff --git a/psx/README.md b/psx/README.md index 0a5b2f2..29d21e1 100644 --- a/psx/README.md +++ b/psx/README.md @@ -4,5 +4,64 @@ Please note that this plugin is very simple plugin for domonstrating possibiliti ## Usage -zaf intall process-list +``` + +psx.discovery [t|{ + "data":[ + { + "{#PSNAME}":"daemon" , + "{#PSUSER}":"atd" + }, + { + "{#PSNAME}":"hosting" , + "{#PSUSER}":"php5-fpm" + }, + { + "{#PSNAME}":"krtek" , + "{#PSUSER}":"php5-fpm" + }, + { + "{#PSNAME}":"lipka" , + "{#PSUSER}":"php5-fpm" + }, + { + "{#PSNAME}":"macura" , + "{#PSUSER}":"php5-fpm" + }, + { + "{#PSNAME}":"memcache" , + "{#PSUSER}":"memcached" + }, + { + "{#PSNAME}":"message+" , + "{#PSUSER}":"dbus-daemon" + }, + { + "{#PSNAME}":"mysql" , + "{#PSUSER}":"mysqld" + }, + { + "{#PSNAME}":"odeli" , + "{#PSUSER}":"php5-fpm" + }, + { + "{#PSNAME}":"postfix" , + "{#PSUSER}":"qmgr" + }, + { + "{#PSNAME}":"postfix" , + "{#PSUSER}":"tlsmgr" + }, + { + "{#PSNAME}":"rdnssd" , + "{#PSUSER}":"rdnssd" + }, + { + "{#PSNAME}":"root" , + "{#PSUSER}":"acpid" + } + ] +} + +``` diff --git a/psx/template.xml b/psx/template.xml index 340f5e6..840008e 100644 --- a/psx/template.xml +++ b/psx/template.xml @@ -1,7 +1,7 @@ 3.0 - 2016-03-23T09:37:42Z + 2016-04-09T10:08:50Z Templates @@ -21,6 +21,12 @@ Process Statistics + + psx + + + ZAF + @@ -97,6 +103,12 @@ Returns the {#PSNAME} and {#PSUSER} discovery macros which return the process na Process Statistics + + psx + + + ZAF + @@ -141,6 +153,12 @@ Returns the {#PSNAME} and {#PSUSER} discovery macros which return the process na Process Statistics + + psx + + + ZAF + @@ -185,6 +203,12 @@ Returns the {#PSNAME} and {#PSUSER} discovery macros which return the process na Process Statistics + + psx + + + ZAF + diff --git a/zaf/README.md b/zaf/README.md new file mode 100644 index 0000000..82397fc --- /dev/null +++ b/zaf/README.md @@ -0,0 +1,5 @@ +# Zaf default plugin +This plugin helps to monitor zaf status on each host. It can report zaf version, discover all plugins and get their versions. This should be linked as essential part of templates for each zaf enabled host. + + + diff --git a/zaf/control.zaf b/zaf/control.zaf index 6520817..42cee6d 100644 --- a/zaf/control.zaf +++ b/zaf/control.zaf @@ -8,7 +8,7 @@ Description:: :: # Version of the plugin. -Version: 0.3 +Version: 0.4 # Url of plugin location to be able to update plugin Url: https://raw.githubusercontent.com/limosek/zaf-plugins/master/zaf @@ -50,10 +50,48 @@ Function: zaf_discovery_plugins Item plugin_version: Parameters: plugin_name Description:: - Returns maintainer of plugin + Returns version of plugin :: - Function: zaf_plugin_version $1 - +/Item + +Item plugin_url: +Parameters: plugin_name +Description:: + Returns base url of plugin +:: +Function: zaf_plugin_url $1 +/Item + +Item plugin_web: +Parameters: plugin_name +Description:: + Returns home url of plugin +:: +Function: zaf_plugin_web $1 +/Item + +Item plugin_maintainer: +Parameters: plugin_name +Description:: + Returns maintainer of plugin +:: +Function: zaf_plugin_mainatner $1 +/Item + +Item plugin_items: +Parameters: plugin_name +Description:: + Returns items defined in plugin +:: +Function: zaf_list_plugin_items $1 +/Item + +Item plugin_template_url: +Parameters: plugin_name +Description:: + Returns base template url for plugin +:: +Function: zaf_plugin_template_url $1 /Item diff --git a/zaf/template.xml b/zaf/template.xml index b89c4b6..81c17d7 100644 --- a/zaf/template.xml +++ b/zaf/template.xml @@ -145,6 +145,138 @@ + + ZAF plugin {#PLUGIN} home url + 0 + + 0 + + zaf.plugin_url[{#PLUGIN}] + 3600 + 90 + 0 + 0 + 1 + + + 0 + + + 0 + 0 + + 0 + + 1 + + + + 0 + 0 + + + + + + + 0 + + + ZAF + + + + + + + + ZAF plugin {#PLUGIN} template url + 0 + + 0 + + zaf.plugin_template_url[{#PLUGIN}] + 3600 + 90 + 0 + 0 + 1 + + + 0 + + + 0 + 0 + + 0 + + 1 + + + + 0 + 0 + + + + + + + 0 + + + ZAF + + + + + + + + ZAF plugin {#PLUGIN} items + 0 + + 0 + + zaf.plugin_items[{#PLUGIN}] + 3600 + 90 + 0 + 0 + 1 + + + 0 + + + 0 + 0 + + 0 + + 1 + + + + 0 + 0 + + + + + + + 0 + + + ZAF + + + + + +