« the music plays all night in shangri-la | Main | fading »

monitoring your openldap server with cricket

Cricket's fairly addictive - once you get the hang of adding new stuff, you find yourself wanting to Graph The World. OpenLDAP has a monitor backend that'll tell you some occasionally interesting statistics about what's been going on, making it a candidate for being Cricketed. I didn't find anything on the net for OpenLDAP and Cricket, but I did find a paper by Jehan Procaccia on monitoring OpenLDAP with MRTG, which was easy enough to adapt. I did this on Debian.

  1. Enable the monitor backend of OpenLDAP. Debian/unstable's OpenLDAP 2.1 package builds the backends as loadable modules, so in addition to what the original document suggests, you should add :

    moduleload back_monitor
  2. Setup net-snmp to grab the statistics. If your LDAP server's running on the same machine as Cricket, you don't have to do this (you could just have Cricket run the monitor-jp.pl script directly). Modifying the original instructions, this is what I added to the end of my /etc/snmp/snmpd.conf file (make sure it's on one line - I've wrapped it for Added Reader Sanity):

    exec 1.3.6.1.4.1.2021.8.1.104 monitor-jp.pl
      /usr/share/cricket/util/monitor-jp.pl 1 snmpd
    

    I modified the original monitor-jp.pl script to have the "snmpd" mode to output all the values at once for snmpd to put in a table, rather than running the script once for each value. Here's my modified monitor-jp.pl.

  3. Configure Cricket. Here's my Defaults and Targets files.

I hope this is useful to somebody!

* 12:34 * geek

Comments have been closed for this post. If you've got something to say, please contact me by other means. Thanks!

Comments (2)

micah:

Hrm, I had to change:

use Switch;

to be:

use CGI::Switch;

but even then, I get these errors when running it:
String found where operator expected at ./monitor-jp.pl.1 line 78, near "case "valTotConnexions""
(Do you need to predeclare case?)
String found where operator expected at ./monitor-jp.pl.1 line 80, near "case "valTotSearch""
(Do you need to predeclare case?)
String found where operator expected at ./monitor-jp.pl.1 line 82, near "case "valTotAdd""
(Do you need to predeclare case?)
syntax error at ./monitor-jp.pl.1 line 77, near ") {"
syntax error at ./monitor-jp.pl.1 line 80, near "case "valTotSearch""
syntax error at ./monitor-jp.pl.1 line 82, near "case "valTotAdd""
Execution of ./monitor-jp.pl.1 aborted due to compilation errors.

cos:

Did you try

perl -MCPAN -e 'install Switch'

instead?