From patchwork Sun Apr 2 11:07:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Roevens X-Patchwork-Id: 6758 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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4PqB7z5yYJz3wvh for ; Sun, 2 Apr 2023 11:07:43 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4PqB7x5HfDzp8; Sun, 2 Apr 2023 11:07:41 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4PqB7x3gpNz30D6; Sun, 2 Apr 2023 11:07:41 +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 4PqB7w0f8tz2xNW for ; Sun, 2 Apr 2023 11:07:40 +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) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4PqB7t0Lq4zp8 for ; Sun, 2 Apr 2023 11:07:37 +0000 (UTC) Authentication-Results: mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=EpjlAcsX; 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=1680433658; a=rsa-sha256; cv=none; b=IcFYl5tZVHFtA+LuPTCsMhbYSzbycbkP1DMCgnvhDPpxNpsu0zdtYP9D0vNzX0Ntu3rEzR ARkK1mEh0BgwAcxScEk0nyGHYdbL1jUW7b7oSrRcIY8VUtw1uZoGdpjHU1dA7j4taSzZfO YU5sM/nKGTHNMyeillQE2iHuFMRWch/xok31IjfSj/A+32YEjvXjzW0OstghpN19qiHlD2 ii2XJpBit6JEgrKOt8Dnp81ZwLbzLoOymCdQmPLGNOaj2KEZTSnwmlIFfde5vBKvdyrhv2 /hcJY4EEL+J842blWNN80QltaShMVF/7ZC9OX3nyjN8Q0jtyK1DJbeGUWyP1sw== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=EpjlAcsX; 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=1680433658; 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=FQNAZXu6sm2U9VzlhJdla9jHThUgcC5Tydx4Yk/d66oP5JnVO8Hopr4sGoCBtobjDfCn2g sVUGZbfGRLuy+QK+AfoR37MjhJtcrV4pIXn3W0dxNEZe+7MHVY73B6aVvbNLQli0D3c5wX N4KUSShGjJYUzYEty4rGBL+toIL4/3RsRZOGCuWHRicNqsTc59DuFOjXtJ2rczIGh82x3b hhdtQXLrtUyirLAJ1AWHNCh0JHPod4iaKECC1FM7p7UVwlH6aSowzE/8wuZedTFyvxDwU2 +meKUIOwQeQgLRrJR/KElXNPWIcCa7jwNKirvb+AiwuaT3L9leGrTq05cr2dag== Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 0C2804021F for ; Sun, 2 Apr 2023 13:07:37 +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 S_OlqEQf-1nd for ; Sun, 2 Apr 2023 13:07:35 +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 A3092C9062; Sun, 2 Apr 2023 13:07:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1680433655; bh=WaLPTWvcPalWGlFCAxGIkAfUCyLlE7HndFoO9FX77ks=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EpjlAcsXCvAA1ZFh7+uK9oukXWEEEZqViYEGYBtL5XIvC3dm6yKzy8WCt0H20bCrt gkZiY+i+8ePidQus3vZW3uC6hOyx8+u6afZ5uZ7ArZJEcZZkf0eHGWJQrOPf1r/uda 0vGg9AGzGPo5x0N7Ee3sQz+mWNCSQJGqQ9+g+Nr0838fkbXNcAhBjBK6ptbEbzwwGz Akl+nkCRFZ+HKyh+HcKfVilIGx/fURCTbEj5LqI3qH7qQQSRideYh9VWRuJ6E2LNGf zKuv/7XX76FiISUYBMZdGa6tHDT7D2R7zmHDhFOYprkuKn6q0x715DCewuKrPjyKSs eLm40kAI7ixYQ== From: Robin Roevens To: development@lists.ipfire.org Subject: [PATCH 2/3] Bugfix: compatibility with grep 3.8+ Date: Sun, 2 Apr 2023 13:07:10 +0200 Message-Id: <20230402110711.19593-3-robin.roevens@disroot.org> In-Reply-To: <20230402110711.19593-1-robin.roevens@disroot.org> References: <20230402110711.19593-1-robin.roevens@disroot.org> MIME-Version: 1.0 X-sicho-MailScanner-ID: A3092C9062.A8A80 X-sicho-MailScanner: Found to be clean X-sicho-MailScanner-From: robin.roevens@disroot.org X-sicho-MailScanner-Watermark: 1681038442.8439@jiKTOtaZ5gHxKf0Zr+iF5A X-Rspamd-Action: no action X-Rspamd-Server: mail01.haj.ipfire.org X-Rspamd-Queue-Id: 4PqB7t0Lq4zp8 X-Spamd-Result: default: False [-0.15 / 11.00]; BAYES_HAM(-3.00)[99.99%]; SPF_REPUTATION_SPAM(2.37)[0.78937627724883]; MID_CONTAINS_FROM(1.00)[]; DMARC_POLICY_ALLOW(-0.50)[disroot.org,reject]; R_MISSING_CHARSET(0.50)[]; R_SPF_ALLOW(-0.20)[+a]; R_DKIM_ALLOW(-0.20)[disroot.org:s=mail]; 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)]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:50673, ipnet:178.21.23.0/24, country:NL]; RCPT_COUNT_TWO(0.00)[2]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[disroot.org:+]; PREVIOUSLY_DELIVERED(0.00)[development@lists.ipfire.org]; DKIM_REPUTATION(0.00)[0]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; ARC_NA(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 Reviewed-by: Adolf Belka --- 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