Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 33 lines (28 sloc) 0.728 kB
#!/usr/bin/env bash
# Copyright 2010-2012 Voxer IP LLC. All rights reserved.
# License: MIT
#
# Dave Eddy <dave@voxer.com>
# Payam Voxer <operations@voxer.com>
#
# Credits
# claudio k.
# check if svcs is working, thanks claudio!
services=$(svcs -H -o state,fmri 2>&1)
if (($? != 0)); then
echo 'critical: problem with SMF (maybe kill svc.startd?)'
exit 2
fi
# find the troubled processes if any exist ('disable -t' is not troubled)
services=$(egrep -v '^online|^legacy_run|^disabled' <<< "$services" | tr '\n' ';')
if [[ -n $services ]]; then
if grep -q '^maintenance' <<< "$services"; then
echo "critical: $services"
exit 2
else
echo "warning: $services"
exit 1
fi
fi
echo 'ok: all services are online'
exit 0
Jump to Line
Something went wrong with that request. Please try again.