1
0
mirror of https://github.com/librenms/librenms-agent.git synced 2024-05-09 09:54:52 +00:00

Minor script reverts (osupdate, phpfpm) (#362)

* Revert changes made in #355 that broke the script.

* Revert partial changes made in #356

By just removing the quotes in line 81 i could make the script work again

* osupdate yum revert

Realized i had a centos to test

* Fix curl error

`curl: (3) URL using bad/illegal format or missing URL`
Not sure how to properly fix it but moving the hardcode flags to the variable so its not empty did fix it. The curl error caused to push down all values 1 line which made them mismatch in librenms.

* Update osupdate

* Update phpfpmsp

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
This commit is contained in:
Wheel
2021-03-25 21:14:43 -04:00
committed by GitHub
parent 67d73c7b99
commit 4e09377661
2 changed files with 15 additions and 9 deletions

View File

@@ -34,7 +34,8 @@ CMD_APK=' version'
################################################################
if command -v zypper &>/dev/null ; then
# OpenSUSE
UPDATES=$($BIN_ZYPPER "$CMD_ZYPPER" | $BIN_WC $CMD_WC)
# shellcheck disable=SC2086
UPDATES=$($BIN_ZYPPER $CMD_ZYPPER | $BIN_WC $CMD_WC)
if [ "$UPDATES" -ge 2 ]; then
echo $(($UPDATES-2));
else
@@ -42,7 +43,8 @@ if command -v zypper &>/dev/null ; then
fi
elif command -v dnf &>/dev/null ; then
# Fedora
UPDATES=$($BIN_DNF "$CMD_DNF" | $BIN_WC $CMD_WC)
# shellcheck disable=SC2086
UPDATES=$($BIN_DNF $CMD_DNF | $BIN_WC $CMD_WC)
if [ "$UPDATES" -ge 1 ]; then
echo $(($UPDATES-1));
else
@@ -58,7 +60,8 @@ elif command -v pacman &>/dev/null ; then
fi
elif command -v yum &>/dev/null ; then
# CentOS / Redhat
UPDATES=$($BIN_YUM "$CMD_YUM" | $BIN_WC $CMD_WC)
# shellcheck disable=SC2086
UPDATES=$($BIN_YUM $CMD_YUM | $BIN_WC $CMD_WC)
if [ "$UPDATES" -ge 1 ]; then
echo $(($UPDATES-1));
else
@@ -66,7 +69,8 @@ elif command -v yum &>/dev/null ; then
fi
elif command -v apt-get &>/dev/null ; then
# Debian / Devuan / Ubuntu
UPDATES=$($BIN_APT "$CMD_APT" | $BIN_GREP $CMD_GREP 'Inst')
# shellcheck disable=SC2086
UPDATES=$($BIN_APT $CMD_APT | $BIN_GREP $CMD_GREP 'Inst')
if [ "$UPDATES" -ge 1 ]; then
echo "$UPDATES";
else
@@ -74,7 +78,8 @@ elif command -v apt-get &>/dev/null ; then
fi
elif command -v pkg &>/dev/null ; then
# FreeBSD
UPDATES=$($BIN_PKG "$CMD_PKG" | $BIN_WC $CMD_WC)
# shellcheck disable=SC2086
UPDATES=$($BIN_PKG $CMD_PKG | $BIN_WC $CMD_WC)
if [ "$UPDATES" -ge 1 ]; then
echo "$UPDATES";
else
@@ -82,7 +87,8 @@ elif command -v pkg &>/dev/null ; then
fi
elif command -v apk &>/dev/null ; then
# Alpine
UPDATES=$($BIN_APK "$CMD_APK" | $BIN_WC $CMD_WC)
# shellcheck disable=SC2086
UPDATES=$($BIN_APK $CMD_APK | $BIN_WC $CMD_WC)
if [ "$UPDATES" -ge 2 ]; then
echo $(($UPDATES-1));
else

View File

@@ -42,7 +42,7 @@
# the URL to fetch, change as needed
url="http://localhost/status?full"
opts=""
opts="-Ss"
# netdata
# real-time performance and health monitoring, done right!
@@ -77,8 +77,8 @@ phpfpm_slow_requests=0
# local opts="${1}" url="${2}"
phpfpm_response=("$(curl -Ss "${opts}" "${url}")")
# shellcheck disable=SC2207
phpfpm_response=($(curl "${opts}" "${url}"))
[ $? -ne 0 ] || [ "${#phpfpm_response[@]}" -eq 0 ] && exit 1
if [[ "${phpfpm_response[0]}" != "pool:" \