Skip to content
Snippets Groups Projects
Select Git revision
  • cfa03133e23b8fef31e5f83ccebbba021f89e1d2
  • master default protected
  • simple-task/7248-eol-check-add-node-22
  • 6877_check_iml_deployment
4 results

check_ceph_diskfree

Blame
  • check_deployment 1.82 KiB
    #!/bin/bash
    # ======================================================================
    #
    # NAGIOS CLIENT CHECK :: check deployment
    #
    # ----------------------------------------------------------------------
    # 2023-12-14  v0.1  first lines
    # ======================================================================
    
    . $( dirname $0 )/inc_pluginfunctions
    
    export self_APPVERSION=0.1
    
    sInstalldir=/opt/imldeployment-installer
    
    # ----------------------------------------------------------------------
    # FUNCTIONS
    # ----------------------------------------------------------------------
    
    function showHelp(){
        local _self; _self=$(basename $0)
        cat <<EOF
    $( ph.showImlHelpHeader )
    
    Show status of rollouts with IML deployment client on this system.
    See https://os-docs.iml.unibe.ch/imldeployment-client/
    
    SYNTAX:
    $_self [-d DIRECTORY]
    
    OPTIONS:
        -h or --help   show this help.
        -d or --dir    set installation dir of iml deployment to find its check skript
                       default: ${sInstalldir}
    
    EXAMPLE:
    $_self -d /home/deployuser/imlbackup
                       set a custom directory und run the backup check
    
    EOF
    }
    
    # --- check param -h
    while [[ "$#" -gt 0 ]]; do case $1 in
        -h|--help)      showHelp; exit 0;;
        -d|--dir)       sInstalldir=$2; shift ;shift;;
        *) echo "ERROR: Unknown parameter: $1"; showHelp; exit 1;
    esac; done
    
    sChecker=$sInstalldir/check_deployment.sh
    
    if [ ! -x "$sChecker" ]; then
        ph.abort "$sChecker not found - maybe deployment is not installed here. Use param -d to set the install directory."
    fi
    
    result=$( $sChecker )
    rc=$?
    
    if [ $rc -eq 0 ]; then
        if echo "$result" | grep "^UNKNOWN" >/dev/null  
        then
            ph.setStatus "unknown"
        else
            ph.setStatus "ok"
        fi
    else
        ph.setStatus "critical"
    fi
    
    echo "$result"
    
    ph.exit
    
    # ----------------------------------------------------------------------