Compare commits

...

15 commits

Author SHA1 Message Date
Jan Wagner 251a595783 Adding forgejo CI
Some checks failed
Packaging Test / test (push) Failing after 3m35s
2024-01-03 19:53:59 +01:00
Jan Wagner dbfda08dc3 Merge branch 'development' of github.com:waja/monitoring-plugins-cyconet into development 2023-09-05 13:40:09 +02:00
waja fd71cd0131
Merge pull request #43 from waja/dependabot-github_actions-actions-checkout-4
build(deps): bump actions/checkout from 3 to 4
2023-09-05 09:07:07 +02:00
dependabot[bot] ab57752385
build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 04:14:44 +00:00
ssieber d27b9f4204 check_keepalived: Add 2nd stat file location 2023-05-04 08:23:34 +00:00
dependabot[bot] bc49084211 build(deps): bump dawidd6/action-debian-package from 1.4.2 to 1.4.4
Bumps [dawidd6/action-debian-package](https://github.com/dawidd6/action-debian-package) from 1.4.2 to 1.4.4.
- [Release notes](https://github.com/dawidd6/action-debian-package/releases)
- [Commits](https://github.com/dawidd6/action-debian-package/compare/v1.4.2...v1.4.4)

---
updated-dependencies:
- dependency-name: dawidd6/action-debian-package
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-04 08:23:02 +00:00
dependabot[bot] 269c6a9f04 build(deps): bump dawidd6/action-debian-package from 1.4.0 to 1.4.2
Bumps [dawidd6/action-debian-package](https://github.com/dawidd6/action-debian-package) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/dawidd6/action-debian-package/releases)
- [Commits](https://github.com/dawidd6/action-debian-package/compare/v1.4.0...v1.4.2)

---
updated-dependencies:
- dependency-name: dawidd6/action-debian-package
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-04 08:23:02 +00:00
waja 6fe739ced9
Merge pull request #42 from waja/dependabot-github_actions-dawidd6-action-debian-package-1.5.0 2023-03-07 06:07:17 +01:00
dependabot[bot] 9a8a43b5c6
build(deps): bump dawidd6/action-debian-package from 1.4.4 to 1.5.0
Bumps [dawidd6/action-debian-package](https://github.com/dawidd6/action-debian-package) from 1.4.4 to 1.5.0.
- [Release notes](https://github.com/dawidd6/action-debian-package/releases)
- [Commits](https://github.com/dawidd6/action-debian-package/compare/v1.4.4...v1.5.0)

---
updated-dependencies:
- dependency-name: dawidd6/action-debian-package
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-07 05:00:23 +00:00
Jan Wagner f9ed6fdc3d check_qnap_health: Update to latest version 2022-12-01 16:09:55 +00:00
waja 77e702f856
Merge pull request #41 from waja/dependabot-github_actions-dawidd6-action-debian-package-1.4.4
build(deps): bump dawidd6/action-debian-package from 1.4.2 to 1.4.4
2022-11-09 07:40:16 +01:00
dependabot[bot] 98f3635b9e
build(deps): bump dawidd6/action-debian-package from 1.4.2 to 1.4.4
Bumps [dawidd6/action-debian-package](https://github.com/dawidd6/action-debian-package) from 1.4.2 to 1.4.4.
- [Release notes](https://github.com/dawidd6/action-debian-package/releases)
- [Commits](https://github.com/dawidd6/action-debian-package/compare/v1.4.2...v1.4.4)

---
updated-dependencies:
- dependency-name: dawidd6/action-debian-package
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-09 04:04:12 +00:00
waja 2438c22d4c
Merge pull request #40 from waja/dependabot-github_actions-dawidd6-action-debian-package-1.4.2
build(deps): bump dawidd6/action-debian-package from 1.4.0 to 1.4.2
2022-10-28 06:37:42 +02:00
dependabot[bot] cfd4901b3c
build(deps): bump dawidd6/action-debian-package from 1.4.0 to 1.4.2
Bumps [dawidd6/action-debian-package](https://github.com/dawidd6/action-debian-package) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/dawidd6/action-debian-package/releases)
- [Commits](https://github.com/dawidd6/action-debian-package/compare/v1.4.0...v1.4.2)

---
updated-dependencies:
- dependency-name: dawidd6/action-debian-package
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-28 04:12:58 +00:00
Jan Wagner 685fadac6c Updating build pipelines 2022-10-20 13:06:19 +02:00
5 changed files with 122 additions and 72 deletions

View 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

View file

@ -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

View file

@ -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:

View file

@ -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,8 +92,13 @@ 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
echo "CRITICAL: Generated status file is missing. State could not be determined." if [ -e /tmp/keepalived.status ]
exit "${CRITICAL}" then
STAT_FILE='/tmp/keepalived.status'
else
echo "CRITICAL: Generated status file is missing. State could not be determined."
exit "${CRITICAL}"
fi
fi fi
FILE_CONT=$("${CAT}" "${STAT_FILE}" 2>/dev/null) FILE_CONT=$("${CAT}" "${STAT_FILE}" 2>/dev/null)

View file

@ -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
@ -356,7 +357,7 @@ elif [ "$strPart" == "diskused" ]; then
if [ $perc -ge $strCritical ]; then if [ $perc -ge $strCritical ]; then
echo "CRITICAL: $OUTPUT" echo "CRITICAL: $OUTPUT"
exit $EXIT_CRITICAL exit $EXIT_CRITICAL
elif [ $perc -ge $strWarning ]; then elif [ $perc -ge $strWarning ]; then
echo "WARNING: $OUTPUT" echo "WARNING: $OUTPUT"
exit $EXIT_WARNING exit $EXIT_WARNING
@ -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,68 +678,68 @@ 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
VOLSTAT="OK: $Vol_Status"
elif [ "$Vol_Status" == "Rebuilding..." ]; then
VOLSTAT="WARNING: $Vol_Status"
WARNING=1
else
VOLSTAT="CRITICAL: $Vol_Status"
CRITICAL=1
fi
if [ "$Vol_Status" == "Ready" ]; then volCpctStr="$(_snmpget ".1.3.6.1.4.1.24681.1.2.17.1.4.$VOL")"
VOLSTAT="OK: $Vol_Status" volFreeStr="$(_snmpget ".1.3.6.1.4.1.24681.1.2.17.1.5.$VOL")"
elif [ "$Vol_Status" == "Rebuilding..." ]; then
VOLSTAT="WARNING: $Vol_Status" volCpctSize="$(echo "$volCpctStr" | awk '{print $4}' | sed 's/.\(.*\)/\1/')"
WARNING=1 volFreeSize="$(echo "$volFreeStr" | awk '{print $4}' | sed 's/.\(.*\)/\1/')"
else volCpctUnit="$(echo "$volCpctStr" | awk '{print $5}' | sed 's/.*\(.B\).*/\1/')"
VOLSTAT="CRITICAL: $Vol_Status" volFreeUnit="$(echo "$volFreeStr" | awk '{print $5}' | sed 's/.*\(.B\).*/\1/')"
CRITICAL=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"
fi 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`" VOL="`expr $VOL + 1`"
done done