diff options
author | mh <mh@immerda.ch> | 2009-02-02 22:27:01 +0000 |
---|---|---|
committer | mh <mh@immerda.ch> | 2009-02-02 22:27:01 +0000 |
commit | 732d514f65f46f10736f300e54325f8da9fd9125 (patch) | |
tree | ac932c8c1a48a433e9e7f6566f1e20ca5b881406 /files/plugins/check_jabber_login | |
parent | 9bbdcbc8ed5e0e752949aaeb4f5bfe0f11053a1a (diff) |
added jabber commands
Diffstat (limited to 'files/plugins/check_jabber_login')
-rwxr-xr-x | files/plugins/check_jabber_login | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/files/plugins/check_jabber_login b/files/plugins/check_jabber_login new file mode 100755 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" |