#!/bin/bash

rand=$RANDOM
if [ $rand -gt 10000 ]; then
  echo "Ok: random number generated was high enough ($rand)"
  exit 0
else
  if [ $rand -gt 1000 ]; then
    echo Warning: random number generated was $rand
    exit 1
  else
    echo Critical: random number generated was $rand
    exit 2
  fi
fi

echo Unknown: How did I get here?
exit 3 # or higher

#!/bin/bash

rand=$RANDOM
if [ $rand -gt 22000 ]; then
  echo "Ok: random number generated was high enough ($rand)"
  exit 0
else
  if [ $rand -gt 11000 ]; then
    echo Warning: random number generated was $rand
    exit 1
  else
    echo Critical: random number generated was $rand
    exit 2
  fi
fi

echo Unknown: How did I get here?
exit 3 # or higher

Make chances of getting ok, warn, crit about the same
Make chances of getting ok, warn, crit about the same
