eDir - The Support Diagnostic Pattern eDirectory perl library
use SDP::eDir;
Provides shared functions for eDirectory support pattern analysis
eDirValidation tests to ensure that eDirectory rpm is installed and the daemon is running.
SDP::eDir::eDirValidation()
will cause the pattern to exit with STATUS_ERROR if eDirectory is not installed or is not running. The function can only return 0.
SDP::eDir::eDirValidation(EDIR_NOT_INSTALLED)
will cause the pattern to exit with STATUS_ERROR if eDirectory is not running. The function will either return 0 if eDirectory is installed, or EDIR_NOT_INSTALLED if eDirectory is not installed.
SDP::eDir::eDirValidation(EDIR_NOT_RUNNING)
will cause the pattern to exit with STATUS_ERROR if eDirectory is not installed. The function will either return 0 if eDirectory is running, or EDIR_NOT_RUNNING if eDirectory is not running.
SDP::eDir::eDirValidation(EDIR_NOT_INSTALLED | EDIR_NOT_RUNNING)
will never cause the pattern to exit with STATUS_ERROR. The function will either return a 0 if eDirectory is installed and running, or a bitwise OR of EDIR_NOT_RUNNING and EDIR_NOT_INSTALLED depending on what is discovered. Check the return with a bitwise AND to detect what was found.
eDirStatus returns the output of the ndsstat command into a hash
use SDP::eDir; my %ndsstat = SDP::eDir::eDirStatus(); print "Using eDirectory version $ndsstat{'Binary Version'}\n"; print "Testing server $ndsstat{'Server Name'} in tree $ndsstat{'Tree Name'}\n";
ndsdMemoryMaximum returns the maximum memory size ndsd can reach before becoming unresponsive. This number is dependent on version and architecture.
use SDP::eDir; my $maximum_memory = SDP::eDir::ndsdMemoryMaximum();
Tregaron Bayly, <tbayly@novell.com>
Copyright (C) 2009,2010 by Tregaron Bayly
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.