Compare commits
No commits in common. "development" and "master" have entirely different histories.
developmen
...
master
|
@ -1,37 +0,0 @@
|
|||
name: Packaging Test
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- $default-branch
|
||||
- development
|
||||
- master
|
||||
# Run tests for any PRs
|
||||
pull_request:
|
||||
env:
|
||||
SOURCE_DIR: ./
|
||||
ARTIFACTS_DIR: debian/build/release/
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout@v4
|
||||
env:
|
||||
DEBIAN_FRONTEND: "noninteractive"
|
||||
- name: Remove github artefacts
|
||||
run: |
|
||||
rm -rf .github* .forgejo*
|
||||
- name: Adjust distibution in changelog file
|
||||
run: |
|
||||
sed -i '0,/restricted/s//stable/' debian/changelog
|
||||
- name: Install skopeo for action-debian-package
|
||||
run: |
|
||||
apt update
|
||||
apt -y install skopeo
|
||||
- name: Build Debian package
|
||||
uses: https://github.com/dawidd6/action-debian-package@v1.5.0
|
||||
with:
|
||||
artifacts_directory: debian/build/release/
|
||||
- name: Debug
|
||||
run: |
|
||||
ls -la
|
7
.github/workflows/packaging_test.yml
vendored
7
.github/workflows/packaging_test.yml
vendored
|
@ -17,20 +17,19 @@ jobs:
|
|||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
env:
|
||||
DEBIAN_FRONTEND: "noninteractive"
|
||||
- name: Remove github artefacts
|
||||
run: |
|
||||
rm -rf .github*
|
||||
rm -rf .git*
|
||||
- name: Adjust distibution in changelog file
|
||||
run: |
|
||||
sed -i '0,/restricted/s//stable/' debian/changelog
|
||||
- name: Build Debian package
|
||||
uses: dawidd6/action-debian-package@v1.5.0
|
||||
uses: dawidd6/action-debian-package@v1.4.0
|
||||
with:
|
||||
artifacts_directory: debian/build/release/
|
||||
os_distribution: testing
|
||||
- name: Debug
|
||||
run: |
|
||||
ls -la
|
||||
|
|
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
|
@ -18,7 +18,7 @@ jobs:
|
|||
release-id: ${{ steps.create_release.outputs.id }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
- name: Install needed packages
|
||||
run: |
|
||||
if [ $(dpkg -l | grep -c dpkg-dev) -ne 1 ]; then sudo apt-get update && sudo apt-get install -y dpkg-dev; fi
|
||||
|
@ -43,20 +43,19 @@ jobs:
|
|||
needs: create-release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
env:
|
||||
DEBIAN_FRONTEND: "noninteractive"
|
||||
- name: Remove github artefacts
|
||||
run: |
|
||||
rm -rf .github*
|
||||
rm -rf .git*
|
||||
- name: Adjust distibution in changelog file
|
||||
run: |
|
||||
sed -i '0,/restricted/s//stable/' debian/changelog
|
||||
- name: Build Debian package
|
||||
uses: dawidd6/action-debian-package@v1.5.0
|
||||
uses: dawidd6/action-debian-package@v1.4.0
|
||||
with:
|
||||
artifacts_directory: debian/build/release/
|
||||
os_distribution: testing
|
||||
# - name: Build Debian package
|
||||
# uses: pi-top/action-debian-package@v0.2.0
|
||||
# with:
|
||||
|
|
|
@ -81,7 +81,7 @@ while [ "$1" != "" ]; do
|
|||
done
|
||||
|
||||
# Config and commands
|
||||
STAT_FILE='/var/run/keepalived.status'
|
||||
STAT_FILE='/tmp/keepalived.status'
|
||||
PID_FILE='/run/keepalived.pid'
|
||||
PID=$("${CAT}" "${PID_FILE}" 2>/dev/null)
|
||||
SERVICE=$("${PG}" keepalived)
|
||||
|
@ -92,13 +92,8 @@ CHECK_HAIP2=$("${IP}" 2>/dev/null addr sh "${IFACE2}" | "${GREP}" "${HAIP2}" | "
|
|||
# Check files are valid
|
||||
if [ ! -e "${STAT_FILE}" ]
|
||||
then
|
||||
if [ -e /tmp/keepalived.status ]
|
||||
then
|
||||
STAT_FILE='/tmp/keepalived.status'
|
||||
else
|
||||
echo "CRITICAL: Generated status file is missing. State could not be determined."
|
||||
exit "${CRITICAL}"
|
||||
fi
|
||||
echo "CRITICAL: Generated status file is missing. State could not be determined."
|
||||
exit "${CRITICAL}"
|
||||
fi
|
||||
|
||||
FILE_CONT=$("${CAT}" "${STAT_FILE}" 2>/dev/null)
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
############################# finetuning by vitamin.b@mailbox.org
|
||||
############################# with code by Tom Lesniak and Hugo Geijteman
|
||||
############################# with code by Carsten Koebke
|
||||
############################# with code by sgruber
|
||||
#
|
||||
# copyright (c) 2008 Shahid Iqbal
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
@ -357,7 +356,7 @@ elif [ "$strPart" == "diskused" ]; then
|
|||
|
||||
if [ $perc -ge $strCritical ]; then
|
||||
echo "CRITICAL: $OUTPUT"
|
||||
exit $EXIT_CRITICAL
|
||||
exit $EXIT_CRITICAL
|
||||
elif [ $perc -ge $strWarning ]; then
|
||||
echo "WARNING: $OUTPUT"
|
||||
exit $EXIT_WARNING
|
||||
|
@ -597,7 +596,6 @@ elif [ "$strPart" == "lunstatus" ]; then
|
|||
PERFOUTPUT=""
|
||||
WARNING=0
|
||||
CRITICAL=0
|
||||
lunDISABLEDCOUNT=0
|
||||
lun=1
|
||||
lunCOUNT="$(_snmpwalk .1.3.6.1.4.1.24681.1.4.1.1.2.1.10.2.1.2 | wc -l)"
|
||||
|
||||
|
@ -611,7 +609,6 @@ elif [ "$strPart" == "lunstatus" ]; then
|
|||
lunSTAT="OK($lun_Status)"
|
||||
else
|
||||
lunSTAT="CRITICAL($lun_Status)"
|
||||
lunDISABLEDCOUNT=$((lunDISABLEDCOUNT+1))
|
||||
CRITICAL=1
|
||||
fi
|
||||
|
||||
|
@ -649,10 +646,7 @@ elif [ "$strPart" == "lunstatus" ]; then
|
|||
done
|
||||
|
||||
if [ -z "$ALLOUTPUT" ]; then
|
||||
ALLOUTPUT="OK: All $lunCOUNT luns are fine."
|
||||
if [ $lunDISABLEDCOUNT -ne 0 ]; then
|
||||
ALLOUTPUT="CRITICAL: $lunDISABLEDCOUNT of $lunCOUNT luns are disabled."
|
||||
fi
|
||||
ALLOUTPUT="OK: All luns are fine."
|
||||
fi
|
||||
echo "$ALLOUTPUT| $PERFOUTPUT"
|
||||
|
||||
|
@ -678,68 +672,68 @@ elif [ "$strPart" == "volstatus" ]; then
|
|||
|
||||
while [ "$VOL" -le "$VOLCOUNT" ]; do
|
||||
Vol_Status="$(_snmpgetval ".1.3.6.1.4.1.24681.1.2.17.1.6.$VOL" | sed 's/^"\(.*\).$/\1/')"
|
||||
if [ "$Vol_Status" != "No Such Instance currently exists at this OID" ]; then
|
||||
if [ "$Vol_Status" == "Ready" ]; then
|
||||
VOLSTAT="OK: $Vol_Status"
|
||||
elif [ "$Vol_Status" == "Rebuilding..." ]; then
|
||||
VOLSTAT="WARNING: $Vol_Status"
|
||||
WARNING=1
|
||||
else
|
||||
VOLSTAT="CRITICAL: $Vol_Status"
|
||||
CRITICAL=1
|
||||
fi
|
||||
|
||||
volCpctStr="$(_snmpget ".1.3.6.1.4.1.24681.1.2.17.1.4.$VOL")"
|
||||
volFreeStr="$(_snmpget ".1.3.6.1.4.1.24681.1.2.17.1.5.$VOL")"
|
||||
|
||||
volCpctSize="$(echo "$volCpctStr" | awk '{print $4}' | sed 's/.\(.*\)/\1/')"
|
||||
volFreeSize="$(echo "$volFreeStr" | awk '{print $4}' | sed 's/.\(.*\)/\1/')"
|
||||
volCpctUnit="$(echo "$volCpctStr" | awk '{print $5}' | sed 's/.*\(.B\).*/\1/')"
|
||||
volFreeUnit="$(echo "$volFreeStr" | awk '{print $5}' | sed 's/.*\(.B\).*/\1/')"
|
||||
|
||||
volCpctExp="$(_get_exp "$volCpctUnit")"
|
||||
volFreeExp="$(_get_exp "$volFreeUnit")"
|
||||
|
||||
volCpct="$(echo "scale=0; $volCpctSize*(2^$volCpctExp)" | bc -l)"
|
||||
volFree="$(echo "scale=0; $volFreeSize*(2^$volFreeExp)" | bc -l)"
|
||||
volUsed="$(echo "scale=0; $volCpct-$volFree" | bc -l)"
|
||||
|
||||
volFreePct="$(echo "scale=0; $volFree*100/$volCpct" | bc -l)"
|
||||
volUsedPct="$(echo "scale=0; $volUsed*100/$volCpct" | bc -l)"
|
||||
|
||||
volCpctH="$(echo "scale=2; $volCpct/(2^$volCpctExp)" | bc -l)"
|
||||
volFreeH="$(echo "scale=2; $volFree/(2^$volFreeExp)" | bc -l)"
|
||||
volUsedH="$(echo "scale=2; $volUsed/(2^$volFreeExp)" | bc -l)"
|
||||
|
||||
if [ "${inhuman:-0}" -eq 1 ]; then
|
||||
volCpctF="$volCpct"
|
||||
volFreeF="$volFree"
|
||||
volUsedF="$volUsed"
|
||||
else
|
||||
volCpctF="$volCpctH $volCpctUnit"
|
||||
volFreeF="$volFreeH $volFreeUnit"
|
||||
volUsedF="$volUsedH $volFreeUnit"
|
||||
fi
|
||||
|
||||
if [ "$volFreePct" -le "$strCritical" ]; then
|
||||
volFreePct="CRITICAL: $volFreePct"
|
||||
CRITICAL=1
|
||||
elif [ "$volFreePct" -le "$strWarning" ]; then
|
||||
volFreePct="WARNING: $volFreePct"
|
||||
WARNING=1
|
||||
fi
|
||||
|
||||
ALLOUTPUT="${ALLOUTPUT}Volume #$VOL: $VOLSTAT, Total Size (bytes): $volCpctF, Free: $volFreeF (${volFreePct}%)"
|
||||
if [ "$VOL" -lt "$VOLCOUNT" ]; then
|
||||
ALLOUTPUT="${ALLOUTPUT}, "
|
||||
fi
|
||||
|
||||
#Performance Data
|
||||
if [ $VOL -gt 1 ]; then
|
||||
PERFOUTPUT="$PERFOUTPUT "
|
||||
fi
|
||||
PERFOUTPUT="${PERFOUTPUT}FreeSize_Volume-$VOL=${volFreePct}%;$strWarning;$strCritical;0;100"
|
||||
if [ "$Vol_Status" == "Ready" ]; then
|
||||
VOLSTAT="OK: $Vol_Status"
|
||||
elif [ "$Vol_Status" == "Rebuilding..." ]; then
|
||||
VOLSTAT="WARNING: $Vol_Status"
|
||||
WARNING=1
|
||||
else
|
||||
VOLSTAT="CRITICAL: $Vol_Status"
|
||||
CRITICAL=1
|
||||
fi
|
||||
|
||||
volCpctStr="$(_snmpget ".1.3.6.1.4.1.24681.1.2.17.1.4.$VOL")"
|
||||
volFreeStr="$(_snmpget ".1.3.6.1.4.1.24681.1.2.17.1.5.$VOL")"
|
||||
|
||||
volCpctSize="$(echo "$volCpctStr" | awk '{print $4}' | sed 's/.\(.*\)/\1/')"
|
||||
volFreeSize="$(echo "$volFreeStr" | awk '{print $4}' | sed 's/.\(.*\)/\1/')"
|
||||
volCpctUnit="$(echo "$volCpctStr" | awk '{print $5}' | sed 's/.*\(.B\).*/\1/')"
|
||||
volFreeUnit="$(echo "$volFreeStr" | awk '{print $5}' | sed 's/.*\(.B\).*/\1/')"
|
||||
|
||||
volCpctExp="$(_get_exp "$volCpctUnit")"
|
||||
volFreeExp="$(_get_exp "$volFreeUnit")"
|
||||
|
||||
volCpct="$(echo "scale=0; $volCpctSize*(2^$volCpctExp)" | bc -l)"
|
||||
volFree="$(echo "scale=0; $volFreeSize*(2^$volFreeExp)" | bc -l)"
|
||||
volUsed="$(echo "scale=0; $volCpct-$volFree" | bc -l)"
|
||||
|
||||
volFreePct="$(echo "scale=0; $volFree*100/$volCpct" | bc -l)"
|
||||
volUsedPct="$(echo "scale=0; $volUsed*100/$volCpct" | bc -l)"
|
||||
|
||||
volCpctH="$(echo "scale=2; $volCpct/(2^$volCpctExp)" | bc -l)"
|
||||
volFreeH="$(echo "scale=2; $volFree/(2^$volFreeExp)" | bc -l)"
|
||||
volUsedH="$(echo "scale=2; $volUsed/(2^$volFreeExp)" | bc -l)"
|
||||
|
||||
if [ "${inhuman:-0}" -eq 1 ]; then
|
||||
volCpctF="$volCpct"
|
||||
volFreeF="$volFree"
|
||||
volUsedF="$volUsed"
|
||||
else
|
||||
volCpctF="$volCpctH $volCpctUnit"
|
||||
volFreeF="$volFreeH $volFreeUnit"
|
||||
volUsedF="$volUsedH $volFreeUnit"
|
||||
fi
|
||||
|
||||
if [ "$volFreePct" -le "$strCritical" ]; then
|
||||
volFreePct="CRITICAL: $volFreePct"
|
||||
CRITICAL=1
|
||||
elif [ "$volFreePct" -le "$strWarning" ]; then
|
||||
volFreePct="WARNING: $volFreePct"
|
||||
WARNING=1
|
||||
fi
|
||||
|
||||
ALLOUTPUT="${ALLOUTPUT}Volume #$VOL: $VOLSTAT, Total Size (bytes): $volCpctF, Free: $volFreeF (${volFreePct}%)"
|
||||
if [ "$VOL" -lt "$VOLCOUNT" ]; then
|
||||
ALLOUTPUT="${ALLOUTPUT}, "
|
||||
fi
|
||||
|
||||
#Performance Data
|
||||
if [ $VOL -gt 1 ]; then
|
||||
PERFOUTPUT="$PERFOUTPUT "
|
||||
fi
|
||||
PERFOUTPUT="${PERFOUTPUT}FreeSize_Volume-$VOL=${volFreePct}%;$strWarning;$strCritical;0;100"
|
||||
|
||||
VOL="`expr $VOL + 1`"
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in a new issue