[Localcheck] SimpleSAMLPhp version checker

Just a little Localcheck i developed, as i like to keep versions in check for specific applications and such.

This time i have created a localcheck for monitoring SimpleSAMLPhp’s installed version compared to the latest released version.

What it does:

  • Validates prerequisites needed by the check on the host (it uses jq and curl)
  • Queries locally installed version by extracting the version string from composer.json
  • Queries latest release-version from GitHub via curl and jq, meaning the host requires Internet-access.
  • Shows the result of the comparison as a service in CheckMK.

As i tend to tweak/refine these Localchecks over time i will not post a/the code here, but rather a link to my repository, where you will always find the latest version.

Link : simplesaml_version_check.sh

  • Glowsome
# Check if jq package is present on the system (required for this check)
if ! command -v jq >/dev/null 2>&1; then
    echo "2 \"$SERVICE\" - $SERVICE localcheck requires jq package to be installed"
    exit 0
fi

# Check if curl package is present on the system (required for this check)
if ! command -v curl >/dev/null 2>&1; then
    echo "2 \"$SERVICE\" - $SERVICE localcheck requires curl package to be installed"
    exit 0
fi

We recommend to use 3 (UNKNOWN) when the state of a service cannot be determined.

Recommendation implemented, v0.2 is now available.

  • Glowsome

PS, i’ll have to revisit my other localchecks to also reflect this recommendation.