License:
Free

Download elapse416.pl.txt

Authors: Jim Schnitter and Lionel Bartlett

New Version: 4.1.6 – March 25, 2009

Changes:

  • Option added: “-s” … Report statistics without LDAP operations being written out
  • Fixed CSV output “Object Name” column so that quotes wrap the data to ensure it stays in the intended column in a spreadsheet
  • Added support for DoCompare and DoExtended LDAP operations

Example of usage:

     Report on ALL (-m all) LDAP operation response times 1 sec (-t 1) or over and display stats only (-s): 

     elapse415d.pl -s -t 1 -m all LDAPT2.LOG > LDAPT2-OPS-1SEC_or_Over.TXT

version: 4.15c

This tool allows an administrator to calculate the time of each LDAP operation in a dstrace or iMonitor log file. It’s very useful in tracking down LDAP performance problems, especially slow searches. It’s been tested on SLES9, SLES10, SLED10 and Windows with ActiveState’s Perl.

Usage: elapse.pl -t <time> -m <mode> <logfile>

Options:
-x CSV output
(Must be used with -c, e.g. -x -c)
-c Only report completed LDAP requests
-t seconds print operations that take this time or longer
(optional – defaults to 0)
-i IP Address Filter, comma separated or wildcards
(Example: 10.10.10.1,10.10.2.*)
-m mode one of bind,search,modify,add,delete,modrdn or all
(optional – defaults to all)

(Option order is significant)

Examples:

– Find every search that takes 3 seconds or longer

      $ elapse.pl -t 3 -m search trace.htm

– List the elapsed time for every modify

      $ elapse.pl -m modify trace.htm

Instructions

Obtaining a dstrace/ndstrace for use with elapse requires the following settings:

  1. Enable only these (minimum) LDAP Server Screen Options, on the LDAP server:
    • Critical Error Message
    • Non-critical Error Messages
    • Informational Error Messages
    • Connection Information
    • Additional connection and operation information in (hex format)

    To ensure best results with this script gather only the minimum LDAP data required for elapse. Unfortunately there are still some defects in this script, which results from the many variations in messages when too much unrelated data ends up in the trace.

  2. DSTrace filters: +time +tags +ldap

Fixes

Between versions 4.1 – 4.15c:

  • Report total number of instances where an attribute is used in a filter. For indexing analysis

    Must specify -t AND not be 0 for the report to be presented
  • Cleaned up leading zeros in attribute stats.
  • Track attribute instances for each resposne time second
  • Check for attribute search type to assist with index creation type
  • Fix index substring check rule
  • Changed logic for locating the end of a thread. This allows for reporting on all attributes in a search

    Report ‘UnBinds’ when ‘-m all’ is used
  • Corrected message output when TAG missing from line
  • Changed rule for detecting LDAP tags, because the THRD tag data precedes TAGS data in dstrace

Message to customers:

Please leave feedback and an email address if you can’t get this script to work. I’ll get back to you promptly. Ideally I need a copy of the dstrace so I can reproduce the issue, unless it’s simply a cause of command line parameters or sequence.

History

v4.14

  • Fixed rule for index substring check
  • This version reports attribute usage and suggests the type (value or substring) of indexing that might to speed up LDAP searches
  • The attribute analysis is provided when using the option “-t” with a value 1 or greater

When creating indexes a decision is taken to create it based on Value or Substring. The update to this utility will help you decide which index type is required.

There are many factors which affect LDAP performance, not least of which is server load. Slow LDAP response does not mean there is a problem; the root cause could simply be over-loading. However this utility will use the output from DSTRACE with LDAP trace data to report on which attributes are used in searches. If the search contains only wildcard the attribute is ignored. If it contains text and a wildcard it is regarded as a substring search and if it only contains text, then it is a value search.

Analysis data includes the time in seconds and the total number of requests against a specific attribute.

v4.13

  • This version reports attribute usage and suggests the type (value or substring) of indexing that might to speed up LDAP searches
  • The attribute analysis is provided when using the option “-t” with a value 1 or greater

When creating indexes a decision is taken to create it based on Value or Substring. The update to this utility will help you decide which index type is required.

There are many factors which affect LDAP performance, not least of which is server load. Slow LDAP response does not mean there is a problem; the root cause could simply be over-loading. However this utility will use the output from DSTRACE with LDAP trace data to report on which attributes are used in searches. If the search contains only wildcard the attribute is ignored. If it contains text and a wildcard it is regarded as a substring search and if it only contains text, then it is a value search.

Analysis data includes the time in seconds and the total number of requests against a specific attribute.

v4.0

  • Fixed bug where ALL LDAP op details were not always being displayed
  • Always display stats for total number of operations for each second elapsed, regardless of “-t” value
  • In statistics section: Added asterisk next to seconds indicating where (elapsed time) matched or exceeded the “-t” parameter value

v3.2.1

  • CSV supported using “-x -c”, which reports: IPAddress, Port, LDAP operation, NDS Error, Elapsed Time
  • Made the standard output only report the elapsed time, as in v 3.0

V3.1.1

  • Display the IP and Port next to the results, so we can grep on an IP and see the totals
  • Display a statistics summary of the total instances for each second

Version 3.1

  • Changed the GetMsgID value to be the IP & Port number only
  • Perform additional checks for the GetMsgID in more functions to prevent unrelated LDAP messages being displayed
  • Added option “-c”. When used only displays completed LDAP queries
  • Updated –Help message

Authors:
Jim Schnitter
Lionel Bartlett

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.
Loading...Loading...
Tags: ,
Categories: Cool Tools, eDirectory

Disclaimer: As with everything else at NetIQ Cool Solutions, this content is definitely not supported by NetIQ, so Customer Support will not be able to help you if it has any adverse effect on your environment.  It just worked for at least one person, and perhaps it will be useful for you too.  Be sure to test in a non-production environment.

Leave a Reply

No Comments
By: jimsc
Mar 26, 2009
10:39 am
Reads:
2,650
Score:
Unrated