Compare commits
15 commits
master
...
developmen
Author | SHA1 | Date | |
---|---|---|---|
Jan Wagner | 251a595783 | ||
Jan Wagner | dbfda08dc3 | ||
fd71cd0131 | |||
ab57752385 | |||
d27b9f4204 | |||
bc49084211 | |||
269c6a9f04 | |||
6fe739ced9 | |||
9a8a43b5c6 | |||
Jan Wagner | f9ed6fdc3d | ||
77e702f856 | |||
98f3635b9e | |||
2438c22d4c | |||
cfd4901b3c | |||
Jan Wagner | 685fadac6c |
37
.forgejo/workflows/packaging_test.yml
Normal file
37
.forgejo/workflows/packaging_test.yml
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
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,19 +17,20 @@ jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
env:
|
env:
|
||||||
DEBIAN_FRONTEND: "noninteractive"
|
DEBIAN_FRONTEND: "noninteractive"
|
||||||
- name: Remove github artefacts
|
- name: Remove github artefacts
|
||||||
run: |
|
run: |
|
||||||
rm -rf .git*
|
rm -rf .github*
|
||||||
- name: Adjust distibution in changelog file
|
- name: Adjust distibution in changelog file
|
||||||
run: |
|
run: |
|
||||||
sed -i '0,/restricted/s//stable/' debian/changelog
|
sed -i '0,/restricted/s//stable/' debian/changelog
|
||||||
- name: Build Debian package
|
- name: Build Debian package
|
||||||
uses: dawidd6/action-debian-package@v1.4.0
|
uses: dawidd6/action-debian-package@v1.5.0
|
||||||
with:
|
with:
|
||||||
artifacts_directory: debian/build/release/
|
artifacts_directory: debian/build/release/
|
||||||
|
os_distribution: testing
|
||||||
- name: Debug
|
- name: Debug
|
||||||
run: |
|
run: |
|
||||||
ls -la
|
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 }}
|
release-id: ${{ steps.create_release.outputs.id }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Install needed packages
|
- name: Install needed packages
|
||||||
run: |
|
run: |
|
||||||
if [ $(dpkg -l | grep -c dpkg-dev) -ne 1 ]; then sudo apt-get update && sudo apt-get install -y dpkg-dev; fi
|
if [ $(dpkg -l | grep -c dpkg-dev) -ne 1 ]; then sudo apt-get update && sudo apt-get install -y dpkg-dev; fi
|
||||||
|
@ -43,19 +43,20 @@ jobs:
|
||||||
needs: create-release
|
needs: create-release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
env:
|
env:
|
||||||
DEBIAN_FRONTEND: "noninteractive"
|
DEBIAN_FRONTEND: "noninteractive"
|
||||||
- name: Remove github artefacts
|
- name: Remove github artefacts
|
||||||
run: |
|
run: |
|
||||||
rm -rf .git*
|
rm -rf .github*
|
||||||
- name: Adjust distibution in changelog file
|
- name: Adjust distibution in changelog file
|
||||||
run: |
|
run: |
|
||||||
sed -i '0,/restricted/s//stable/' debian/changelog
|
sed -i '0,/restricted/s//stable/' debian/changelog
|
||||||
- name: Build Debian package
|
- name: Build Debian package
|
||||||
uses: dawidd6/action-debian-package@v1.4.0
|
uses: dawidd6/action-debian-package@v1.5.0
|
||||||
with:
|
with:
|
||||||
artifacts_directory: debian/build/release/
|
artifacts_directory: debian/build/release/
|
||||||
|
os_distribution: testing
|
||||||
# - name: Build Debian package
|
# - name: Build Debian package
|
||||||
# uses: pi-top/action-debian-package@v0.2.0
|
# uses: pi-top/action-debian-package@v0.2.0
|
||||||
# with:
|
# with:
|
||||||
|
|
|
@ -81,7 +81,7 @@ while [ "$1" != "" ]; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Config and commands
|
# Config and commands
|
||||||
STAT_FILE='/tmp/keepalived.status'
|
STAT_FILE='/var/run/keepalived.status'
|
||||||
PID_FILE='/run/keepalived.pid'
|
PID_FILE='/run/keepalived.pid'
|
||||||
PID=$("${CAT}" "${PID_FILE}" 2>/dev/null)
|
PID=$("${CAT}" "${PID_FILE}" 2>/dev/null)
|
||||||
SERVICE=$("${PG}" keepalived)
|
SERVICE=$("${PG}" keepalived)
|
||||||
|
@ -92,9 +92,14 @@ CHECK_HAIP2=$("${IP}" 2>/dev/null addr sh "${IFACE2}" | "${GREP}" "${HAIP2}" | "
|
||||||
# Check files are valid
|
# Check files are valid
|
||||||
if [ ! -e "${STAT_FILE}" ]
|
if [ ! -e "${STAT_FILE}" ]
|
||||||
then
|
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."
|
echo "CRITICAL: Generated status file is missing. State could not be determined."
|
||||||
exit "${CRITICAL}"
|
exit "${CRITICAL}"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
FILE_CONT=$("${CAT}" "${STAT_FILE}" 2>/dev/null)
|
FILE_CONT=$("${CAT}" "${STAT_FILE}" 2>/dev/null)
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
############################# finetuning by vitamin.b@mailbox.org
|
############################# finetuning by vitamin.b@mailbox.org
|
||||||
############################# with code by Tom Lesniak and Hugo Geijteman
|
############################# with code by Tom Lesniak and Hugo Geijteman
|
||||||
############################# with code by Carsten Koebke
|
############################# with code by Carsten Koebke
|
||||||
|
############################# with code by sgruber
|
||||||
#
|
#
|
||||||
# copyright (c) 2008 Shahid Iqbal
|
# copyright (c) 2008 Shahid Iqbal
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
@ -596,6 +597,7 @@ elif [ "$strPart" == "lunstatus" ]; then
|
||||||
PERFOUTPUT=""
|
PERFOUTPUT=""
|
||||||
WARNING=0
|
WARNING=0
|
||||||
CRITICAL=0
|
CRITICAL=0
|
||||||
|
lunDISABLEDCOUNT=0
|
||||||
lun=1
|
lun=1
|
||||||
lunCOUNT="$(_snmpwalk .1.3.6.1.4.1.24681.1.4.1.1.2.1.10.2.1.2 | wc -l)"
|
lunCOUNT="$(_snmpwalk .1.3.6.1.4.1.24681.1.4.1.1.2.1.10.2.1.2 | wc -l)"
|
||||||
|
|
||||||
|
@ -609,6 +611,7 @@ elif [ "$strPart" == "lunstatus" ]; then
|
||||||
lunSTAT="OK($lun_Status)"
|
lunSTAT="OK($lun_Status)"
|
||||||
else
|
else
|
||||||
lunSTAT="CRITICAL($lun_Status)"
|
lunSTAT="CRITICAL($lun_Status)"
|
||||||
|
lunDISABLEDCOUNT=$((lunDISABLEDCOUNT+1))
|
||||||
CRITICAL=1
|
CRITICAL=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -646,7 +649,10 @@ elif [ "$strPart" == "lunstatus" ]; then
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -z "$ALLOUTPUT" ]; then
|
if [ -z "$ALLOUTPUT" ]; then
|
||||||
ALLOUTPUT="OK: All luns are fine."
|
ALLOUTPUT="OK: All $lunCOUNT luns are fine."
|
||||||
|
if [ $lunDISABLEDCOUNT -ne 0 ]; then
|
||||||
|
ALLOUTPUT="CRITICAL: $lunDISABLEDCOUNT of $lunCOUNT luns are disabled."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
echo "$ALLOUTPUT| $PERFOUTPUT"
|
echo "$ALLOUTPUT| $PERFOUTPUT"
|
||||||
|
|
||||||
|
@ -672,7 +678,7 @@ elif [ "$strPart" == "volstatus" ]; then
|
||||||
|
|
||||||
while [ "$VOL" -le "$VOLCOUNT" ]; do
|
while [ "$VOL" -le "$VOLCOUNT" ]; do
|
||||||
Vol_Status="$(_snmpgetval ".1.3.6.1.4.1.24681.1.2.17.1.6.$VOL" | sed 's/^"\(.*\).$/\1/')"
|
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
|
if [ "$Vol_Status" == "Ready" ]; then
|
||||||
VOLSTAT="OK: $Vol_Status"
|
VOLSTAT="OK: $Vol_Status"
|
||||||
elif [ "$Vol_Status" == "Rebuilding..." ]; then
|
elif [ "$Vol_Status" == "Rebuilding..." ]; then
|
||||||
|
@ -733,7 +739,7 @@ elif [ "$strPart" == "volstatus" ]; then
|
||||||
PERFOUTPUT="$PERFOUTPUT "
|
PERFOUTPUT="$PERFOUTPUT "
|
||||||
fi
|
fi
|
||||||
PERFOUTPUT="${PERFOUTPUT}FreeSize_Volume-$VOL=${volFreePct}%;$strWarning;$strCritical;0;100"
|
PERFOUTPUT="${PERFOUTPUT}FreeSize_Volume-$VOL=${volFreePct}%;$strWarning;$strCritical;0;100"
|
||||||
|
fi
|
||||||
VOL="`expr $VOL + 1`"
|
VOL="`expr $VOL + 1`"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue