summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGeorg2021-07-25 22:50:43 +0200
committerGeorg2021-07-25 23:02:04 +0200
commit9c35dec520f486c9657fa8abe57ba0b7c438e222 (patch)
treee68cf34f84862ce423b6150d3c5d000668de81e8 /scripts
parent5f0c272343320697b67b521238431fcb8dbfc543 (diff)
downloadsystem-9c35dec520f486c9657fa8abe57ba0b7c438e222.tar.gz
system-9c35dec520f486c9657fa8abe57ba0b7c438e222.tar.bz2
system-9c35dec520f486c9657fa8abe57ba0b7c438e222.zip
Integrating firewalld into node_exporter script
Signed-off-by: Georg <georg@lysergic.dev>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/sh/deploy_node_exporter.sh7
1 files changed, 7 insertions, 0 deletions
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."