title-icon-code

Verifying your Open Directory databases using Nagios

Verifying individual .bdb files in an Open Directory instance is something I have traditionally performed as a troubleshooting step only once a major directory services failure is identified. Recently however, I have moved a weekly scripted verification to my Nagios workflow, and have been pleased with the results.

check_od_bdb.sh is a simple bash script which traverses over the bdb files in /var/db/openldap/openldap-data/, verifies them, and returns any failures it encounters. Due to the non-locking nature of the underlying db_verify tool that it uses, I wouldn’t be running this every 5 minutes in a production environment, but a weekly check should give you some peace of mind that your Open Directory instance is sailing along healthily.

check_od_bdb.sh on GitHub

2 Responses to "Verifying your Open Directory databases using Nagios"

Add Comment
  1. Henning

    January 4, 2013 at 3:20 am

    Hello,

    do you let those scripts run via NRPE or via SSH?. I am trying this over NRPE but any script with the need of administratives rights does not work properly…

    regards

    henning

    Reply
    • jedda

      January 7, 2013 at 12:53 pm

      I run all of my scripts via SSH as I am actively monitoring less than 200 hosts, and I prefer the extra security. This script was very unclear that it needed to be run with root privileges. I have now updated it to state this, and to check for this on execution.

      There is some good information here about configuring NRPE to be able to execute privileged commands. I do a similar setup with SSH in letting the nagios user run sudo with no password on certain commands.

      Reply

Submit a comment

Your email address will not be published. Required fields are marked *