contacts.cfg and ldap

Thomas Guyot-Sionnest dermoth at aei.ca
Fri Jun 20 06:31:23 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 19/06/08 05:03 PM, Wim De Geeter wrote:
> Hi,
> 
> Is it possible to get the contact information (contacts.cfg) out of LDAP 
> ?? I would safe a lot of time.
> Many thanks,
> Wim

If you're good in Perl you're in luck... Here's some scripts I wrote to
do just that. They come in pairs: one to fetch the data and one to
update nagios config using templates and re matches.


updatenagiosadmin.pl update the cgi access list and create contacts for
Nagios users (together with kerberos authentication, you can have an AD
group to put nagios users in). It also create a contact group so that
the AD name appears in various place of the CGI rather than the login name.

If you want different groups for different access levels just run
multiple scripts in parallel (see the config and template sections).
Also note that it lc() all login names - I modified mod_auth_kerberos to
do the same so I don't get login errors when names contain uppercases.

updatepagers.pl create a pager contactgroup out of AD contacts in a
group. Same principle as the above script. Run multiple scripts if you
need multiple groups.


I never released them because it's way too complex for anyone without
good Perl and LDAP knowledge. Ideally if I had time/help I'd write a
more general engine out of it that could take options/templates trough a
config file.


Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIWzKb6dZ+Kt5BchYRAgAtAJsGh26EvY+ISBOUuLQeZYPDX+xPIgCgm0WP
irP2qBldT4WYY7XN1XAtTuU=
=UcHa
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getadnagiosadmin.pl
Type: application/x-perl
Size: 4547 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080620/53884dd2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getadpagers.pl
Type: application/x-perl
Size: 4781 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080620/53884dd2/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: updatenagiosadmin.pl
Type: application/x-perl
Size: 6414 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080620/53884dd2/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: updatepagers.pl
Type: application/x-perl
Size: 5175 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080620/53884dd2/attachment-0003.bin>
-------------- next part --------------
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list