summaryrefslogtreecommitdiff
path: root/files/plugins
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-04-06 10:44:58 +0200
committermh <mh@immerda.ch>2011-04-06 10:44:58 +0200
commit23e3ddf1daa52d46c40d540d25218195997e8524 (patch)
tree78d7ae8592b4154ecd701228fe6f128d0b507695 /files/plugins
parentf2df62c9d17d481a3d616a4f2de9496638fadc0a (diff)
try to fix nagios::plugin problem
We have a serious problem with the concept that we had up to now if you start adding more than one nagios server. This is an attempt to fix it, with certain drawbacks, such as that you have to list all the nagios plugins in the nagios modules. This will be subject of further discussion.
Diffstat (limited to 'files/plugins')
-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"