From a86a9bbaa31c0859abf0b7f8c49f58b0a68ad134 Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 9 Jun 2016 17:32:59 +0200 Subject: git subrepo clone https://leap.se/git/puppet_nagios puppet/modules/nagios subrepo: subdir: "puppet/modules/nagios" merged: "e6fee3c" upstream: origin: "https://leap.se/git/puppet_nagios" branch: "master" commit: "e6fee3c" git-subrepo: version: "0.3.0" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "cb2995b" --- .../nagios/files/plugins/check_jabber_login | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 puppet/modules/nagios/files/plugins/check_jabber_login (limited to 'puppet/modules/nagios/files/plugins/check_jabber_login') diff --git a/puppet/modules/nagios/files/plugins/check_jabber_login b/puppet/modules/nagios/files/plugins/check_jabber_login new file mode 100644 index 00000000..dac0e1fe --- /dev/null +++ b/puppet/modules/nagios/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" -- cgit v1.2.3