From 74f3b0a11f3964d38122e5b1128517e7de80239e Mon Sep 17 00:00:00 2001 From: Georg Date: Sun, 25 Jul 2021 22:50:43 +0200 Subject: Integrating firewalld into node_exporter script Signed-off-by: Georg --- scripts/sh/deploy_node_exporter.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/sh/deploy_node_exporter.sh') diff --git a/scripts/sh/deploy_node_exporter.sh b/scripts/sh/deploy_node_exporter.sh index 52dbc7f..d6551f0 100755 --- a/scripts/sh/deploy_node_exporter.sh +++ b/scripts/sh/deploy_node_exporter.sh @@ -27,6 +27,13 @@ ExecStart=/opt/node_exporter/node_exporter --web.listen-address=":9200" WantedBy=multi-user.target EOF systemctl enable --now node_exporter +if [ -x $(command -v firewall-cmd) ] +then +firewall-cmd --zone=internal --add-port=9200/tcp --permanent +firewall-cmd --reload +else +echo "No firewalld, skipping." +fi echo "OK" else echo "Found traces of an existing installation. Aborted." -- cgit v1.2.3