Monitor

    Example of script

    #!/bin/bash
    
    HOST="myhost"
    API_KEY="myapikey"
    
    service="$1"
    status="$2"
    info="$3"
    next_expected="$4"
    
    if [ -z "${service}" ]
    then
      echo "service parameter is missing"
      exit 1
    fi
    
    if [ -z "${status}" ]
    then
      echo "status parameter is missing"
      exit 1
    fi
    
    if [ -z "${next_expected}" ]
    then
      next_expected='in 26 hours'
    fi
    
    curl -k --connect-timeout 60 --max-time 60 -H "x-api-key: ${API_KEY}" https://monitoring.url/info/${HOST}/${service} -X POST -d "info=${info}&status=${status}&next_expected=${next_expected}" >/dev/null 2>&1
    

    Note:

    • replace url
    • specify HOST
    • specify API_KEy