-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·53 lines (40 loc) · 1.82 KB
/
setup.sh
File metadata and controls
executable file
·53 lines (40 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
echo '[+] Updating system'
sudo apt-get update && sudo apt-get upgrade
echo '[+] Downloading Grafana Binaries'
wget https://dl.grafana.com/oss/release/grafana-10.4.2.linux-armv7.tar.gz
echo '[+] Uncompressing'
tar -xzvf grafana-10.4.2.linux-armv7.tar.gz
sudo mv grafana-v10.4.2/ /usr/local/bin/grafana
echo '[+] Downloading Prometheus Binaries'
wget https://github.com/prometheus/prometheus/releases/download/v2.52.0-rc.0/prometheus-2.52.0-rc.0.linux-armv7.tar.gz
echo '[+] Uncompressing'
tar -xzvf prometheus-2.52.0-rc.0.linux-armv7.tar.gz
sudo mv prometheus-2.52.0-rc.0.linux-armv7 /usr/local/bin/prometheus
echo '[+] Copying prometheus configs'
cp -pv prometheus.yml /usr/local/bin/prometheus/prometheus.yml
echo '[+] creating virtual environment'
# Check if the venv folder exists
if [ ! -d "./venv" ]; then
echo "Creating virtual environment..."
# Run the command to create a virtual environment
python3 -m venv venv
echo "Virtual environment created."
else
echo "Virtual environment already exists."
fi
source venv/bin/activate
pip install -r requirements.txt
sudo cp composter.service /etc/systemd/system/.
sudo cp prometheus.service /etc/systemd/system/.
sudo cp grafana.service /etc/systemd/system/.
sudo systemctl daemon-reload
sudo systemctl enable prometheus
sudo systemctl start prometheus
sudo systemctl enable grafana
sudo systemctl start grafana
sudo systemctl enable composter
sudo systemctl start composter
echo "[+] Prometheus is running on http://$(ip -o -4 addr show wlan0 | awk '{print $4}' | cut -d'/' -f1):9090"
echo "[+] Grafana Dashboard can be accessed at is running on http://$(ip -o -4 addr show wlan0 | awk '{print $4}' | cut -d'/' -f1):3000"
echo "[!] Initial Setup Complete. Please follow the remaining instructions in the README.md file to create your compost temperature dashboard"