Commit graph

48 commits

Author SHA1 Message Date
Florian Pritz
13078f8651
Enable cpu/memory accounting by default
The discovery script now uses a regex and no longer cares where exactly
accounting is enabled. Follow systemd upstream by enabling it by
default.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-06-25 14:50:58 +02:00
Florian Pritz
d2911ed1c7
zabbix: Add additional services to accounting whitelist
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-06-25 14:47:54 +02:00
Florian Pritz
86a1d41be6
zabbix: Simplify php-fpm regex
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-06-25 14:33:55 +02:00
Florian Pritz
d48ab73144
zabbix: Use regex to discover accounting units
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-06-25 14:33:11 +02:00
Florian Pritz
702be3ee36
nginx: Add json log format
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-05-30 16:42:29 +02:00
Florian Pritz
5ee78040ff
nginx-zabbix.pl: Add support for reduced log format
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-05-30 16:15:43 +02:00
Florian Pritz
9df95d111f
nginx-zabbix.pl: Extract updater code into method
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-05-30 16:15:25 +02:00
Florian Pritz
7ea5243b4c
nginx-zabbix: Filter hosts to prevent discovery from adding bogus data
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-04-26 10:20:28 +02:00
Florian Pritz
ee4767f290 nginx-zabbix: Exit forcefully
Test if this manages to kill the process. Closing $logfile doesn't seem
to be enough and tail + perl still continue running.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-04-21 15:14:51 +02:00
Florian Pritz
e036a7f16e
nginx-zabbix: Close tail fd when terminating
Seems like the open fd might prevent the script from properly
terminating. Let's see if this fixes it.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-04-17 14:18:41 +02:00
Florian Pritz
12e05ae1f7
zabbix: Ignore failed syncrepo services
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-04-09 09:34:06 +02:00
Florian Pritz
8b70a4e782
nginx-zabbix: Fix incorrect signale name for die()
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-04-07 23:35:17 +02:00
Florian Pritz
2d583b7b46
nginx-zabbix: Add debug output for die()
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-04-07 23:32:21 +02:00
Florian Pritz
c0afd1e934
nginx-zabbix: Catch more write errors
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-22 12:13:39 +01:00
Florian Pritz
479405be7f
zabbix-agent: Fix missing quotes for systemd.unit_data[]
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-21 15:43:33 +01:00
Florian Pritz
bbe72f4028
zabbix: Always install perl-json for system unit monitoring
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-21 15:39:21 +01:00
Florian Pritz
6f7e270939
zabbix/borg: Force scalar context for borg output
This ensure compatability with JSON::PP which accepts a list rather than
only a single argument.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-21 15:37:40 +01:00
Florian Pritz
b847916c61
Disable firewalld tasks
Disable firewall because python2 module is not avaible and the tasks
fail which makes the playbooks fail and leads to handlers not being run.

https://github.com/ansible/ansible/issues/24855

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-21 12:38:01 +01:00
Florian Pritz
a960e513fc
zabbix-agent: Treat unset accounting values as 0
E.g. borg-backup.service has unset values when it is not running, but
zabbix doesn't know what to do with a string when it expects an integer
so fix those values here.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-21 12:35:49 +01:00
Florian Pritz
b54f6b0c8b
nginx-zabbix: Let systemd restart us on SIGPIPE
For some reason tail behaves strangely and the code that should trap the
PIPE signal doesn't seem to do that. Let it die for now to maybe better
see what happens.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-16 10:17:04 +01:00
Florian Pritz
4c649da3b9
zabbix-agent: Use sudo to get borg output
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-12 17:15:23 +01:00
Florian Pritz
83dfa015c1
zabbix-agent: Use JSON::XS for borg parsing
JSON::PP doesn't parse json that contains newslines (human readble
json), but JSON::XS parses that just fine. borg outputs readable json so
this is necessary.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-12 15:50:07 +01:00
Florian Pritz
04451fe4c6
zabbix-agent: Use borg wrapper for monitoring
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-12 15:42:59 +01:00
Florian Pritz
690945a156
zabbix-agent: Monitor borg backup age
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-12 15:41:30 +01:00
Phillip Smith
b1744e6919 Merge branch 'wip/add-firewalld' 2018-03-08 09:49:42 +11:00
Phillip Smith
59807399ed initial commit of firewalld role and tasks 2018-03-06 08:46:24 +11:00
Florian Pritz
5fdf684e6c
nginx-zabbix: Measure number of cached requests (0.000 request time)
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-05 17:04:41 +01:00
Florian Pritz
b94de5bbc6
zabbix: Restart service when nginx-zabbix.pl changes
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-03 13:58:55 +01:00
Florian Pritz
ec121e92f8
nginx-zabbix: Ignore request time of 0 for stats
All the cached requests have 0 request time and that brings the median
request time to 0 nearly all the time thus rendering the stats useless.
Since we want to know how the application requests perform, we can just
ignore 0 values.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-03 13:43:58 +01:00
Florian Pritz
dab22673b4
nginx-zabbix.pl: Use syswrite instead of printf
For some reason printf doesn't error if zabbix_sender dies. Try if
syswrite does.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-01 22:21:59 +01:00
Florian Pritz
b59d6b99df
Add cpu/memory accounting to many roles
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-02-28 19:50:32 +01:00
Florian Pritz
2de2587345
zabbix/accounting: Discover .slice units
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-02-28 18:48:04 +01:00
Florian Pritz
6ac9831c8b
zabbix-agent/nginx: Add glob pattern for ansible managed nginx
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-02-28 17:44:09 +01:00
Florian Pritz
763ff08e6d
zabbix-agent/accounting: Support @ in unit names
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-02-28 17:26:22 +01:00
Florian Pritz
ca7ed787e8 zabbix-agent: Monitor systemd accounting data
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-02-28 16:53:59 +01:00
Florian Pritz
3b8ffcc58d
nginx-zabbix: Detect vanished zabbix_sender
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-02-22 16:52:57 +01:00
Florian Pritz
4f0e041054 zabbix: Add nginx monitoring service
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-02-19 17:20:38 +01:00
Florian Pritz
26e7a14f0d
zabbix: Install perl deps of mysql userstats when required
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-02-17 14:49:49 +01:00
Florian Pritz
73ea56be98
zabbix/mysql-userstats: Fix json of discovery script
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-02-17 14:39:01 +01:00
Florian Pritz
3ecd239f4f
zabbix/mysql-userstats: Switch to handling each user on their own
Otherwise discovery rules don't seem to work for dependent items.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-02-16 23:19:13 +01:00
Florian Pritz
3bd07309bf
zabbix/mysql-userstats: Move user stats to subkey for future expansion
We might want to monitor client/table/index stats in the future too
without having to change the zabbix item configs.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-02-16 15:11:12 +01:00
Florian Pritz
fc4ad4a5ae
zabbix: Add mysql userstats item
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-02-16 14:59:20 +01:00
Florian Pritz
bbc532c32d zabbix-agent: Add item for failed systemd units
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-02-06 22:28:13 +01:00
Florian Pritz
696782af44
zabbix-agent: Switch to FQDN
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-09-11 14:29:13 +02:00
Florian Pritz
cb54341c86
zabbix-agent: Create encryption key with openssl command from zabbix docs
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-09-11 14:27:08 +02:00
Florian Pritz
29a15ad2b3
zabbix-agent: Add mysql config for mysql checks
Template only for now. Deployed manually on luna, not yet integrated
with apollo.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-04-09 00:10:28 +02:00
Florian Pritz
e81946203c
zabbix-agent: Fix agent server on apollo
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-03-20 16:20:29 +01:00
Florian Pritz
3ce16c59a3 Add zabbix-agent role
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-03-20 15:17:24 +01:00