Speedtest netdata plugin (#71)

This commit is contained in:
enggnr 2023-08-01 12:24:04 +05:30 committed by GitHub
parent b9fe28a9b7
commit b2311d02de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 4 deletions

View file

@ -166,6 +166,16 @@
pull.args = ["--ff-only"] pull.args = ["--ff-only"]
{{- end }} {{- end }}
{{- if (lookPath "pipx") }}
### Netdata Speedtest
[".local/share/netdata-speedtest"]
type = "git-repo"
url = "https://github.com/ohthehugemanatee/netdata-speedtest.git"
refreshPeriod = "{{ $refreshPeriod }}"
clone.args = ["--depth", "1"]
pull.args = ["--ff-only"]
{{- end }}
### Git Template ### Git Template
# [".config/git/template/_/husky.sh"] # [".config/git/template/_/husky.sh"]
# type = "file" # type = "file"

View file

@ -61,7 +61,7 @@ if command -v netdata-claim.sh > /dev/null; then
if [ -d /usr/local/etc/netdata ]; then if [ -d /usr/local/etc/netdata ]; then
NETDATA_ETC='/usr/local/etc/netdata/' NETDATA_ETC='/usr/local/etc/netdata/'
elif [ -d /etc/netdata ]; then elif [ -d /etc/netdata ]; then
NETDATA_EDC='/etc/netdata' NETDATA_ETC='/etc/netdata'
else else
logg error 'No etc location found for netdata' && exit 1 logg error 'No etc location found for netdata' && exit 1
fi fi
@ -89,7 +89,7 @@ if command -v netdata-claim.sh > /dev/null; then
DEBSECAN_GIT="${XDG_DATA_HOME:-$HOME/.local/share}/netdata-debsecan" DEBSECAN_GIT="${XDG_DATA_HOME:-$HOME/.local/share}/netdata-debsecan"
# Installing the script to generate report on CVEs in installed packages # Installing the script to generate report on CVEs in installed packages
logg info 'Installing script to generate on CVEs in installed packages' logg info 'Installing script to generate report on CVEs in installed packages'
sudo cp -f "$DEBSECAN_GIT/usr_local_bin_debsecan-by-type" "/usr/local/bin/debsecan-by-type" sudo cp -f "$DEBSECAN_GIT/usr_local_bin_debsecan-by-type" "/usr/local/bin/debsecan-by-type"
# Generate initial debsecan reports in /var/log/debsecan/ # Generate initial debsecan reports in /var/log/debsecan/
@ -113,6 +113,17 @@ if command -v netdata-claim.sh > /dev/null; then
fi fi
fi fi
### Configure Netdata to gather information about Internet connection speed
if command -v speedtest-cli > /dev/null; then
SPEEDTEST_GIT="${XDG_DATA_HOME:-$HOME/.local/share}/netdata-speedtest"
# Installing the script to generate report on Internet connection speed
logg info 'Installing script to generate report on Internet connection speed'
sudo cp -f "$SPEEDTEST_GIT/speedtest.chart.sh" "/usr/libexec/netdata/charts.d/speedtest.chart.sh"
else
logg warn '`speedtest-cli` is not available in the PATH or is not installed'
fi
ensureNetdataOwnership ensureNetdataOwnership
### Restart Netdata service ### Restart Netdata service

View file

@ -6012,6 +6012,9 @@ softwarePackages:
_home: https://www.netdata.cloud/ _home: https://www.netdata.cloud/
_name: Netdata _name: Netdata
_service: netdata _service: netdata
_deps:
- debsecan
- speedtest-cli
ansible: professormanhattan.netdata ansible: professormanhattan.netdata
brew: netdata brew: netdata
pacman: netdata pacman: netdata
@ -8277,6 +8280,14 @@ softwarePackages:
_home: null _home: null
_name: speed-test _name: speed-test
npm: speed-test npm: speed-test
speedtest-cli:
_bin: speedtest-cli
_desc: Command line interface for testing internet bandwidth using speedtest.net
_docs: null
_github: https://github.com/sivel/speedtest-cli
_home: null
_name: speedtest-cli
pipx: speedtest-cli
spotdl: spotdl:
_bin: spotdl _bin: spotdl
_deps: _deps: