From patchwork Tue Apr 18 18:45:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Roevens X-Patchwork-Id: 6795 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Q1CYG1Zkpz3xDh for ; Tue, 18 Apr 2023 18:45:54 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Q1CY93j8Tz3kd; Tue, 18 Apr 2023 18:45:49 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Q1CY853j7z30Js; Tue, 18 Apr 2023 18:45:48 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Q1CY65rq9z2ydF for ; Tue, 18 Apr 2023 18:45:46 +0000 (UTC) Received: from knopi.disroot.org (knopi.disroot.org [178.21.23.139]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4Q1CY52rNkzqt for ; Tue, 18 Apr 2023 18:45:45 +0000 (UTC) Authentication-Results: mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=mAYjAElT; spf=pass (mail01.ipfire.org: domain of robin.roevens@disroot.org designates 178.21.23.139 as permitted sender) smtp.mailfrom=robin.roevens@disroot.org; dmarc=pass (policy=reject) header.from=disroot.org ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1681843546; a=rsa-sha256; cv=none; b=UTzIgBKmn+blmaBW+HmaJ5kxsHw/ooR1Cck5Sy5j0qMp7rp8XYIKXHdsIQ35HsQ2l4JUAE 5lmHapzbvUcV8Fw1pBnfoywBZQ94Cd2HbHqg8PwJtGeQtInl14zqh7QwJS+Z7d8NHYiC/v uzkkyBK2SrWDCC9eC+maVXtLz6FzhrRr6CTQ4cyt1ZtPZEg+9Sw3VymW/jBUR6Ji6gtNUm Vsju8AZIny1maS0qhxJci3Ah1nEG+piGbifht90XY1h0qVnvoD+JfyhT53XjS3WuEDH+2J F52rHv912Icxf7O9q9dFjZrW/t0R04dF72r1CERmoLdvNJbzoSu0TML5JY4UTA== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=mAYjAElT; spf=pass (mail01.ipfire.org: domain of robin.roevens@disroot.org designates 178.21.23.139 as permitted sender) smtp.mailfrom=robin.roevens@disroot.org; dmarc=pass (policy=reject) header.from=disroot.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1681843546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kFk0kjzHcEKvatRn3p06iBwxotNcJMjVuohdfepB6qA=; b=gECEmScDx3KwO7hjymghUaJKoFuikN7+fHgQGH7xbbcirCSASHMBhKxEBjwcW9xitMGjYK JMy3jda0l7AYNbgNHoWlxZuldu1MJo6g716gUkzlwTLU/wGGDp/xUw4eFVryqSYatTWN5t 6y3kzH7matjlqEpKWdHJYitIfBqfLHJXjyCCqm0UyaUG9U5H6eXCJ6c/ItqsVQd6JbD7tP hEm/3YAagdSgZBHQnvxt1vhbUP3KxQBY6++EwyEfisW3oAvk+dFQhBy7qFjkyslnYuLkaU ZNXsgZgaQz482JIpm2i4KCw9kkF5ErxlZkaj46HIXJJl6Z0urVoyqvjHEyC1+Q== Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id CDE624060A for ; Tue, 18 Apr 2023 20:45:44 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I9BS-XR4fpuI for ; Tue, 18 Apr 2023 20:45:43 +0200 (CEST) Received: from chojin.sicho.home (amaterasu.sicho.home [192.168.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (no client certificate requested) (Authenticated sender) by hachiman (MailScanner Milter) with SMTP id E6C94D0BCD; Tue, 18 Apr 2023 20:45:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1681843543; bh=WaLPTWvcPalWGlFCAxGIkAfUCyLlE7HndFoO9FX77ks=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mAYjAElTeYBPNwDhcECWQ4m7U5fgtt1DuoRd9nwiuYJC9pTxxpnj54UNnhgg/Xl6Q uBWVAf8KvXqnmLonNXE57tk8INhiMbc/lItGFVuYZxG6ZnzEXr7Cm2/T9zQYhXR0gW mcBYBS0tsZSHTK9pdp93tLgSCTT3RMBEArUrjujL2roa/Q7CslddwwiD+HQf42llB9 mNYrv9g7b7+Q3mUzoPOVGha++0aqRjYd7rFq6isJHgjBekIotGqyTLdS5naSIBKA3R xg2ClzbtozymGEvds0zeTCJ3VX9Cq0qfYsHloH3joN/8xkFgfVZE36lOjjzL4NoMHO vH2zW6S4KILEw== From: Robin Roevens To: development@lists.ipfire.org Subject: [PATCH v2 2/3] Bugfix: compatibility with grep 3.8+ Date: Tue, 18 Apr 2023 20:45:11 +0200 Message-Id: <20230418184512.2235-3-robin.roevens@disroot.org> In-Reply-To: <20230418184512.2235-1-robin.roevens@disroot.org> References: <20230418184512.2235-1-robin.roevens@disroot.org> MIME-Version: 1.0 X-sicho-MailScanner-ID: E6C94D0BCD.A8A80 X-sicho-MailScanner: Found to be clean X-sicho-MailScanner-From: robin.roevens@disroot.org X-sicho-MailScanner-Watermark: 1682448326.99198@EqTUveyTA4DcHix6YZl3VA X-Rspamd-Action: no action X-Rspamd-Server: mail01.haj.ipfire.org X-Rspamd-Queue-Id: 4Q1CY52rNkzqt X-Spamd-Result: default: False [-1.66 / 11.00]; BAYES_HAM(-3.00)[99.99%]; SPF_REPUTATION_SPAM(1.86)[0.61852363191687]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[disroot.org,reject]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[disroot.org:s=mail]; R_SPF_ALLOW(-0.20)[+a]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; IP_REPUTATION_HAM(-0.01)[asn: 50673(0.00), country: NL(-0.01), ip: 178.21.23.139(0.00)]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[development@lists.ipfire.org]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; DKIM_REPUTATION(0.00)[0]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; ASN(0.00)[asn:50673, ipnet:178.21.23.0/24, country:NL]; RCVD_COUNT_THREE(0.00)[3]; RCPT_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[disroot.org:+]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_SOME(0.00)[] X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Fix "grep: warning: stray \ before /" message on Zabbix Agent ipfire.net.fw.hits item introduced by grep 3.8 in https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=40b5df3942149738529c22c9cfcd067cd672b605 Signed-off-by: Robin Roevens --- config/zabbix_agentd/userparameter_ipfire.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/zabbix_agentd/userparameter_ipfire.conf b/config/zabbix_agentd/userparameter_ipfire.conf index 10c09c25d..c5a636edf 100644 --- a/config/zabbix_agentd/userparameter_ipfire.conf +++ b/config/zabbix_agentd/userparameter_ipfire.conf @@ -5,7 +5,7 @@ UserParameter=ipfire.net.gateway.pingtime,sudo /usr/sbin/fping -c 3 gateway 2>&1 # Internet Gateway availability, can be used to check Internet connection UserParameter=ipfire.net.gateway.ping,sudo /usr/sbin/fping -q -r 3 gateway; [ ! $? ]; echo $? # Firewall Filter Forward chain drops in bytes/chain (JSON), can be used for discovery of firewall chains and monitoring of firewall hits on each chain -UserParameter=ipfire.net.fw.hits.raw,sudo /usr/local/bin/getipstat -xf | grep "\/\* DROP_.* \*\/$" | awk 'BEGIN { ORS = ""; print "["} { printf "%s{\"chain\": \"%s\", \"bytes\": \"%s\"}", separator, substr($11, 6), $2; separator = ", "; } END { print"]" }' +UserParameter=ipfire.net.fw.hits.raw,sudo /usr/local/bin/getipstat -xf | grep "/\* DROP_.* \*/$" | awk 'BEGIN { ORS = ""; print "["} { printf "%s{\"chain\": \"%s\", \"bytes\": \"%s\"}", separator, substr($11, 6), $2; separator = ", "; } END { print"]" }' # Number of currently Active DHCP leases UserParameter=ipfire.dhcpd.clients,grep -s -E 'lease|bind' /var/state/dhcp/dhcpd.leases | sed ':a;/{$/{N;s/\n//;ba}' | grep "state active" | wc -l # Number of Captive Portal clients