#!/usr/bin/ruby -w =begin Simply check to see the Twist service is running. If the name of the Twist service changes from dalimServer, this script needs to be modified. **This script good for *nix systems only. =end require 'socket' twistStatus = `/sbin/service dalimServer status` if (/^not/ =~ twistStatus) puts "*Critical - The Twist service appears to be down on " + Socket.gethostbyname(Socket.gethostname).first + "." exit(2) elsif /^running/ =~ twistStatus puts "The Twist service is running on " + Socket.gethostbyname(Socket.gethostname).first + "." #puts "Status: " + twistStatus exit(0) else puts "Unable to determine the status of the Twist service on " + Socket.gethostbyname(Socket.gethostname).first + "." + twistStatus #puts "Status: " + twistStatus exit(1) end