Archive for March, 2009

Using an OpenLDAP directory for Thunderbird address book lookups

Friday, March 13th, 2009

I wanted thunderbird to be able to look up addresses in my OpenLDAP directory. It worked out of the box somewhat using the standard inetorgperson attributes. But i wanted to map some of my POSIX attributes so Thunderbird would recognize them and therefore there would be more information in the address book entry.

Here is a table of ldap attributes thunderbird is interested in.

http://www.mozilla.org/projects/thunderbird/specs/ldap.html

This is based on a less than perfect schema that mozilla came up with.

Anyway, Thunderbird already gave me the First name(givenName), lastname(sn), displayname(cn), and email(mail) bits from each address book entry, but i wanted it to fill in the Nickname from the POSIX gecos attribute(It usually contains a little more information than just the name), so this is what had to be done on the OpenLDAP side

my DIT for this example is dc=example,dc=com and my users entries will be in ou=user

First i had to download and install the mozilla LDAP schema  from https://wiki.mozilla.org/MailNews:Mozilla_LDAP_Address_Book_Schema

I had to then define a new “relay” database at the botton of my slapd.conf, it looks something like this:

database                relay
suffix                  “dc=addresses”
relay                   “ou=user,dc=example,dc=com”
overlay                 rwm
rwm-suffixmassage       “ou=user,dc=example,dc=com
map attribute mozillaNickname gecos
map attribute mail *
map attribute uid *
map attribute sn *
map attribute givenname *
map attribute cn *
map attribute *

This will create a second virtual DIT called dc=addresses which will use the “real” ldap directory(ou=user,dc=example,dc=com) as a back-end. This will map the gecos to the mozilla nickname and it will now appear in the users address book entry in thunderbird, it also blocks all information except the bits that are needed like displayname, cn, givenname, sn. It would probably be advisable to apply some ACLs to this aswell just incase.

This is only an example. If you have other attributes that might fit into an address book entry then you can map them to the mozilla atrributes.

Nagios SunRay Plugin

Wednesday, March 4th, 2009

I was looking around for a nagios plugin to monitor our sunray servers where I work and I couldn’t find any. So I cooked my own. check_sunray

It’s basically just a wrapper around utwho.

The mandatory arguments for the plugin are -w and -c. -w is the warning threshold for the amount of sunray sessions and -c is the critical threshold for the amount of sunray sessions.

By default it counts all logged-in sunray sessions(but not necessarily active), i.e. the output of utwho with no arguments, with the -o option it only counts active sunray sessions(eq to utwho -c) and -a counts all sessions, even non logged-in ones (eq to utwho -a)

I use nrpe to monitor my remote sunray servers so this is the definition in nrpe.conf:

command[check_sunray]=/opt/csw/libexec/nagios-plugins/check_sunray -w 10 -c 20 -o

This will raise a warning alert if the amount of active sunray sessions goes over 10 and a critical alert if the amount of active sunray sessions goes over 20.

This has only been tested with SRSS 4.1 on solaris but im pretty sure it’ll work with linux SRSS.

If anyone has any other ideas on how to monitor a sunray server leave me a comment.


Copyright © 2018 All Rights Reserved.
No computers were harmed in the 0.043 seconds it took to produce this page.

dmarkey.com