install changes

This commit is contained in:
Cyberes 2023-04-21 23:54:20 -06:00
parent 56b51e77b3
commit 8eddbed588
1 changed files with 14 additions and 13 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
# apt update && apt install -y git && cd /opt && git -C /opt/icinga2-checks pull || git clone https://git.dp15.us/dpanzer/icinga2-checks.git /opt/icinga2-checks && bash /opt/icinga2-checks/install.sh
# apt-get update && apt-get install -y git && cd /opt && git -C /opt/icinga2-checks pull || git clone https://git.dp15.us/dpanzer/icinga2-checks.git /opt/icinga2-checks && bash /opt/icinga2-checks/install.sh
ln_existing() {
src=$1
@ -18,19 +18,19 @@ if [[ $UID != 0 ]]; then
fi
apt update
apt install -y python3-venv git sysstat bc smartmontools curl recode python3-pip
apt-get update
apt-get install -y python3-venv git sysstat bc smartmontools curl recode python3-pip
curl https://bootstrap.pypa.io/get-pip.py | python3
# sudo synogear install
pip install -U pip wheel setuptools
pip install psutil check_systemd
pip install --disable-pip-version-check --root-user-action=ignore -U pip wheel setuptools
pip install --disable-pip-version-check --root-user-action=ignore psutil check_systemd
mkdir -p /usr/lib64/nagios/plugins/
# Install global pip packages
#pip install psutil
#pip install --disable-pip-version-check --root-user-action=ignore psutil
git -C /opt/icinga2-checks pull || git clone https://git.dp15.us/dpanzer/icinga2-checks.git /opt/icinga2-checks
# git -C /opt/icinga2-checks pull || git clone https://git.evulid.cc/cyberes/icinga2-checks.git /opt/icinga2-checks
mkdir -p /opt/venvs
@ -43,11 +43,11 @@ if [[ ! -d /opt/venvs/check_pve ]]; then
python3 -m venv /opt/venvs/check_pve
fi
/opt/venvs/icinga2_checks/bin/pip install -U pip wheel setuptools
/opt/venvs/icinga2_checks/bin/pip install -r /opt/icinga2-checks/requirements.txt
/opt/venvs/icinga2_checks/bin/pip install --disable-pip-version-check --root-user-action=ignore -U pip wheel setuptools
/opt/venvs/icinga2_checks/bin/pip install --disable-pip-version-check --root-user-action=ignore -r /opt/icinga2-checks/requirements.txt
/opt/venvs/check_pve/bin/pip install -U pip wheel setuptools
/opt/venvs/check_pve/bin/pip install -r /opt/icinga2-checks/check_pve/requirements.txt
/opt/venvs/check_pve/bin/pip install --disable-pip-version-check --root-user-action=ignore -U pip wheel setuptools
/opt/venvs/check_pve/bin/pip install --disable-pip-version-check --root-user-action=ignore -r /opt/icinga2-checks/check_pve/requirements.txt
ln_existing /opt/icinga2-checks/check_iowait.sh /usr/lib64/nagios/plugins/check_iowait
ln_existing /opt/icinga2-checks/check_bandwidth.py /usr/lib64/nagios/plugins/check_bandwidth
@ -67,8 +67,8 @@ if [[ ! -d /opt/linuxfabrik-monitoring-plugins ]]; then
cd /opt/linuxfabrik-monitoring-plugins
rm -rf lib
git clone https://github.com/Linuxfabrik/lib.git
/opt/venvs/linuxfabrik/bin/pip install -U pip wheel setuptools
/opt/venvs/linuxfabrik/bin/pip install bs4 psutil smbprotocol vici pymysql
/opt/venvs/linuxfabrik/bin/pip install --disable-pip-version-check --root-user-action=ignore -U pip wheel setuptools
/opt/venvs/linuxfabrik/bin/pip install --disable-pip-version-check --root-user-action=ignore bs4 psutil smbprotocol vici pymysql
fi
ln_existing /opt/linuxfabrik-monitoring-plugins/check-plugins/disk-io/disk-io3 /usr/lib64/nagios/plugins/disk-io
@ -82,4 +82,5 @@ setcap cap_net_raw+ep /usr/lib/nagios/plugins/check_icmp
setcap cap_net_raw+ep /usr/lib/nagios/plugins/check_ping
setcap 'cap_net_raw+ep' "$(which ping)"
mkdir -p /opt/venvs/icinga2_checks/lib/python3.10/site-packages/certifi/
ln_existing /etc/ssl/certs/ca-certificates.crt /opt/venvs/icinga2_checks/lib/python3.10/site-packages/certifi/cacert.pem