Skip to content

Commit

Permalink
Merge pull request #74 from dedis/node_exporter
Browse files Browse the repository at this point in the history
Added Prometheus Node Exporter in installation package.
  • Loading branch information
jbsv authored Mar 31, 2022
2 parents 17d6422 + 4006bcc commit 5b35103
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 4 deletions.
9 changes: 9 additions & 0 deletions deb-package/build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ cp $UKAPP_DIR/build/combine_shares_kvm-x86_64 $INSTALL_DIR
DVOTING_CLI_DIR=".."
cp $DVOTING_CLI_DIR/memcoin $INSTALL_DIR

# Prometheus Node Exporter
NE_DIR="deb/opt/exporter"
NE_VERSION="1.3.1"
mkdir -p ${NE_DIR}
wget https://github.com/prometheus/node_exporter/releases/download/v${NE_VERSION}/node_exporter-${NE_VERSION}.linux-amd64.tar.gz
tar xfz node_exporter-${NE_VERSION}.linux-amd64.tar.gz
mv node_exporter-${NE_VERSION}.linux-amd64/* ${NE_DIR}/
rm -rf node_exporter-${NE_VERSION}.linux-amd64*

# add config files
cp -a pkg/etc deb
cp -a pkg/lib deb
Expand Down
4 changes: 4 additions & 0 deletions deb-package/pkg/after-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ chown root:root /opt/dedis

# allow ls in sub dirs
chmod 755 /opt/dedis
chmod 755 /opt/exporter

chown root:root /lib/systemd/system

Expand All @@ -31,3 +32,6 @@ enable_service ${DVOTING_SERVICE}
systemctl start ${DVOTING_SERVICE}

ln -s /opt/dedis/dvoting/bin/memcoin /usr/bin/memcoin

enable_service exporter.service
systemctl start exporter.service
1 change: 1 addition & 0 deletions deb-package/pkg/before-remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
# stop service
systemctl stop dvoting.service
systemctl stop dvoting-uk.service
systemctl stop exporter.service

rm -f /usr/bin/memcoin
3 changes: 2 additions & 1 deletion deb-package/pkg/etc/dedis/dvoting/network.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export uk_port="1024"
export bridge_iface="uk0"

export dela_port="9000"
export prometheus_addr="0.0.0.0:9100"
export proxy_addr="0.0.0.0:9080"
export prometheus_addr="0.0.0.0:9100"
export node_exporter_addr="0.0.0.0:9101"
15 changes: 15 additions & 0 deletions deb-package/pkg/lib/systemd/system/exporter.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Prometheus Node Service

[Service]
User=dvoting

ExecStart=/opt/dedis/dvoting/bin/start-exporter

KillSignal=SIGINT

Restart=on-failure
RestartSec=1

[Install]
WantedBy=multi-user.target
5 changes: 5 additions & 0 deletions deb-package/pkg/opt/dedis/dvoting/bin/start-exporter
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

source /etc/dedis/dvoting/network.env

/opt/exporter/node_exporter --web.listen-address=${node_exporter_addr} --collector.systemd
4 changes: 1 addition & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.dedis.ch/dela v0.0.0-20211018150429-1fdbe35cd189/go.mod h1:GVQ2MumgCcAkor2MmfRCoqTBsFjaaqt7HfJpQLhMGok=
go.dedis.ch/dela v0.0.0-20220323154142-09e1dea38ec7 h1:RgZlTINsC6skFRDxiT+1JspgI1NdwDX2DFBmamudSOU=
go.dedis.ch/dela v0.0.0-20220323154142-09e1dea38ec7/go.mod h1:r+9YxnSP/4xr5/RtgFXYlRQwfm5X/ySxTkTj2if0R/k=
go.dedis.ch/dela v0.0.0-20220323172319-20a841138815 h1:vnisq8n8OkYhUDyEi2CL1bANRdZ7DCq+7pr5kQ0zNqo=
go.dedis.ch/dela v0.0.0-20220323172319-20a841138815/go.mod h1:Rg2wuj6MuMYVXx3P2feTFJjOk8E81s6xxxyJ7o5oJ90=
go.dedis.ch/dela-apps v0.0.0-20211019120455-a0db752a0ba0 h1:gPrJd+7QUuADpfToMKr80maGnjGPeB7ft7iNrkAtwGY=
Expand Down Expand Up @@ -524,10 +522,10 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs=
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
Expand Down

0 comments on commit 5b35103

Please sign in to comment.