This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VMID=$1 | |
IMAGE_URL=$2 | |
STORAGE_TARGET=$3 | |
DISK_LABEL=$4 | |
DISK_SLOT=${5:-""} | |
if [ $# -lt 4 ]; then | |
echo "Usage: $0 <vmid> <image_url> <storage_target> <disk_label> [<disk_slot>]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
TMP_DIR="/tmp/exporter_installers" | |
mkdir -p "$TMP_DIR" | |
NODE_EXPORTER_URL="https://gist.githubusercontent.com/NotYusta/7f0121db2fb01c60edb3d64ad1b9cd27/raw/3be376455f4ffce7e5e8018cd32254cef9595ff0/install_node_exporter.sh" | |
CADVISOR_URL="https://gist.githubusercontent.com/NotYusta/412c55b1d712bd717ccc310c7c48328b/raw/98e360718f1ad10bae158a60372a3ba1643949d0/install_cadvisor.sh" | |
SMARTCTL_URL="https://gist.githubusercontent.com/NotYusta/5ab4a72e28957575b4ed75a17f111699/raw/cf3bd3b0fc5d89c73a2e040e99afed4866a0ebc1/install_smartctl.sh" | |
FIREWALL_URL="https://gist.githubusercontent.com/NotYusta/af31c51a86be5b20575ecc1514f50d28/raw/3a4ef2cf15bc6a61a4d0a2b705bb619aee6e0aed/install_exporters_firewall" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
TMP_DIR="/tmp/exporter_installers" | |
mkdir -p "$TMP_DIR" | |
NODE_EXPORTER_URL="https://gist.githubusercontent.com/NotYusta/7f0121db2fb01c60edb3d64ad1b9cd27/raw/3be376455f4ffce7e5e8018cd32254cef9595ff0/install_node_exporter.sh" | |
SMARTCTL_URL="https://gist.githubusercontent.com/NotYusta/5ab4a72e28957575b4ed75a17f111699/raw/cf3bd3b0fc5d89c73a2e040e99afed4866a0ebc1/install_smartctl.sh" | |
FIREWALL_URL="https://gist.githubusercontent.com/NotYusta/af31c51a86be5b20575ecc1514f50d28/raw/3a4ef2cf15bc6a61a4d0a2b705bb619aee6e0aed/install_exporters_firewall" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
EXPORTER_PORT_RANGE="9100:9200" | |
IPSET_NAME=exporters_whitelist | |
CHAIN_NAME=exporters_firewall | |
# Function to install necessary packages | |
install_packages() { | |
if command -v apt-get >/dev/null 2>&1; then | |
apt-get update -y | |
apt-get install -y ipset iptables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PORT=9102 | |
BIN_DIR="/usr/local/bin" | |
SERVICE_NAME="smartctl-exporter" | |
BINARY_NAME="smartctl-exporter" | |
VERSION="0.14.0" | |
DOWNLOAD_URL="https://github.com/prometheus-community/smartctl_exporter/releases/download/v${VERSION}/smartctl_exporter-${VERSION}.linux-amd64.tar.gz" | |
# Function to download and extract smartctl_exporter | |
install_smartctl_exporter() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PORT=9101 | |
BIN_DIR="/usr/local/bin" | |
SERVICE_NAME="cadvisor" | |
BINARY_NAME="cadvisor" | |
VERSION="0.52.1" | |
DOWNLOAD_URL="https://github.com/google/cadvisor/releases/download/v${VERSION}/cadvisor-v${VERSION}-linux-amd64" | |
# Function to download and place cadvisor binary | |
install_cadvisor() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CADVISOR_PORT=9101 | |
IPSET_NAME=cadvisor_whitelist | |
CHAIN_NAME=cadvisor_firewall | |
# Function to install necessary packages | |
install_packages() { | |
if command -v apt-get >/dev/null 2>&1; then | |
apt-get update -y | |
apt-get install -y ipset iptables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e # Stop the script if any command fails | |
TMP_APP_FILE="/tmp/node_exporter_install.sh" | |
TMP_FW_FILE="/tmp/node_exporter_firewall.sh" | |
NODE_EXPORTER_APP_URL="https://gist.githubusercontent.com/NotYusta/7f0121db2fb01c60edb3d64ad1b9cd27/raw/dd98f7a7a9ef0dfd552679474a116514a48548ee/install_node_exporter.sh" | |
NODE_EXPORTER_FW_URL="https://gist.githubusercontent.com/NotYusta/a0aa75ccd11f8966ececd50916a08be2/raw/9884a086c9f55615bab741272340c83214f6d1c3/node_exporter_firewall.sh" | |
# Prompt user for IP list | |
echo "Enter IPs separated by commas (e.g., 1.2.3.4,5.6.7.0/24):" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Function to download and extract cadvisor | |
install_cadvisor() { | |
curl -sLo /bin/node-exporter https://github.com/google/cadvisor/releases/download/v0.52.1/cadvisor-v0.52.1-linux-amd64 | |
chmod +x /bin/node-exporter | |
} | |
# Function to create systemd service for cadvisor | |
create_systemd_service() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PORT=9100 | |
BIN_DIR="/usr/local/bin" | |
SERVICE_NAME="node-exporter" | |
BINARY_NAME="node-exporter" | |
VERSION="1.9.1" | |
DOWNLOAD_URL="https://github.com/prometheus/node_exporter/releases/download/v${VERSION}/node_exporter-${VERSION}.linux-amd64.tar.gz" | |
# Function to download and extract node_exporter | |
install_node_exporter() { |
NewerOlder