install pip

This commit is contained in:
Cyberes 2023-04-21 23:54:20 -06:00
parent d3c6d61b6b
commit 56b51e77b3
2 changed files with 11 additions and 2 deletions

View File

@ -34,8 +34,8 @@ def main():
warnings.simplefilter("ignore", category=RuntimeWarning) warnings.simplefilter("ignore", category=RuntimeWarning)
speedtest_results = cloudflareclass.cloudflare(printit=False).runalltests() speedtest_results = cloudflareclass.cloudflare(printit=False).runalltests()
out_str = f"upload: {speedtest_results['90th_percentile_upload_speed']['value']} Mbps, download: {speedtest_results['90th_percentile_download_speed']['value']} Mbps, latency: {speedtest_results['latency_ms']['value']} ms, Jitter: {speedtest_results['Jitter_ms']['value']} ms" out_str = f"upload: {speedtest_results['90th_percentile_upload_speed']['value']} Mbps, download: {speedtest_results['90th_percentile_download_speed']['value']} Mbps, latency: {speedtest_results['latency_ms']['value']} ms, jitter: {speedtest_results['Jitter_ms']['value']} ms"
perf_data = f"'upload'={speedtest_results['90th_percentile_upload_speed']['value'] * 1e+6}B;{args.warn_up * 1e+6};{args.critical_up * 1e+6};0; 'download'={speedtest_results['90th_percentile_download_speed']['value'] * 1e+6}B;{args.warn_down * 1e+6};{args.critical_down * 1e+6};0; 'latency_ms'={speedtest_results['latency_ms']['value']}ms;{args.warn_latency};{args.critical_latency};0; 'Jitter_ms'={speedtest_results['Jitter_ms']['value']}ms;;;0;" perf_data = f"'upload'={speedtest_results['90th_percentile_upload_speed']['value'] * 1e+6}B;{args.warn_up * 1e+6};{args.critical_up * 1e+6};0; 'download'={speedtest_results['90th_percentile_download_speed']['value'] * 1e+6}B;{args.warn_down * 1e+6};{args.critical_down * 1e+6};0; 'latency_ms'={speedtest_results['latency_ms']['value']}ms;{args.warn_latency};{args.critical_latency};0; 'jitter_ms'={speedtest_results['Jitter_ms']['value']}ms;;;0;"
exit_code = nagios.OK exit_code = nagios.OK

View File

@ -11,8 +11,17 @@ ln_existing() {
ln -s "$src" "$dest" ln -s "$src" "$dest"
} }
if [[ $UID != 0 ]]; then
echo "Please run this script with sudo:"
echo "sudo $0 $*"
exit 1
fi
apt update apt update
apt install -y python3-venv git sysstat bc smartmontools curl recode python3-pip apt 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 -U pip wheel setuptools
pip install psutil check_systemd pip install psutil check_systemd