summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 32f8170)
raw | patch | inline | side by side (parent: 32f8170)
author | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 8 Dec 2009 09:24:00 +0000 (09:24 +0000) | ||
committer | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 8 Dec 2009 09:24:00 +0000 (09:24 +0000) |
- Applied fix-newline-userlist-generation.patch Closes #797
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14881 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14881 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/nagios/contrib/goNagios.pl | patch | blob | history | |
gosa-plugins/nagios/contrib/gosa_bind.conf | [new file with mode: 0644] | patch | blob |
gosa-plugins/nagios/contrib/nagios_ldap.conf | [new file with mode: 0644] | patch | blob |
index 81afe1657cba2d29aded95df7ff5f35743409aaa..232c56d2225fb40d9bb8cfe170f0b0b5cf6e8990 100755 (executable)
# Copyright (C) 2005 Guillaume Delecourt <guillaume.delecourt@opensides.be>
# Copyright (C) 2005 Vincent Senave <vincent.senave@opensides.be>
+# Copyright (C) 2005-2009 Benoit Mortier <benoit.mortier@opensides.be>
#
#
# This program is free software; you can redistribute it and/or modify
);
# The connexion parameters are in gosa_bind.conf
-my $gosa_bind_conf="/etc/gosa_bind.conf";
-my $gosa_ldap_conf="/etc/gosaldap.conf";
+my $gosa_bind_conf="/etc/gosa/gosa_bind.conf";
+my $gosa_ldap_conf="/etc/gosa/nagios_ldap.conf";
my %config_bind = &read_conf($gosa_bind_conf);
my %config = &read_conf($gosa_ldap_conf);
}
$nb_groupe=$i;
- $userlist1.=$admindef;
-
#Part of the ObjectClass NagiosAuth
$stdout.="\n\n\n\n\nAuthorization for the different Information in Nagios\n"."-" x 53;$stdout.="\n";
$mesg = $ldap->search(filter=>"(&(objectClass~=nagiosAuth)(AuthorizedSystemInformation~=checked))", base=>$peopleou,scope=>$scope);
$stdout.="\nSystem infos :\t\t";
foreach $entry (@entries) {
$stdout.= $entry->get_value('uid')."\t";
- $userlist1.=$entry->get_value('uid')." ,";
+ $userlist1.=$entry->get_value('uid').",";
}
$userlist1.=$admindef;
$stdout.="\nConfiguration infos :\t";
foreach $entry (@entries) {
$stdout.= $entry->get_value('uid')."\t";
- $userlist2.=$entry->get_value('uid')." , ";
+ $userlist2.=$entry->get_value('uid').",";
}
$userlist2.=$admindef;
$stdout.="\nSystem commands : \t";
foreach $entry (@entries) {
$stdout.= $entry->get_value('uid')."\t";
- $userlist3.=$entry->get_value('uid')." , ";
+ $userlist3.=$entry->get_value('uid').",";
}
$userlist3.=$admindef;
$stdout.="\nAll services :\t\t";
foreach $entry (@entries) {
$stdout.= $entry->get_value('uid')."\t";
- $userlist4.=$entry->get_value('uid')." ,";
+ $userlist4.=$entry->get_value('uid').",";
}
$userlist4.=$admindef;
$text.="\n\thost_notification_options \t".$hostnotificationoptions[$i];
$text.="\n\tservice_notification_period \t".$servicenotificationperiod[$i];
$text.="\n\tservice_notification_options \t".$servicenotificationoptions[$i];
+ $text.="\n\tservice_notification_commands \t".$config{service_notification_commands};
+ $text.="\n\thost_notification_commands \t".$config{host_notification_commands};
$text.="\n\temail \t\t\t\t".$nagiosmail[$i];
$text.="\n}\n\n";
}
{
$line=$_;
#$stdout.="$line";
- if($line =~ /^authorized_for_system_information=*/i){$text.="authorized_for_system_information=".$userlist1}
- elsif($line =~ /^authorized_for_configuration_information=*/i){$text.="authorized_for_configuration_information=".$userlist2}
- elsif($line =~ /^authorized_for_system_commands=*/i){$text.="authorized_for_system_commands=".$userlist3}
- elsif($line =~ /^authorized_for_all_services=*/i){$text.="authorized_for_all_services=".$userlist4."\n"}
- elsif($line =~ /^authorized_for_all_hosts=*/i){$text.="authorized_for_all_hosts=".$userlist5}
- elsif($line =~ /^authorized_for_all_service_commands=*/i){$text.="authorized_for_all_host_commands=".$userlist6."\n"}
- elsif($line =~ /^authorized_for_all_host_commands=*/i){$text.="authorized_for_all_service_commands=".$userlist7}
+ if($line =~ s/^(authorized_for_system_information=).*$/$1$userlist1/){$text.=$line;}
+ elsif($line =~ s/^(authorized_for_configuration_information=).*$/$1$userlist2/){$text.=$line;}
+ elsif($line =~ s/^(authorized_for_system_commands=).*$/$1$userlist3/){$text.=$line;}
+ elsif($line =~ s/^(authorized_for_all_services=).*$/$1$userlist4/){$text.=$line;}
+ elsif($line =~ s/^(authorized_for_all_hosts=).*$/$1$userlist5/){$text.=$line;}
+ elsif($line =~ s/^(authorized_for_all_service_commands=).*$/$1$userlist6/){$text.=$line;}
+ elsif($line =~ s/^(authorized_for_all_host_commands=).*$/$1$userlist7/){$text.=$line;}
else {$text.=$line};
}
close(FH);
diff --git a/gosa-plugins/nagios/contrib/gosa_bind.conf b/gosa-plugins/nagios/contrib/gosa_bind.conf
--- /dev/null
@@ -0,0 +1,4 @@
+# ldap bind -- keep file protected with 0600
+masterDN="cn=admin,dc=example,dc=com"
+masterPw="mypassword"
+
diff --git a/gosa-plugins/nagios/contrib/nagios_ldap.conf b/gosa-plugins/nagios/contrib/nagios_ldap.conf
--- /dev/null
@@ -0,0 +1,19 @@
+# ldap configuration
+peopleou="ou=people,dc=example,dc=com"
+groupeou="ou=group,dc=example,dc=com"
+base="dc=example,dc=com"
+scope="sub"
+server="localhost:389"
+
+# output mode. Info about what the script did.
+# Available options are "mail" "log" "normal"
+stdout="log"
+# send script output info to:
+email="mail@example.com"
+# log script output info to:
+logfile="/tmp/gosa-nagios.log"
+
+# the nagios defined object to send email
+service_notification_commands="notify-service-by-email"
+# the nagios defined object to send email
+host_notification_commands="notify-host-by-email"