From: Maros Zatko <mzatko(a)redhat.com>
---
bin/aeolus-check-services | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
create mode 100755 bin/aeolus-check-services
diff --git a/bin/aeolus-check-services b/bin/aeolus-check-services
new file mode 100755
index 0000000..8cd51e8
--- /dev/null
+++ b/bin/aeolus-check-services
@@ -0,0 +1,29 @@
+#!/usr/bin/ruby
+init_scripts=%w(aeolus-conductor condor deltacloud-core deltacloud-ec2-us-east-1
deltacloud-ec2-us-west-1 deltacloud-mock httpd imagefactory iwhd libvirtd mongod ntpd
postgresql qpidd)
+
+init_scripts.each do |script|
+ puts "\nChecking #{script} ..."
+ cmd = "/etc/init.d/#{script} status"
+ out = `#{cmd}`
+ if $?.to_i == 0
+ puts " \e[1;32mSuccess:\e[0m #{out.strip}"
+ else
+ puts " \e[1;31mFAILURE:\e[0m #{out.strip}"
+ end
+end
+
+# Other checks
+commands = [
+ {:name => 'condor_q', :command => 'condor_q'},
+ {:name => 'condor_status', :command => 'condor_status'}
+]
+commands.each do |cmd|
+ puts "\nChecking #{cmd[:name]} ..."
+ cmd = "#{cmd[:command]}"
+ out = `#{cmd}`
+ if $?.to_i == 0
+ puts " \e[1;32mSuccess:\e[0m #{out.strip}"
+ else
+ puts " \e[1;31mFAILURE:\e[0m #{out.strip}"
+ end
+end
--
1.7.6