From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH 4/4] [V2] zabbix_agentd: Add IPFire specific userparameters
Date: Mon, 19 Apr 2021 14:42:33 +0100 [thread overview]
Message-ID: <A4149A3D-EEC6-4FA2-9E23-CBBB516B02B5@ipfire.org> (raw)
In-Reply-To: <de92a2f9228e825d59498c79ea1ffb3c92b7a8e6.camel@disroot.org>
[-- Attachment #1: Type: text/plain, Size: 4792 bytes --]
Hello,
> On 15 Apr 2021, at 21:34, Robin Roevens <robin.roevens(a)disroot.org> wrote:
>
> 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.
Hmm, it does not strike me as a very straight-forward solution to involve collectd. We have a replacement for collectd ready which we will roll out at some point and so it will go away eventually.
See my remarks about “getipstat” from my other email.
> 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
If we have to go this road, this would be a better solution in my view, but it still makes the Zabbix Agent dependant on collectd.
> 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 :-))
This sounds overly complicated to me and will require a lot of things being right (i.e. time).
You will end up with corner cases and bad metrics when the system is under load and the execution of the command is delayed.
> 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)..
They are not corrupt, just incompatible between different architectures.
The result is the same :)
> 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 ?
I agree :)
-Michael
>
> 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-19 13:42 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
2021-04-19 13:42 ` Michael Tremer [this message]
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=A4149A3D-EEC6-4FA2-9E23-CBBB516B02B5@ipfire.org \
--to=michael.tremer@ipfire.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