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

check_netio

Blame
  • check_backup_one 1.25 KiB
    #!/bin/bash
    # ======================================================================
    #
    # WORK IN PROGRESS
    #
    # Check ONE BACKUP connection count
    #
    # requirements access to storage_helper.sh
    # ls -ld /opt/imlbackup/server/
    # drwxr-x--- 3 imlbackup imlbackup 4096 Jul 27 06:25 /opt/imlbackup/server/
    #
    # ----------------------------------------------------------------------
    # 2020-07-27  v0.x  <axel.hahn@iml.unibe.ch>
    # ======================================================================
    
    
    . `dirname $0`/inc_pluginfunctions
    
    myscript=/opt/imlbackup/server/storage_helper.sh
    
    # ----------------------------------------------------------------------
    # MAIN
    # ----------------------------------------------------------------------
    
    if [ ! -x $myscript ]; then
        ph.abort "UNKNOWN: $myscript is not available / executable."
    fi
    
    # --- read data
    tmpfile=$( mktemp )
    $myscript status > $tmpfile
    typeset -i iRunning=`cat $tmpfile | grep "STATUS" | cut -f 2 -d " "`
    typeset -i iMax=`    cat $tmpfile | grep "STATUS" | cut -f 8 -d " " | tr -d '.'`
    
    # --- status output
    ph.status "Backups running: $iRunning (max $iMax)"
    cat $tmpfile
    rm -f $tmpfile
    
    ph.perfadd "running"   "${iRunning}"   "" "" 0 $iMax
    ph.exit
    
    # ----------------------------------------------------------------------