Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rc-node_exporter
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rc
rc-node_exporter
Commits
a75ef1b7
Commit
a75ef1b7
authored
1 year ago
by
Mike Hanby
Browse files
Options
Downloads
Patches
Plain Diff
Delete Retired Bash Install Script
parent
e7bf66f6
No related branches found
Branches containing commit
No related tags found
1 merge request
!4
Delete Retired Bash Install Script
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
install-node_exporter.sh
+0
-51
0 additions, 51 deletions
install-node_exporter.sh
with
0 additions
and
51 deletions
install-node_exporter.sh
deleted
100755 → 0
+
0
−
51
View file @
e7bf66f6
#!/usr/bin/env bash
ver
=
"1.6.1"
file
=
"node_exporter-
${
ver
}
.linux-amd64.tar.gz"
sha256
=
sha256sums.txt
# cd to the script directory, in case the user has run it from another directory
sriptdir
=
$(
cd
"
$(
dirname
"
$0
"
)
"
&&
pwd
)
cd
$sriptdir
if
[[
!
-f
$file
]]
;
then
echo
"Downloading
$file
from Github"
curl
-L
https://github.com/prometheus/node_exporter/releases/download/v
${
ver
}
/
${
file
}
-o
$file
fi
echo
"Downloading the
$sha256
checksum file"
curl
-L
https://github.com/prometheus/node_exporter/releases/download/v
${
ver
}
/
$sha256
-o
$sha256
if
!
grep
$file
$sha256
|
sha256sum
-c
-
;
then
echo
"checksum failed for
$file
, exitting"
>
&2
exit
1
else
echo
"Checksum of
$file
: OK"
fi
if
[[
!
-d
tmp/
${
file
%.tar.gz
}
]]
;
then
echo
"Extracting
$file
to tmp/"
tar
-zxf
$file
-C
tmp/
fi
echo
"Adding system user: node_exporter"
useradd
-rs
/bin/false node_exporter
echo
"Copying node_exporter binary to /usr/local/bin"
systemctl is-active
--quiet
node_exporter.service
&&
systemctl stop node_exporter.service
cp
tmp/
${
file
%.tar.gz
}
/node_exporter /usr/local/bin/
chown
root:root /usr/local/bin/node_exporter
echo
"Creating /etc/systemd/system/node_exporter.service file"
cp
node_exporter.service /etc/systemd/system/
echo
"Starting node_exporter.service"
systemctl daemon-reload
systemctl
enable
node_exporter.service
systemctl start node_exporter.service
## Host based firewall rules to allow incoming scrapes on `9100/tcp`
## from the Prometheus public IP
#echo "Creating firewalld rule to allow Prometheus server access to 9100/tcp"
#firewall-cmd --zone=public --permanent --add-rich-rule='rule family="ipv4" source address="172.20.0.99" port protocol="tcp" port="9100" accept'
#firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="172.20.0.99" port protocol="tcp" port="9100" accept'
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment