summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--files/plugins/check_jabber_login30
-rw-r--r--manifests/base.pp1
-rw-r--r--manifests/plugin.pp6
3 files changed, 6 insertions, 31 deletions
diff --git a/files/plugins/check_jabber_login b/files/plugins/check_jabber_login
deleted file mode 100644
index dac0e1f..0000000
--- a/files/plugins/check_jabber_login
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/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"
diff --git a/manifests/base.pp b/manifests/base.pp
index fa9f98a..e3c9c43 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -81,6 +81,7 @@ class nagios::base {
Nagios_serviceescalation <<||>>
Nagios_serviceextinfo <<||>>
Nagios_timeperiod <<||>>
+ Nagios::Plugin <<||>>
Nagios_command <||> {
target => "${nagios_cfgdir}/conf.d/nagios_command.cfg",
diff --git a/manifests/plugin.pp b/manifests/plugin.pp
index 4789345..85ef4b1 100644
--- a/manifests/plugin.pp
+++ b/manifests/plugin.pp
@@ -1,4 +1,5 @@
define nagios::plugin(
+ $source = 'absent',
$ensure = present
){
file{$name:
@@ -7,7 +8,10 @@ define nagios::plugin(
default => "/usr/lib/nagios/plugins/$name",
},
ensure => $ensure,
- source => "puppet://$server/modules/nagios/plugins/$name",
+ source => $source ? {
+ 'absent' => "puppet://$server/modules/nagios/plugins/$name",
+ default => "puppet://$server/modules/$source"
+ },
require => Package['nagios-plugins'],
owner => root, group => 0, mode => 0755;
}