Comments - MariaDB Columnstore Health & Performance

6 years, 11 months ago David Thompson
This comment has the status of 'removed' and can only be seen by you.

Ok, so this shell script adheres to the nagios plugin spec. This likely could be more efficient, robust, etc but has the basics to get you going. If you make something better let us know and we can include it in the source.

  1. !/bin/bash MCS_DIR="/usr/local/mariadb/columnstore"
  1. capture getSystemStatus and remove first 9 lines and
  2. blank lines to just have status table contents STATUS=$($MCS_DIR/bin/mcsadmin getSystemStatus | tail -n +9 | sed '/^$/d' )
  3. grab system status line SYSTEM_STATUS=$(echo "$STATUS" | grep 'System' | awk '{ printf $2; }')
  4. combine module status lines MODULE_STATUS=$(echo "$STATUS" | grep 'Module' | awk '{ printf $2 ":" $3 " "; }')
  1. if system status is ACTIVE, then all good otherwise consider critical failure if [ "$SYSTEM_STATUS" == "ACTIVE" ] then echo "OK - system: $SYSTEM_STATUS, modules: $MODULE_STATUS" exit 0 else echo "CRITICAL - system: $SYSTEM_STATUS, modules: $MODULE_STATUS" exit 2 fi
 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.