summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorLeap devs <sysdev@leap.se>2012-09-19 16:29:34 +0000
committerLeap devs <sysdev@leap.se>2012-09-19 16:29:34 +0000
commiteafb4c73ee82915bf83eac01bb26265c531a68e2 (patch)
treecc43c64a64eed30c601a1aaa04e0521beca43a75 /files
parent66257f3c425fea5fcea2acb999854aae5e7cf9f1 (diff)
parent41fe95b36253826b8f801ee1669acdb28c70076c (diff)
Merge branch 'immerda'
Conflicts: manifests/apache.pp manifests/irc_bot.pp manifests/service/mysql.pp templates/irc_bot/nsa.cfg.erb Conflict resolutions: apache.pp: just cosmetics mysql.pp: The shared modules provides more variables to fine tune the mysql health check so we went for this version. The irc bot conflicts were a result of immerda's branch not being up-to-date with the shared branch. The shared branch had factored out the irc_bot.pp into a directory, and added a few additional variables. Immerda changed the variables from having the prefix $nagios_ to not having it and did not have that refactor. The variable renames were good ones for the 2.7 refactoring work, and future hiera integration, so we want those. So to resolve this, we took the shared version of the refactor, and then took the immerda version of the variable renames. This requires an UPGRADE NOTICE in the README as people may have been using the previous variable names.
Diffstat (limited to 'files')
-rw-r--r--files/plugins/check_jabber_login30
1 files changed, 30 insertions, 0 deletions
diff --git a/files/plugins/check_jabber_login b/files/plugins/check_jabber_login
new file mode 100644
index 0000000..dac0e1f
--- /dev/null
+++ b/files/plugins/check_jabber_login
@@ -0,0 +1,30 @@
+#!/usr/bin/env ruby
+require 'rubygems'
+require 'xmpp4r'
+
+
+def usage
+ puts "#{$0} jabberid password"
+ exit 3
+end
+
+usage unless ARGV.size == 2
+
+begin
+ my_client = Jabber::Client.new(ARGV[0])
+ my_client.connect
+ my_client.auth(ARGV[1])
+rescue Jabber::ClientAuthenticationFailure => detail
+ puts "CRITICAL: Login Error"
+ exit 2
+rescue Errno::ECONNREFUSED => detail
+ puts "CRITICAL: Connection refused"
+ exit 2
+rescue SocketError => detail
+ puts "CRITICAL: Socket Error"
+ exit 2
+#rescue
+# puts "CRITICAL: Unknown Error"
+# exit 2
+end
+puts "OK: Login for #{ARGV[0]} successfull"