README.md in zabbix-ruby-client-0.0.21 vs README.md in zabbix-ruby-client-0.0.22

- old
+ new

@@ -77,30 +77,50 @@ ## Plugins There are a set of standart plugins included in the package, aimed at linux systems. -* ubuntu system stats ([system_tpl](master/zabbix-templates/system_tpl.xml) includes the following) - * load (uses /proc/loadavg) [load_tpl](master/zabbix-templates/load_tpl.xml) - * cpu (uses /proc/stat) [cpu_tpl](master/zabbix-templates/cpu_tpl.xml) - * memory (uses /proc/meminfo) [memory_tpl](master/zabbix-templates/memory_tpl.xml) - * disk (uses /proc/diskstats) [disk_tpl](master/zabbix-templates/disk_tpl.xml) +* **ubuntu** system stats ([system_tpl](master/zabbix-templates/system_tpl.xml) includes the following) + * **load** (uses /proc/loadavg) [load_tpl](master/zabbix-templates/load_tpl.xml) + * **cpu** (uses /proc/stat) [cpu_tpl](master/zabbix-templates/cpu_tpl.xml) + * **memory** (uses /proc/meminfo) [memory_tpl](master/zabbix-templates/memory_tpl.xml) + * **disk** (uses /proc/diskstats) [disk_tpl](master/zabbix-templates/disk_tpl.xml) * args [ "md-0", "/", "vgebs" ] = group identifier, mountpoint, groupname where identifier is what is found in /proc/diskstats, and groupname is something found in df command. The mount point will be used as label. - * network (uses /proc/net/dev) [network_tpl](master/zabbix-templates/network_tpl.xml) + * **network** (uses /proc/net/dev) [network_tpl](master/zabbix-templates/network_tpl.xml) * args [ eth0 ] is just the interface identifier - * apt (uses ubuntu /usr/lib/update-notifier/apt-check) this one will populate the 'tag' field in host info, and is supposed to run every few hours or at least not every minute [apt_tpl](master/zabbix-templates/apt_tpl.xml) - * sysinfo (uses uname -a) is populating the host info in the inventory, and should be ran at setup and/or monthly [sysinfo_tpl](master/zabbix-templates/sysinfo_tpl.xml) -* apache (depends on mod_status with status_extended on) [apache_tpl](master/zabbix-templates/apache_tpl.xml) -* mysql (uses mysqladmin extended-status) [mysql_tpl](master/zabbix-templates/mysql_tpl.xml) -* postgres (uses psql and pg_stat_database) [postgres_tpl](master/zabbix-templates/postgres_tpl.xml) + * **apt** (uses ubuntu /usr/lib/update-notifier/apt-check) this one will populate the 'tag' field in host info, and is supposed to run every few hours or at least not every minute [apt_tpl](master/zabbix-templates/apt_tpl.xml) + * **sysinfo** (uses uname -a) is populating the host info in the inventory, and should be ran at setup and/or monthly [sysinfo_tpl](master/zabbix-templates/sysinfo_tpl.xml) +* **apache** (depends on mod_status with status_extended on) [apache_tpl](master/zabbix-templates/apache_tpl.xml) +* **mysql** (uses mysqladmin extended-status) [mysql_tpl](master/zabbix-templates/mysql_tpl.xml) +* **postgres** (uses psql and pg_stat_database) [postgres_tpl](master/zabbix-templates/postgres_tpl.xml) * best is to use a .pgpass file see http://www.postgresql.org/docs/9.0/interactive/libpq-pgpass.html -* nginx (requires httpStubStatus nginx module) [nginx_tpl](master/zabbix-templates/nginx_tpl.xml) -* redis (uses redis-cli info) [redis_tpl](master/zabbix-templates/redis_tpl.xml) +* **nginx** (requires httpStubStatus nginx module) [nginx_tpl](master/zabbix-templates/nginx_tpl.xml) +* **redis** (uses redis-cli info) [redis_tpl](master/zabbix-templates/redis_tpl.xml) * args [ "/path/to/redis-cli", "options to connect" ] -* openvpn (uses /etc/openvpn/openvpn-status.log) [openvpn_tpl](master/zabbix-templates/openvpn_tpl.xml) +* **openvpn** (uses /etc/openvpn/openvpn-status.log) [openvpn_tpl](master/zabbix-templates/openvpn_tpl.xml) * args [ "/etc/openvpn/openvpn-status.log" ] -* cisco (type ASA 5510) [cisco_tpl](master/zabbix-templates/cisco_tpl.xml) +* **cisco** (type ASA 5510) [cisco_tpl](master/zabbix-templates/cisco_tpl.xml) * uses a snmp setup +* **RabbitMQ** (uses [rabbitmqadmin](http://www.rabbitmq.com/management-cli.html)) [rabbitmq_tpl](master/zabbix-templates/rabbitmq_tpl.xml) + * args [ "/path/to/rabbitmqadmin", "login", "password" ] +* **mysqlcommand** (uses arbitrary mysql commands to create custom items) + * args [ "app_name", "dbname", "command_args", "command1_name", "command1_sql", "command2_name", "command2_sql" ] + * the 3 first args are common to all commands + * app_name will create an item named `app.app_name[command1_name]` + * past the 3 first args, the rest are key-values with a name and a sql command. + * if the name begins with a `_`, this underscore will be removed and the sql command is expected to be a list of value grouped by labels. For example [ "_usertypes", "select type, count(*) from users group by type" ] will generate something like + ```` + myhost app.app_name[usertypes,APIUser] 1407593152 10 + myhost app.app_name[usertypes,User] 1407593152 2843 + ... + ```` + * if the name includes commas (`,`) the sql command is expected to return one row with multple value. For example [ "max_attempts,min_attempts", "select max(attempts), min(attempts) from delayed_jobs"] will generate + ```` + myhost app.app_name[max_attempts] 1407593152 40 + myhost app.app_name[min_attempts] 1407593152 5 + ```` + * in all other case (no starting `_` and no `,`) in the item name, the sql command is expected to return a single columns and a single row, typically for `count(*)` commands. + You can add extra plugins in a plugins/ dir in the working dir, just by copying one of the existing plugins in the repo and change to your need. All plugins present in plugins/ will be loaded if present in the config file you use. That can be convenient to test by using the -t flag, for example `bundle exec zrc -t testplugin.yml` where testplugin.yml only contains the name and args for your plugin. ## Custom plugins how-to