From b1f45734552e050f61f5b0d57ef8013673f0e421 Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Mon, 1 Feb 2016 14:31:23 +0300 Subject: [PATCH] add linux template --- README.rst | 6 + conf/template.xml | 3273 ++++++++++++++++++++++++++++++++++++++++ rpm/SPECS/mamonsu.spec | 2 + 3 files changed, 3281 insertions(+) create mode 100644 conf/template.xml diff --git a/README.rst b/README.rst index 2a74fec8..d8ce2ce3 100644 --- a/README.rst +++ b/README.rst @@ -2,6 +2,12 @@ mamonsu: Active zabbix agent ******************************* +============ +Build status +============ +.. image:: https://travis-ci.org/postgrespro/mamonsu.svg?branch=master + :target: https://travis-ci.org/postgrespro/mamonsu + ============ Installation ============ diff --git a/conf/template.xml b/conf/template.xml new file mode 100644 index 00000000..4f30a036 --- /dev/null +++ b/conf/template.xml @@ -0,0 +1,3273 @@ + + + 2.0 + 2016-02-01T14:30:33.004717 + + + Templates + + + + + + + + {PostgresPro-Linux:pgsql.checkpoints[checkpoints_req].last()}>5 + PostgreSQL required checkpoints occurs to frequently on {HOSTNAME} + + 0 + 3 + + 0 + + + + {PostgresPro-Linux:pgsql.uptime[].last()}<60000 + PostgreSQL service was restarted on {HOSTNAME} (uptime={ITEM.LASTVALUE}) + + 0 + 3 + + 0 + + + + {PostgresPro-Linux:pgsql.cache[hit].last()}<80 + PostgreSQL cache hit ratio too low on {HOSTNAME} ({ITEM.LASTVALUE}) + + 0 + 3 + + 0 + + + + {PostgresPro-Linux:system.processes[forkrate].last()}>500 + Process fork-rate to frequently on {HOSTNAME} + + 0 + 3 + + 0 + + + + + + Block devices: read/write operations + 900 + 200 + 0.0 + 100.0 + 1 + 1 + 0 + 1 + 0 + 0.0 + 0.0 + 0 + 0 + 0 + 0 + + + 0 + 0 + CC0000 + 0 + 2 + 0 + + PostgresPro-Linux + system.disk.all_read[] + + + + 0 + 0 + 0000CC + 0 + 2 + 0 + + PostgresPro-Linux + system.disk.all_write[] + + + + + + PostgreSQL bgwriter + 900 + 200 + 0.0 + 100.0 + 1 + 1 + 0 + 1 + 0 + 0.0 + 0.0 + 0 + 0 + 0 + 0 + + + 0 + 0 + CCCC00 + 1 + 2 + 0 + + PostgresPro-Linux + pgsql.bgwriter[buffers_checkpoint] + + + + 0 + 0 + 0000CC + 1 + 2 + 0 + + PostgresPro-Linux + pgsql.bgwriter[buffers_clean] + + + + 0 + 0 + 777777 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.bgwriter[maxwritten_clean] + + + + 0 + 0 + CC0000 + 1 + 2 + 0 + + PostgresPro-Linux + pgsql.bgwriter[buffers_backend] + + + + 0 + 0 + CC00CC + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.bgwriter[buffers_backend_fsync] + + + + 0 + 0 + 00CC00 + 1 + 2 + 0 + + PostgresPro-Linux + pgsql.bgwriter[buffers_alloc] + + + + + + PostgreSQL checkpoints + 900 + 200 + 0.0 + 100.0 + 1 + 1 + 0 + 1 + 0 + 0.0 + 0.0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 00CC00 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.checkpoints[checkpoints_timed] + + + + 0 + 0 + CC0000 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.checkpoints[checkpoints_req] + + + + 0 + 0 + 0000CC + 1 + 2 + 0 + + PostgresPro-Linux + pgsql.checkpoint[write_time] + + + + 0 + 0 + 000000 + 1 + 2 + 0 + + PostgresPro-Linux + pgsql.checkpoint[checkpoint_sync_time] + + + + + + PostgreSQL connections + 900 + 200 + 0.0 + 100.0 + 1 + 1 + 0 + 1 + 0 + 0.0 + 0.0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 00BB00 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.connections[active] + + + + 0 + 0 + 0000BB + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.connections[idle] + + + + 0 + 0 + CC00CC + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.connections[idle_in_transaction] + + + + 0 + 0 + EEEEEE + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.connections[total] + + + + 0 + 0 + BB0000 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.connections[waiting] + + + + + + Memory overview + 900 + 400 + 0.0 + 100.0 + 1 + 1 + 1 + 1 + 0 + 0.0 + 0.0 + 0 + 0 + 0 + 0 + + + 0 + 0 + CC0000 + 0 + 2 + 0 + + PostgresPro-Linux + system.memory[apps] + + + + 0 + 0 + 00CC00 + 0 + 2 + 0 + + PostgresPro-Linux + system.memory[buffers] + + + + 0 + 0 + 0000CC + 0 + 2 + 0 + + PostgresPro-Linux + system.memory[swap] + + + + 0 + 0 + CC00CC + 0 + 2 + 0 + + PostgresPro-Linux + system.memory[cached] + + + + 0 + 0 + 000000 + 0 + 2 + 0 + + PostgresPro-Linux + system.memory[unused] + + + + 0 + 0 + CCCC00 + 0 + 2 + 0 + + PostgresPro-Linux + system.memory[slab] + + + + 0 + 0 + 777777 + 0 + 2 + 0 + + PostgresPro-Linux + system.memory[swap_cache] + + + + 0 + 0 + 770000 + 0 + 2 + 0 + + PostgresPro-Linux + system.memory[page_tables] + + + + 0 + 0 + 000077 + 0 + 2 + 0 + + PostgresPro-Linux + system.memory[vmalloc_used] + + + + 0 + 0 + 007700 + 0 + 2 + 0 + + PostgresPro-Linux + system.memory[committed] + + + + 0 + 0 + DF0000 + 0 + 2 + 0 + + PostgresPro-Linux + system.memory[mapped] + + + + 0 + 0 + 00DF00 + 0 + 2 + 0 + + PostgresPro-Linux + system.memory[active] + + + + 0 + 0 + 0000DF + 0 + 2 + 0 + + PostgresPro-Linux + system.memory[inactive] + + + + + + PostgreSQL uptime + 900 + 200 + 0.0 + 100.0 + 1 + 1 + 0 + 1 + 0 + 0.0 + 0.0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 00CC00 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.cache[hit] + + + + 0 + 0 + DF0101 + 1 + 2 + 0 + + PostgresPro-Linux + pgsql.uptime[] + + + + + + PostgreSQL instance: rate + 900 + 200 + 0.0 + 100.0 + 1 + 1 + 0 + 1 + 0 + 0.0 + 0.0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0000CC + 1 + 2 + 0 + + PostgresPro-Linux + pgsql.transactions[total] + + + + 0 + 0 + 00CC00 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.blocks[hit] + + + + 0 + 0 + CC0000 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.blocks[read] + + + + + + PostgreSQL instance: events + 900 + 200 + 0.0 + 100.0 + 1 + 1 + 0 + 1 + 0 + 0.0 + 0.0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0000CC + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.events[conflicts] + + + + 0 + 0 + 000000 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.events[deadlocks] + + + + 0 + 0 + CC0000 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.events[xact_rollback] + + + + + + PostgreSQL instance: temp files + 900 + 200 + 0.0 + 100.0 + 1 + 1 + 0 + 1 + 0 + 0.0 + 0.0 + 0 + 0 + 0 + 0 + + + 0 + 0 + CC0000 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.temp[bytes] + + + + 0 + 0 + 0000CC + 1 + 2 + 0 + + PostgresPro-Linux + pgsql.temp[files] + + + + + + PostgreSQL instance: tuples + 900 + 200 + 0.0 + 100.0 + 1 + 1 + 0 + 1 + 0 + 0.0 + 0.0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 000000 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.tuples[deleted] + + + + 0 + 0 + 0000CC + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.tuples[fetched] + + + + 0 + 0 + 00CC00 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.tuples[inserted] + + + + 0 + 0 + CC00CC + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.tuples[returned] + + + + 0 + 0 + CC0000 + 0 + 2 + 0 + + PostgresPro-Linux + pgsql.tuples[updated] + + + + + + Processes overview + 900 + 200 + 0.0 + 100.0 + 1 + 1 + 0 + 1 + 0 + 0.0 + 0.0 + 0 + 0 + 0 + 0 + + + 0 + 0 + CC0000 + 0 + 2 + 0 + + PostgresPro-Linux + system.processes[running] + + + + 0 + 0 + 00CC00 + 0 + 2 + 0 + + PostgresPro-Linux + system.processes[blocked] + + + + 0 + 0 + 0000CC + 1 + 2 + 0 + + PostgresPro-Linux + system.processes[forkrate] + + + + + + diff --git a/rpm/SPECS/mamonsu.spec b/rpm/SPECS/mamonsu.spec index b105179b..6fc03a2c 100644 --- a/rpm/SPECS/mamonsu.spec +++ b/rpm/SPECS/mamonsu.spec @@ -27,8 +27,10 @@ export PYTHONPATH=%{buildroot}%{python_sitelib} %{__mkdir} -p %{buildroot}/%{_sysconfdir}/%{name} %{__mkdir} -p %{buildroot}/%{_sysconfdir}/init.d %{__mkdir} -p %{buildroot}/%{_sysconfdir}/logrotate.d +%{__mkdir} -p %{buildroot}/%{_datarootdir} %{__install} -m 0644 -p conf/example.conf %{buildroot}/%{_sysconfdir}/%{name}/agent.conf +%{__install} -m 0644 -p conf/template.xml %{buildroot}/%{_datarootdir}/%{name}/template.xml %{__install} -m 0755 -p %{SOURCE1} %{buildroot}/%{_sysconfdir}/init.d/%{name} %{__install} -m 0644 -p %{SOURCE2} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}