From: Robin Roevens <robin.roevens@disroot.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH 4/4] [V2] zabbix_agentd: Add IPFire specific userparameters
Date: Thu, 15 Apr 2021 22:34:32 +0200 [thread overview]
Message-ID: <de92a2f9228e825d59498c79ea1ffb3c92b7a8e6.camel@disroot.org> (raw)
In-Reply-To: <bc1a74d6b6639cfa304352fabb859bb490b478ba.camel@disroot.org>
[-- Attachment #1: Type: text/plain, Size: 3706 bytes --]
Hi Michael
I looked a bit deeper into this and was thinking, as IPfire already
runs collectd, another possible solution to preventing zabbix agent
from using iptables directly for getting metrics from the firewall, is
to request them from collectd:
One way could be by enabling the collectd unixsock plugin
(https://collectd.org/documentation/manpages/collectd-unixsock.5.shtml)
and to make things 'easier' I could then call collectd-nagios
(https://collectd.org/documentation/manpages/collectd-nagios.1.shtml)
to collect live metrics from collectd as is explained in this example:
https://docs.wallarm.com/admin-en/monitoring/collectd-zabbix/
However the collectd unixsock plugin is currently not enabled and
collectd-nagios binary is not installed.
So I'm not sure if all that is worth the effort for an optional addon
as zabbix_agentd is. Since I assume this would require changes to a
core component.
Another way could be by reading the last recorded value from the rrd-
files generated by collectd using for example:
# rrdtool lastupdate /var/log/rrd/collectd/localhost/iptables-filter-
POLICYFWD/ipt_bytes-DROP_FORWARD.rrd
which gives back the timestamp of the measurement and the metric.
But this would require a different approach on how to send those values
to the Zabbix server since we now also have to send a timestamp
together with the metric and this can only be done by using
zabbix_sender to actively send metrics to Zabbix.
Hence I would have to create a script that collects all required last
values from the RRD files, and then send them to Zabbix using
zabbix_sender.
The executing of that script can be triggered by a cron job or as a
custom userparameter by the agent, but then the script needs to finish
within the timeout configured in the zabbix agent config (default: 3s,
max 10s).. And in de case of a cron job, we'd only want that enabled if
the Zabbix server is set up to listen for those specific metric-items.
This could possibly integrated in the webgui as a user-configurable
setting somehow.. (Providing a webgui-addon for configuring
zabbix_agentd is also something I can imagine myself submitting in the
future, but I wasn't planning to do that in short terms :-))
So as you see, both have different challenges.. And of course, should
collectd silently start to fail, Zabbix also will not get accurate data
anymore. Or if the RRD file(s) would become corrupt (which I had once
after migrating from i586 vm to x86_64 appliance)..
Up to some level, additional checks by Zabbix on collectd and the rrd
files could possibly detect such failures..
But I still prefer for zabbix agent (or any monitoring tool for that
matter) to have the shortest and most trustworthy direct path to the
metrics it wants, in this case iptables statistics, hence the iptables
command.
So those wrapper scripts I brought up before are still my preferred
solution on this.
Your thoughts ?
Regards
Robin
Robin Roevens schreef op do 15-04-2021 om 15:12 [+0200]:
>
> >
> > What would a monitoring tool do with a dump of the iptables ruleset?
> > I do not even understand where the use of this is.
>
> The same as IPFire webgui currently does on netother.cgi?fwhits?day
> by calling /sbin/iptables -vnxL <chain> | grep "\/\* <rule> \*\/" | awk
> '{ print $2 }';: keep history of and eventually react on the number of
> firewall-hits.
>
> But you are completely right that access to iptables should be
> restricted to just that what we want to get from it, which can be
> achieved with a wrapper script as explained below in my previous mail.
>
> Regards
>
> Robin
>
--
Dit bericht is gescanned op virussen en andere gevaarlijke
inhoud door MailScanner en lijkt schoon te zijn.
next prev parent reply other threads:[~2021-04-15 20:34 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-07 20:44 [PATCH 0/4] [V2] zabbix_agentd: new maintainer/summary Robin Roevens
2021-04-07 20:44 ` [PATCH 1/4] [V2] zabbix_agentd: Update to v5.0.10 (LTS) Robin Roevens
2021-04-09 19:25 ` Adolf Belka
2021-04-10 21:05 ` Robin Roevens
2021-04-12 10:27 ` Michael Tremer
2021-04-12 11:23 ` Adolf Belka
2021-04-12 13:48 ` Michael Tremer
2021-04-12 10:26 ` Michael Tremer
2021-04-07 20:44 ` [PATCH 2/4] [V2] zabbix_agentd: Fix agent modules directory Robin Roevens
2021-04-09 19:36 ` Adolf Belka
2021-04-10 21:13 ` Robin Roevens
2021-04-12 10:26 ` Michael Tremer
2021-04-12 10:50 ` Robin Roevens
2021-04-12 10:52 ` Michael Tremer
2021-04-12 11:38 ` Robin Roevens
2021-04-12 13:45 ` Michael Tremer
2021-04-07 20:44 ` [PATCH 3/4] [V2] zabbix_agentd: Better configfile handling during update Robin Roevens
2021-04-07 20:44 ` [PATCH 4/4] [V2] zabbix_agentd: Add IPFire specific userparameters Robin Roevens
2021-04-12 10:36 ` Michael Tremer
2021-04-12 22:16 ` Robin Roevens
2021-04-15 11:21 ` Michael Tremer
2021-04-15 13:12 ` Robin Roevens
2021-04-15 20:34 ` Robin Roevens [this message]
2021-04-19 13:42 ` Michael Tremer
2021-04-19 13:37 ` Michael Tremer
2021-04-19 20:50 ` Robin Roevens
2021-04-12 10:32 ` [PATCH 0/4] [V2] zabbix_agentd: new maintainer/summary Michael Tremer
2021-04-12 21:19 ` Robin Roevens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=de92a2f9228e825d59498c79ea1ffb3c92b7a8e6.camel@disroot.org \
--to=robin.roevens@disroot.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox