First batch of moitoring scripts (#2)
Co-authored-by: muppeth <muppeth@disroot.org> Reviewed-on: #2 Co-authored-by: muppeth <muppeth@no-reply@disroot.org> Co-committed-by: muppeth <muppeth@no-reply@disroot.org>
This commit is contained in:
parent
8191a5f167
commit
24685b6412
|
@ -3,7 +3,7 @@
|
|||
source /var/local/container-scripts/zabbix-scripts.cfg
|
||||
|
||||
#statistics
|
||||
PAD_TOTALPADS=$(mysql -h "${PAD_HOST}" -u "${PADDB_USER}" -p "${PADDB_PASSWD}" "${PADDB_NAME}" -s -r -N -e \
|
||||
PAD_TOTALPADS=$(mysql -h "${PAD_HOST}" -u "${PADDB_USER}" -p"${PADDB_PASSWD}" "${PADDB_NAME}" -s -r -N -e \
|
||||
"select count(distinct substring(store.key,5,locate(':',store.key,5)-5)) as 'pads' from store where store.key like 'pad:%';")
|
||||
PAD_ACTIVEUSERS=$(curl http://${PAD_LISTEN}:${PAD_PORT}/stats |jq .totalUsers)
|
||||
PAD_ACTIVEPADS=$(curl http://${PAD_LISTEN}:${PAD_PORT}/stats |jq .activePads)
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
source /var/local/container-scripts/zabbix-scripts.cfg
|
||||
|
||||
#all polls
|
||||
POLLS_ALL=$(mysql -h "${POLLDB_HOST}" -u "${POLLDB_USER}" -p${POLLDB_PASSWD}" -s -r -N -e "SELECT COUNT(*) from ${POLLDB_PREFIX}_poll;)
|
||||
POLLS_ALL=$(mysql -h "${POLLDB_HOST}" -u "${POLLDB_USER}" -p"${POLLDB_PASSWD}" "${POLLDB_NAME}" -s -r -N -e "SELECT COUNT(*) from ${POLLDB_PREFIX}poll;")
|
||||
|
||||
#poll type event
|
||||
POLLS_EVENTS=$(mysql -h "${POLLDB_HOST}" -u "${POLLDB_USER}" -p${POLLDB_PASSWD}" -s -r -N -e "SELECT COUNT(*) from ${POLLDB_PREFIX}_poll where format = 'D';)
|
||||
POLLS_EVENTS=$(mysql -h "${POLLDB_HOST}" -u "${POLLDB_USER}" -p"${POLLDB_PASSWD}" "${POLLDB_NAME}" -s -r -N -e "SELECT COUNT(*) from ${POLLDB_PREFIX}poll where format = 'D';")
|
||||
|
||||
#poll type standard
|
||||
POLLS_STANDARD=$(mysql -h "${POLLDB_HOST}" -u "${POLLDB_USER}" -p${POLLDB_PASSWD}" -s -r -N -e "SELECT COUNT(*) from ${POLLDB_PREFIX}_poll where format = 'A';)
|
||||
POLLS_STANDARD=$(mysql -h "${POLLDB_HOST}" -u "${POLLDB_USER}" -p"${POLLDB_PASSWD}" "${POLLDB_NAME}" -s -r -N -e "SELECT COUNT(*) from ${POLLDB_PREFIX}poll where format = 'A';")
|
||||
|
||||
#save onto a file
|
||||
echo "polls_all ${POLLS_ALL}" > /tmp/framadate_stats
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
source /var/local/container-scripts/zabbix-scripts.cfg
|
||||
|
||||
#all files
|
||||
LUFI_ALLFILES=$(psql postgresql://${LUFIDB_USER}:${LUFIDB_PASSWD}@${LUFIDB_HOST}:${LUFIDB_PORT} -t -c "SELECT COUNT(filename) FROM files WHERE filename IS NOT NULL;")
|
||||
LUFI_DELETED=$( psql postgresql://${LUFIDB_USER}:${LUFIDB_PASSWD}@${LUFIDB_HOST}:${LUFIDB_PORT} -t -c "SELECT COUNT(filename) FROM files WHERE filename IS NOT NULL and deleted = '1';")
|
||||
LUFI_ACTIVE=$( psql postgresql://${LUFIDB_USER}:${LUFIDB_PASSWD}@${LUFIDB_HOST}:${LUFIDB_PORT} -t -c "SELECT COUNT(filename) FROM files WHERE filename IS NOT NULL and deleted = '0';")
|
||||
LUFI_SIZE=$(du -s ${LUFI_PATH} | cut -f1)
|
||||
LUFI_ALLFILES=$(psql postgresql://${LUFIDB_USER}:${LUFIDB_PASSWD}@${LUFIDB_HOST}:${LUFIDB_PORT}/${LUFIDB_NAME} -t -c "SELECT COUNT(filename) FROM files WHERE filename IS NOT NULL;")
|
||||
LUFI_DELETED=$( psql postgresql://${LUFIDB_USER}:${LUFIDB_PASSWD}@${LUFIDB_HOST}:${LUFIDB_PORT}/${LUFIDB_NAME} -t -c "SELECT COUNT(filename) FROM files WHERE filename IS NOT NULL and deleted = '1';")
|
||||
LUFI_ACTIVE=$( psql postgresql://${LUFIDB_USER}:${LUFIDB_PASSWD}@${LUFIDB_HOST}:${LUFIDB_PORT}/${LUFIDB_NAME} -t -c "SELECT COUNT(filename) FROM files WHERE filename IS NOT NULL and deleted = '0';")
|
||||
LUFI_SIZE=$(du -bs ${LUFI_PATH} | cut -f1)
|
||||
echo "lufi_allfiles ${LUFI_ALLFILES}" > /tmp/lufi_stats
|
||||
echo "lufi_deleted ${LUFI_DELETED}" >> /tmp/lufi_stats
|
||||
echo "lufi_active ${LUFI_ACTIVE}" >> /tmp/lufi_stats
|
||||
echo "lufi_size ${LUFI_SIZE}" >> /tmp/lufi_size
|
||||
echo "lufi_size ${LUFI_SIZE}" >> /tmp/lufi_stats
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ source /var/local/container-scripts/zabbix-scripts.cfg
|
|||
|
||||
#statistics
|
||||
BIN_TOTAL=$(find ${BIN_PATH} -mindepth 2 -name *.php | wc -l)
|
||||
BIN_SIZE=$(du -s ${BIN_PATH} | cut -f1)
|
||||
BIN_SIZE=$(du -bs ${BIN_PATH} | cut -f1)
|
||||
|
||||
echo "bin_total ${BIN_TOTAL}" > /tmp/bin_stats
|
||||
echo "bin_size ${BIN_SIZE}" >> /tmp/bin_stats
|
||||
|
|
|
@ -8,6 +8,7 @@ POLLDB_HOST="localhost"
|
|||
POLLDB_USER="admin"
|
||||
POLLDB_PASSWD="changeme"
|
||||
POLLDB_PREFIX="fd"
|
||||
POLLDB_NAME="framadb"
|
||||
|
||||
#Etherpad
|
||||
PADDB_HOST="localhost"
|
||||
|
|
Loading…
Reference in New Issue