├── DSRSreplconf.sh ├── LICENCE.md ├── README.md ├── decodecsn ├── dsmlQueryService.wsdl ├── filterstat.py ├── logconv7.pl ├── lograte ├── logstat.py ├── opendj_patch4upgrade.sh └── schema-convert.py /DSRSreplconf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # The contents of this file are subject to the terms of the 4 | # Common Development and Distribution License, Version 1.0 only 5 | # (the "License"). You may not use this file except in compliance 6 | # with the License. 7 | # 8 | # You can obtain a copy of the license at 9 | # http://forgerock.org/license/CDDLv1.0.html. 10 | # See the License for the specific language governing permissions 11 | # and limitations under the License. 12 | # 13 | # Copyright 2012 - ForgeRock Inc. 14 | # Author: Ludovic Poitou 15 | if test $# -ne 4 16 | then 17 | echo "Usage: $0 directory1 directory2 replserver1 replserv2" 18 | echo "Setup and configure replication between 2 directories, with 2 external replication servers" 19 | exit 1 20 | fi 21 | WORKING_DIR=`pwd` 22 | 23 | H=`uname -n` 24 | echo $H 25 | 26 | # Setup Directory Server 1 27 | cd "$1" 28 | ./setup -i -n -b "dc=example,dc=com" -d 2000 -h $H -p 1389 --adminConnectorPort 4444 -D "cn=Directory Manager" -w "secret12" -q -Z 1636 --generateSelfSignedCertificate 29 | 30 | cd "${WORKING_DIR}" 31 | 32 | # Setup Directory Server 2 33 | cd "$2" 34 | ./setup -i -n -b "dc=example,dc=com" -a -h $H -p 2389 --adminConnectorPort 5444 -D "cn=Directory Manager" -w "secret12" -q -Z 2636 --generateSelfSignedCertificate 35 | 36 | cd "${WORKING_DIR}" 37 | 38 | # Setup RS 1 39 | cd "$3" 40 | ./setup -i -n -h $H -p 3389 --adminConnectorPort 6444 -D "cn=Directory Manager" -w "secret12" -q -Z 3636 --generateSelfSignedCertificate 41 | 42 | cd "${WORKING_DIR}" 43 | 44 | # Setup RS 2 45 | cd "$4" 46 | ./setup -i -n -h $H -p 4389 --adminConnectorPort 7444 -D "cn=Directory Manager" -w "secret12" -q -Z 4636 --generateSelfSignedCertificate 47 | 48 | 49 | # First directory with RS1 50 | bin/dsreplication enable --host1 $H --port1 4444 --bindDN1 "cn=directory manager" --bindPassword1 secret12 --noReplicationServer1 --host2 $H --port2 6444 --bindDN2 "cn=directory manager" --bindPassword2 secret12 --replicationPort2 8989 --onlyReplicationServer2 --adminUID admin --adminPassword password --baseDN "dc=example,dc=com" -X -n 51 | 52 | # Second directory with RS1 53 | bin/dsreplication enable --host1 $H --port1 5444 --bindDN1 "cn=directory manager" --bindPassword1 secret12 --noReplicationServer1 --host2 $H --port2 6444 --bindDN2 "cn=directory manager" --bindPassword2 secret12 --replicationPort2 8989 --onlyReplicationServer2 --adminUID admin --adminPassword password --baseDN "dc=example,dc=com" -X -n 54 | 55 | # First directory with RS2 56 | bin/dsreplication enable --host1 $H --port1 4444 --bindDN1 "cn=directory manager" --bindPassword1 secret12 --noReplicationServer1 --host2 $H --port2 7444 --bindDN2 "cn=directory manager" --bindPassword2 secret12 --replicationPort2 9999 --onlyReplicationServer2 --adminUID admin --adminPassword password --baseDN "dc=example,dc=com" -X -n 57 | 58 | 59 | # Initialize DS2 with content of DS1 60 | bin/dsreplication initialize --baseDN "dc=example,dc=com" --adminUID admin --adminPassword password --hostSource $H --portSource 4444 --hostDestination $H --portDestination 5444 -X -n 61 | 62 | 63 | cd "${WORKING_DIR}" 64 | -------------------------------------------------------------------------------- /LICENCE.md: -------------------------------------------------------------------------------- 1 | Copyright 2009-2014 Ludovic Poitou 2 | 3 | Unless otherwise noted, all files in this distribution are released 4 | under the Common Development and Distribution License (CDDL). 5 | Exceptions are noted within the associated source files. 6 | 7 | -------------------------------------------------------------------- 8 | http://opensource.org/licenses/CDDL-1.0 9 | -------------------------------------------------------------------- 10 | 11 | COMMON DEVELOPMENT AND DISTRIBUTION LICENSE Version 1.0 12 | 13 | 1. Definitions. 14 | 15 | 1.1. "Contributor" means each individual or entity that creates 16 | or contributes to the creation of Modifications. 17 | 18 | 1.2. "Contributor Version" means the combination of the Original 19 | Software, prior Modifications used by a Contributor (if any), 20 | and the Modifications made by that particular Contributor. 21 | 22 | 1.3. "Covered Software" means (a) the Original Software, or (b) 23 | Modifications, or (c) the combination of files containing 24 | Original Software with files containing Modifications, in 25 | each case including portions thereof. 26 | 27 | 1.4. "Executable" means the Covered Software in any form other 28 | than Source Code. 29 | 30 | 1.5. "Initial Developer" means the individual or entity that first 31 | makes Original Software available under this License. 32 | 33 | 1.6. "Larger Work" means a work which combines Covered Software or 34 | portions thereof with code not governed by the terms of this 35 | License. 36 | 37 | 1.7. "License" means this document. 38 | 39 | 1.8. "Licensable" means having the right to grant, to the maximum 40 | extent possible, whether at the time of the initial grant or 41 | subsequently acquired, any and all of the rights conveyed 42 | herein. 43 | 44 | 1.9. "Modifications" means the Source Code and Executable form of 45 | any of the following: 46 | 47 | A. Any file that results from an addition to, deletion from or 48 | modification of the contents of a file containing Original 49 | Software or previous Modifications; 50 | 51 | B. Any new file that contains any part of the Original 52 | Software or previous Modifications; or 53 | 54 | C. Any new file that is contributed or otherwise made 55 | available under the terms of this License. 56 | 57 | 1.10. "Original Software" means the Source Code and Executable 58 | form of computer software code that is originally released 59 | under this License. 60 | 61 | 1.11. "Patent Claims" means any patent claim(s), now owned or 62 | hereafter acquired, including without limitation, method, 63 | process, and apparatus claims, in any patent Licensable by 64 | grantor. 65 | 66 | 1.12. "Source Code" means (a) the common form of computer software 67 | code in which modifications are made and (b) associated 68 | documentation included in or with such code. 69 | 70 | 1.13. "You" (or "Your") means an individual or a legal entity 71 | exercising rights under, and complying with all of the terms 72 | of, this License. For legal entities, "You" includes any 73 | entity which controls, is controlled by, or is under common 74 | control with You. For purposes of this definition, 75 | "control" means (a) the power, direct or indirect, to cause 76 | the direction or management of such entity, whether by 77 | contract or otherwise, or (b) ownership of more than fifty 78 | percent (50%) of the outstanding shares or beneficial 79 | ownership of such entity. 80 | 81 | 2. License Grants. 82 | 83 | 2.1. The Initial Developer Grant. 84 | 85 | Conditioned upon Your compliance with Section 3.1 below and 86 | subject to third party intellectual property claims, the Initial 87 | Developer hereby grants You a world-wide, royalty-free, 88 | non-exclusive license: 89 | 90 | (a) under intellectual property rights (other than patent or 91 | trademark) Licensable by Initial Developer, to use, 92 | reproduce, modify, display, perform, sublicense and 93 | distribute the Original Software (or portions thereof), 94 | with or without Modifications, and/or as part of a Larger 95 | Work; and 96 | 97 | (b) under Patent Claims infringed by the making, using or 98 | selling of Original Software, to make, have made, use, 99 | practice, sell, and offer for sale, and/or otherwise 100 | dispose of the Original Software (or portions thereof). 101 | 102 | (c) The licenses granted in Sections 2.1(a) and (b) are 103 | effective on the date Initial Developer first distributes 104 | or otherwise makes the Original Software available to a 105 | third party under the terms of this License. 106 | 107 | (d) Notwithstanding Section 2.1(b) above, no patent license is 108 | granted: (1) for code that You delete from the Original 109 | Software, or (2) for infringements caused by: (i) the 110 | modification of the Original Software, or (ii) the 111 | combination of the Original Software with other software 112 | or devices. 113 | 114 | 2.2. Contributor Grant. 115 | 116 | Conditioned upon Your compliance with Section 3.1 below and 117 | subject to third party intellectual property claims, each 118 | Contributor hereby grants You a world-wide, royalty-free, 119 | non-exclusive license: 120 | 121 | (a) under intellectual property rights (other than patent or 122 | trademark) Licensable by Contributor to use, reproduce, 123 | modify, display, perform, sublicense and distribute the 124 | Modifications created by such Contributor (or portions 125 | thereof), either on an unmodified basis, with other 126 | Modifications, as Covered Software and/or as part of a 127 | Larger Work; and 128 | 129 | (b) under Patent Claims infringed by the making, using, or 130 | selling of Modifications made by that Contributor either 131 | alone and/or in combination with its Contributor Version 132 | (or portions of such combination), to make, use, sell, 133 | offer for sale, have made, and/or otherwise dispose of: 134 | (1) Modifications made by that Contributor (or portions 135 | thereof); and (2) the combination of Modifications made by 136 | that Contributor with its Contributor Version (or portions 137 | of such combination). 138 | 139 | (c) The licenses granted in Sections 2.2(a) and 2.2(b) are 140 | effective on the date Contributor first distributes or 141 | otherwise makes the Modifications available to a third 142 | party. 143 | 144 | (d) Notwithstanding Section 2.2(b) above, no patent license is 145 | granted: (1) for any code that Contributor has deleted 146 | from the Contributor Version; (2) for infringements caused 147 | by: (i) third party modifications of Contributor Version, 148 | or (ii) the combination of Modifications made by that 149 | Contributor with other software (except as part of the 150 | Contributor Version) or other devices; or (3) under Patent 151 | Claims infringed by Covered Software in the absence of 152 | Modifications made by that Contributor. 153 | 154 | 3. Distribution Obligations. 155 | 156 | 3.1. Availability of Source Code. 157 | 158 | Any Covered Software that You distribute or otherwise make 159 | available in Executable form must also be made available in Source 160 | Code form and that Source Code form must be distributed only under 161 | the terms of this License. You must include a copy of this 162 | License with every copy of the Source Code form of the Covered 163 | Software You distribute or otherwise make available. You must 164 | inform recipients of any such Covered Software in Executable form 165 | as to how they can obtain such Covered Software in Source Code 166 | form in a reasonable manner on or through a medium customarily 167 | used for software exchange. 168 | 169 | 3.2. Modifications. 170 | 171 | The Modifications that You create or to which You contribute are 172 | governed by the terms of this License. You represent that You 173 | believe Your Modifications are Your original creation(s) and/or 174 | You have sufficient rights to grant the rights conveyed by this 175 | License. 176 | 177 | 3.3. Required Notices. 178 | 179 | You must include a notice in each of Your Modifications that 180 | identifies You as the Contributor of the Modification. You may 181 | not remove or alter any copyright, patent or trademark notices 182 | contained within the Covered Software, or any notices of licensing 183 | or any descriptive text giving attribution to any Contributor or 184 | the Initial Developer. 185 | 186 | 3.4. Application of Additional Terms. 187 | 188 | You may not offer or impose any terms on any Covered Software in 189 | Source Code form that alters or restricts the applicable version 190 | of this License or the recipients' rights hereunder. You may 191 | choose to offer, and to charge a fee for, warranty, support, 192 | indemnity or liability obligations to one or more recipients of 193 | Covered Software. However, you may do so only on Your own behalf, 194 | and not on behalf of the Initial Developer or any Contributor. 195 | You must make it absolutely clear that any such warranty, support, 196 | indemnity or liability obligation is offered by You alone, and You 197 | hereby agree to indemnify the Initial Developer and every 198 | Contributor for any liability incurred by the Initial Developer or 199 | such Contributor as a result of warranty, support, indemnity or 200 | liability terms You offer. 201 | 202 | 3.5. Distribution of Executable Versions. 203 | 204 | You may distribute the Executable form of the Covered Software 205 | under the terms of this License or under the terms of a license of 206 | Your choice, which may contain terms different from this License, 207 | provided that You are in compliance with the terms of this License 208 | and that the license for the Executable form does not attempt to 209 | limit or alter the recipient's rights in the Source Code form from 210 | the rights set forth in this License. If You distribute the 211 | Covered Software in Executable form under a different license, You 212 | must make it absolutely clear that any terms which differ from 213 | this License are offered by You alone, not by the Initial 214 | Developer or Contributor. You hereby agree to indemnify the 215 | Initial Developer and every Contributor for any liability incurred 216 | by the Initial Developer or such Contributor as a result of any 217 | such terms You offer. 218 | 219 | 3.6. Larger Works. 220 | 221 | You may create a Larger Work by combining Covered Software with 222 | other code not governed by the terms of this License and 223 | distribute the Larger Work as a single product. In such a case, 224 | You must make sure the requirements of this License are fulfilled 225 | for the Covered Software. 226 | 227 | 4. Versions of the License. 228 | 229 | 4.1. New Versions. 230 | 231 | Sun Microsystems, Inc. is the initial license steward and may 232 | publish revised and/or new versions of this License from time to 233 | time. Each version will be given a distinguishing version number. 234 | Except as provided in Section 4.3, no one other than the license 235 | steward has the right to modify this License. 236 | 237 | 4.2. Effect of New Versions. 238 | 239 | You may always continue to use, distribute or otherwise make the 240 | Covered Software available under the terms of the version of the 241 | License under which You originally received the Covered Software. 242 | If the Initial Developer includes a notice in the Original 243 | Software prohibiting it from being distributed or otherwise made 244 | available under any subsequent version of the License, You must 245 | distribute and make the Covered Software available under the terms 246 | of the version of the License under which You originally received 247 | the Covered Software. Otherwise, You may also choose to use, 248 | distribute or otherwise make the Covered Software available under 249 | the terms of any subsequent version of the License published by 250 | the license steward. 251 | 252 | 4.3. Modified Versions. 253 | 254 | When You are an Initial Developer and You want to create a new 255 | license for Your Original Software, You may create and use a 256 | modified version of this License if You: (a) rename the license 257 | and remove any references to the name of the license steward 258 | (except to note that the license differs from this License); and 259 | (b) otherwise make it clear that the license contains terms which 260 | differ from this License. 261 | 262 | 5. DISCLAIMER OF WARRANTY. 263 | 264 | COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" 265 | BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, 266 | INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED 267 | SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR 268 | PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND 269 | PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY 270 | COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE 271 | INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY 272 | NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF 273 | WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF 274 | ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS 275 | DISCLAIMER. 276 | 277 | 6. TERMINATION. 278 | 279 | 6.1. This License and the rights granted hereunder will terminate 280 | automatically if You fail to comply with terms herein and fail to 281 | cure such breach within 30 days of becoming aware of the breach. 282 | Provisions which, by their nature, must remain in effect beyond 283 | the termination of this License shall survive. 284 | 285 | 6.2. If You assert a patent infringement claim (excluding 286 | declaratory judgment actions) against Initial Developer or a 287 | Contributor (the Initial Developer or Contributor against whom You 288 | assert such claim is referred to as "Participant") alleging that 289 | the Participant Software (meaning the Contributor Version where 290 | the Participant is a Contributor or the Original Software where 291 | the Participant is the Initial Developer) directly or indirectly 292 | infringes any patent, then any and all rights granted directly or 293 | indirectly to You by such Participant, the Initial Developer (if 294 | the Initial Developer is not the Participant) and all Contributors 295 | under Sections 2.1 and/or 2.2 of this License shall, upon 60 days 296 | notice from Participant terminate prospectively and automatically 297 | at the expiration of such 60 day notice period, unless if within 298 | such 60 day period You withdraw Your claim with respect to the 299 | Participant Software against such Participant either unilaterally 300 | or pursuant to a written agreement with Participant. 301 | 302 | 6.3. In the event of termination under Sections 6.1 or 6.2 above, 303 | all end user licenses that have been validly granted by You or any 304 | distributor hereunder prior to termination (excluding licenses 305 | granted to You by any distributor) shall survive termination. 306 | 307 | 7. LIMITATION OF LIABILITY. 308 | 309 | UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT 310 | (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE 311 | INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF 312 | COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE 313 | LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR 314 | CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT 315 | LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK 316 | STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER 317 | COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN 318 | INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF 319 | LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL 320 | INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT 321 | APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO 322 | NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR 323 | CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT 324 | APPLY TO YOU. 325 | 326 | 8. U.S. GOVERNMENT END USERS. 327 | 328 | The Covered Software is a "commercial item," as that term is 329 | defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial 330 | computer software" (as that term is defined at 48 331 | C.F.R. 252.227-7014(a)(1)) and "commercial computer software 332 | documentation" as such terms are used in 48 C.F.R. 12.212 333 | (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 334 | C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all 335 | U.S. Government End Users acquire Covered Software with only those 336 | rights set forth herein. This U.S. Government Rights clause is in 337 | lieu of, and supersedes, any other FAR, DFAR, or other clause or 338 | provision that addresses Government rights in computer software 339 | under this License. 340 | 341 | 9. MISCELLANEOUS. 342 | 343 | This License represents the complete agreement concerning subject 344 | matter hereof. If any provision of this License is held to be 345 | unenforceable, such provision shall be reformed only to the extent 346 | necessary to make it enforceable. This License shall be governed 347 | by the law of the jurisdiction specified in a notice contained 348 | within the Original Software (except to the extent applicable law, 349 | if any, provides otherwise), excluding such jurisdiction's 350 | conflict-of-law provisions. Any litigation relating to this 351 | License shall be subject to the jurisdiction of the courts located 352 | in the jurisdiction and venue specified in a notice contained 353 | within the Original Software, with the losing party responsible 354 | for costs, including, without limitation, court costs and 355 | reasonable attorneys' fees and expenses. The application of the 356 | United Nations Convention on Contracts for the International Sale 357 | of Goods is expressly excluded. Any law or regulation which 358 | provides that the language of a contract shall be construed 359 | against the drafter shall not apply to this License. You agree 360 | that You alone are responsible for compliance with the United 361 | States export administration regulations (and the export control 362 | laws and regulation of any other countries) when You use, 363 | distribute or otherwise make available any Covered Software. 364 | 365 | 10. RESPONSIBILITY FOR CLAIMS. 366 | 367 | As between Initial Developer and the Contributors, each party is 368 | responsible for claims and damages arising, directly or 369 | indirectly, out of its utilization of rights under this License 370 | and You agree to work with Initial Developer and Contributors to 371 | distribute such responsibility on an equitable basis. Nothing 372 | herein is intended or shall be deemed to constitute any admission 373 | of liability. 374 | 375 | -------------------------------------------------------------------- 376 | 377 | NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND 378 | DISTRIBUTION LICENSE (CDDL) 379 | 380 | For Covered Software in this distribution, this License shall 381 | be governed by the laws of the State of California (excluding 382 | conflict-of-law provisions). 383 | 384 | Any litigation relating to this License shall be subject to the 385 | jurisdiction of the Federal Courts of the Northern District of 386 | California and the state courts of the State of California, with 387 | venue lying in Santa Clara County, California. 388 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | opendj-utils 2 | ============ 3 | 4 | Small utilities for OpenDJ LDAP directory services (http://opendj.forgerock.org) 5 | 6 | * schema-convert.py - Converts OpenLDAP .schema file to OpenDJ ldif format 7 | * logstat.py - Compute statistics about LDAP operations from access logs 8 | * NEW: filterstat.py - Compute statistics about search filters from access logs 9 | * opendj_patch4upgrade.sh - Patches an existing OpenDS or early OpenDJ instance to allow smooth upgrade afterwards 10 | * dsmlQueryService.wsdl - DSML WSDL file to use with OpenDJ DSML Gateway 11 | * DSRSreplconf.sh - Sample script to configure 2 OpenDJ directory services replicating through 2 OpenDJ replication servers (all installed on the same machine, different ports) 12 | * logconv7.pl - Analyze and compute statistics from the access logs. 13 | 14 | Additional utilities for OpenDJ can be found on [Chris Ridd's GitHub space] (https://github.com/chrisridd/opendj-utils) 15 | 16 | Note: these are my tools and in no way officially supported by ForgeRock. 17 | -------------------------------------------------------------------------------- /decodecsn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | """ 4 | lograte.py 5 | 6 | # CDDL HEADER START 7 | # 8 | # The contents of this file are subject to the terms of the 9 | # Common Development and Distribution License, Version 1.0 only 10 | # (the "License"). You may not use this file except in compliance 11 | # with the License. 12 | # 13 | # You can obtain a copy of the license at 14 | # http://forgerock.org/license/CDDLv1.0.html. 15 | # See the License for the specific language governing permissions 16 | # and limitations under the License. 17 | # 18 | # When distributing Covered Code, include this CDDL HEADER in each 19 | # file. If applicable, add the following below this CDDL HEADER, 20 | # with the fields enclosed by brackets "[]" replaced with your own 21 | # identifying information: 22 | # Portions Copyright [yyyy] [name of copyright owner] 23 | # 24 | # CDDL HEADER END 25 | # 26 | # 27 | # Copyright 2018 ForgeRock AS. 28 | 29 | Created by Ludovic Poitou on 2018-10-04. 30 | 31 | This program reads OpenDJ's replication Change Sequence Numbers (CSN) 32 | and output a readable version. 33 | """ 34 | 35 | import sys 36 | import getopt 37 | import string 38 | import datetime 39 | import pytz 40 | 41 | help_message = ''' 42 | Usage: decodecsn [-z timezone] csn [csn ...] 43 | ''' 44 | 45 | def decodeCSN(str, tz): 46 | if str.startswith("0000"): 47 | # Historical version 48 | ts = long(str[0:16], 16) 49 | Id = int(str[16:20], 16) 50 | seq = int(str[20:28], 16) 51 | elif str.startswith("01"): 52 | # Version starting with 6.5.0 53 | IdSize = int(str[2:4], 16) 54 | Id = str[-IdSize:] 55 | ts = long(str[4:16], 16) 56 | seq = int(str[16:24], 16) 57 | tsutc = datetime.datetime.fromtimestamp(ts / 1000.0, pytz.utc) 58 | if tz == "": 59 | tsstr = tsutc.strftime('%Y-%m-%d %H:%M:%S.%f %Z') 60 | else: 61 | tsstr = tsutc.astimezone(tz).strftime('%Y-%m-%d %H:%M:%S.%f %Z') 62 | print "CSN:", str, ">> TS:", tsstr, "(", ts, ") - Seq:", seq, "- ReplicaId:", Id 63 | 64 | class Usage(Exception): 65 | def __init__(self, msg): 66 | self.msg = msg 67 | 68 | def main(argv=None): 69 | tz = "" 70 | if argv is None: 71 | argv = sys.argv 72 | try: 73 | try: 74 | opts, args = getopt.getopt(argv[1:], "hz:", ["help"]) 75 | except getopt.error, msg: 76 | raise Usage(msg) 77 | 78 | # option processing 79 | for option, value in opts: 80 | if option in ("-z"): 81 | zone = value 82 | tz = pytz.timezone(zone) 83 | if option in ("-h", "--help"): 84 | raise Usage(help_message) 85 | 86 | except Usage, err: 87 | print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg) 88 | print >> sys.stderr, "\t for help use --help" 89 | return 2 90 | 91 | for csn in args: 92 | decodeCSN(csn, tz) 93 | 94 | if __name__ == "__main__": 95 | sys.exit(main()) 96 | 97 | -------------------------------------------------------------------------------- /dsmlQueryService.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | -------------------------------------------------------------------------------- /filterstat.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | """ 4 | filterstat.py 5 | 6 | # CDDL HEADER START 7 | # 8 | # The contents of this file are subject to the terms of the 9 | # Common Development and Distribution License, Version 1.0 only 10 | # (the "License"). You may not use this file except in compliance 11 | # with the License. 12 | # 13 | # You can obtain a copy of the license at 14 | # http://forgerock.org/license/CDDLv1.0.html. 15 | # See the License for the specific language governing permissions 16 | # and limitations under the License. 17 | # 18 | # When distributing Covered Code, include this CDDL HEADER in each 19 | # file and include the License file at 20 | # trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, 21 | # add the following below this CDDL HEADER, with the fields enclosed 22 | # by brackets "[]" replaced with your own identifying information: 23 | # Portions Copyright [yyyy] [name of copyright owner] 24 | # 25 | # CDDL HEADER END 26 | # 27 | # 28 | # Copyright 2013 ForgeRock Inc. 29 | 30 | Created by Ludovic Poitou on 2013-10-11. 31 | 32 | This program reads OpenDJ access logs and output filter statistics. 33 | """ 34 | import sys 35 | import getopt 36 | import re 37 | import string 38 | 39 | help_message = ''' 40 | Usage: filterstat.py [options] file [file ...] 41 | options: 42 | \t -f : keep full original filters 43 | \t -o output : specifies the output file, otherwise stdout is used 44 | \t -v : verbose mode 45 | 46 | file must be an OpenDJ textual access log file 47 | ''' 48 | 49 | class Usage(Exception): 50 | def __init__(self, msg): 51 | self.msg = msg 52 | 53 | 54 | def reduce(string): 55 | pattern = "\(([\w-]+)=([^)\*]+)\)" 56 | f = re.sub(pattern, "(\\1=VALUE)",string, 0) 57 | f = re.sub("\(([\w-]+)=\*([^)\*]+)(\**)\)", "(\\1=*SUBSTRING\\3)",f, 0) 58 | f = re.sub("\(([\w-]+)=([^)\*]+)(\*+)\)", "(\\1=SUBSTRING\\3)",f, 0) 59 | return f 60 | 61 | def main(argv=None): 62 | output = "" 63 | verbose = False 64 | fullFilter = False 65 | baseFilters = dict() 66 | filters = dict() 67 | IDs = {} 68 | if argv is None: 69 | argv = sys.argv 70 | try: 71 | try: 72 | opts, args = getopt.getopt(argv[1:], "fho:v", ["help", "output="]) 73 | except getopt.error, msg: 74 | raise Usage(msg) 75 | 76 | # option processing 77 | for option, value in opts: 78 | if option == "-f": 79 | fullFilter = True 80 | if option == "-v": 81 | verbose = True 82 | if option in ("-h", "--help"): 83 | raise Usage(help_message) 84 | if option in ("-o", "--output"): 85 | output = value 86 | 87 | except Usage, err: 88 | print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg) 89 | print >> sys.stderr, "\t for help use --help" 90 | return 2 91 | 92 | if output != "": 93 | try: 94 | outfile = open(output, "w") 95 | except Usage, err: 96 | print >> sys.stderr, "Can't open output file: " + str(err.msg) 97 | else: 98 | outfile = sys.stdout 99 | 100 | for logfile in args: 101 | try: 102 | infile = open(logfile, "r") 103 | except err: 104 | print >> sys.stderr, "Can't open file: " + str(err.msg) 105 | 106 | 107 | outfile.write("processing file: "+ logfile + "\n") 108 | for i in infile: 109 | m = re.match(".* SEARCH .* scope=(.+) filter=\"(.+)\" attrs.*", i) 110 | if m: 111 | scope = m.group(1) 112 | filter = m.group(2) 113 | 114 | if fullFilter == False : 115 | filter = reduce(filter) 116 | 117 | if scope == "baseObject": 118 | # just count the filters 119 | if filter in baseFilters: 120 | baseFilters[filter] += 1 121 | else: 122 | baseFilters[filter] = 1 123 | else: 124 | if filter in filters: 125 | filters[filter] += 1 126 | else: 127 | filters[filter] = 1 128 | 129 | infile.close() 130 | 131 | ranking = sorted(((v, k) for k, v in filters.iteritems()), reverse=True) 132 | for k, v in ranking: 133 | outfile.write(str(k) +"\t" + v + "\n") 134 | outfile.write("\nBase search filters only:\n") 135 | baseRanking = sorted(((v, k) for k, v in baseFilters.iteritems()), reverse=True) 136 | for k, v in baseRanking: 137 | outfile.write(str(k) +"\t" + v + "\n") 138 | 139 | outfile.write("Done\n") 140 | outfile.close() 141 | if __name__ == "__main__": 142 | sys.exit(main()) 143 | -------------------------------------------------------------------------------- /logconv7.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | # 4 | # BEGIN COPYRIGHT BLOCK 5 | # This Program is free software; you can redistribute it and/or modify it under 6 | # the terms of the GNU General Public License as published by the Free Software 7 | # Foundation; version 2 of the License. 8 | # 9 | # This Program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License along with 14 | # this Program; if not, write to the Free Software Foundation, Inc., 59 Temple 15 | # Place, Suite 330, Boston, MA 02111-1307 USA. 16 | # 17 | # In addition, as a special exception, Red Hat, Inc. gives You the additional 18 | # right to link the code of this Program with code not covered under the GNU 19 | # General Public License ("Non-GPL Code") and to distribute linked combinations 20 | # including the two, subject to the limitations in this paragraph. Non-GPL Code 21 | # permitted under this exception must only link to the code of this Program 22 | # through those well defined interfaces identified in the file named EXCEPTION 23 | # found in the source code files (the "Approved Interfaces"). The files of 24 | # Non-GPL Code may instantiate templates or use macros or inline functions from 25 | # the Approved Interfaces without causing the resulting work to be covered by 26 | # the GNU General Public License. Only Red Hat, Inc. may make changes or 27 | # additions to the list of Approved Interfaces. You must obey the GNU General 28 | # Public License in all respects for all of the Program code and other code used 29 | # in conjunction with the Program except the Non-GPL Code covered by this 30 | # exception. If you modify this file, you may extend this exception to your 31 | # version of the file, but you are not obligated to do so. If you do not wish to 32 | # provide this exception without modification, you must delete this exception 33 | # statement from your version and license this file solely under the GPL without 34 | # exception. 35 | # 36 | # 37 | # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. 38 | # Copyright (C) 2005 Red Hat, Inc. 39 | # Portions Copyright 2012 SmartWave SA. 40 | # Portions Copyright 2012-2013 ForgeRock Inc. 41 | # All rights reserved. 42 | # END COPYRIGHT BLOCK 43 | # 44 | 45 | # 46 | # Check for usage 47 | # 48 | use Time::Local; 49 | 50 | if ($#ARGV < 0){; 51 | &displayUsage; 52 | } 53 | 54 | ####################################### 55 | # # 56 | # parse commandline switches # 57 | # # 58 | ####################################### 59 | 60 | $x = "0"; 61 | $fc = 0; 62 | $sn = 0; 63 | $manager = "cn=directory manager"; 64 | $logversion = "7.0.0"; 65 | $sizeCount = "20"; 66 | $startFlag = 0; 67 | $startTime = 0; 68 | $endFlag = 0; 69 | $endTime = 0; 70 | $config = 1; 71 | 72 | while ($sn <= $#ARGV) 73 | { 74 | if ("$ARGV[$sn]" eq "-d") 75 | { 76 | $manager = $ARGV[++$sn]; 77 | } 78 | elsif ("$ARGV[$sn]" eq "-v") 79 | { 80 | print "Access Log Analyzer v$logversion\n";; 81 | exit (0); 82 | } 83 | elsif ("$ARGV[$sn]" eq "-V") 84 | { 85 | $verb = "yes"; 86 | } 87 | elsif ("$ARGV[$sn]" eq "-X"){ 88 | $exclude[$x] = $ARGV[++$sn]; 89 | $x++; 90 | } 91 | elsif ("$ARGV[$sn]" eq "-s") 92 | { 93 | $sizeCount = $ARGV[++$sn]; 94 | } 95 | elsif ("$ARGV[$sn]" eq "-S") 96 | { 97 | $startTime = $ARGV[++$sn]; 98 | } 99 | elsif ("$ARGV[$sn]" eq "-E") 100 | { 101 | $endTime = $ARGV[++$sn]; 102 | } 103 | elsif ("$ARGV[$sn]" eq "-N") 104 | { 105 | $config = 0; 106 | } 107 | elsif ("$ARGV[$sn]" eq "-h") 108 | { 109 | &displayUsage; 110 | } 111 | elsif ("$ARGV[$sn]" =~ m/^-/){ 112 | $usage = $ARGV[$sn]; 113 | } 114 | else 115 | { 116 | $files[$fc] = $ARGV[$sn]; 117 | $fc++; 118 | } 119 | $sn++; 120 | } 121 | 122 | if ($sizeCount eq "all"){$sizeCount = "100000";} 123 | 124 | ####################################### 125 | # # 126 | # Initialize Arrays and variables # 127 | # # 128 | ####################################### 129 | 130 | print "\nAccess Log Analyzer $logversion\n"; 131 | print "\nCommand : logconv.pl @ARGV\n\n"; 132 | 133 | $dirmgr = "0"; 134 | $notes = "0"; 135 | $vlvnotes= "0"; 136 | $search = "0"; 137 | $fdtake = "0"; 138 | $fdreturn = "0"; 139 | $highfd = "0"; 140 | $bind = "0"; 141 | $unbind = "0"; 142 | $anony = "0"; 143 | $mod = "0"; 144 | $delete = "0"; 145 | $add = "0"; 146 | $moddn = "0"; 147 | $restarts = "0"; 148 | $resource = "0"; 149 | $broken = "0"; 150 | $vlv = "0"; 151 | $version2 = "0"; 152 | $version3 = "0"; 153 | $sortvlv = "0"; 154 | $reset = "0"; 155 | $vet = "0"; 156 | $v = "0"; 157 | $errorck = "0"; 158 | $errorsucc = "0"; 159 | $sslconn = "0"; 160 | $sslClientBind = "0"; 161 | $sslClientFailed = "0"; 162 | $startTLS = 0; 163 | $objectclass= "0"; 164 | $nc = "0"; 165 | $no = "0"; 166 | $nt = "0"; 167 | $nb = "0"; 168 | $bc = "0"; 169 | $fcc = "0"; 170 | $nent = "0"; 171 | $allOps = "0"; 172 | $allResults = "0"; 173 | $bpc = "0"; 174 | $bpo = "0"; 175 | $bpi = 0; 176 | $abandon = "0"; 177 | $mmasterop = "0"; 178 | $extendedop = "0"; 179 | $sasl = "0"; 180 | $internal = "0"; 181 | $entryOp = "0"; 182 | $referral = "0"; 183 | $anyAttrs = "0"; 184 | $persistent = "0"; 185 | $sconn = "0"; 186 | $dconn = "0"; 187 | $aconn = "0"; 188 | $mconn = "0"; 189 | $mdconn = "0"; 190 | $bconn = "0"; 191 | $ubconn = "0"; 192 | $econn = "0"; 193 | $connectionCount = "0"; 194 | $timerange = 0; 195 | $simConnection = 0; 196 | $maxsimConnection = 0; 197 | $deleteExt = 0; 198 | $sortServerSide = 0; 199 | 200 | $err[0] = "Successful Operations\n"; 201 | $err[1] = "Operations Error(s)\n"; 202 | $err[2] = "Protocol Errors\n"; 203 | $err[3] = "Time Limit Exceeded\n"; 204 | $err[4] = "Size Limit Exceeded\n"; 205 | $err[5] = "Compare False\n"; 206 | $err[6] = "Compare True\n"; 207 | $err[7] = "Strong Authentication Not Supported\n"; 208 | $err[8] = "Strong Authentication Required\n"; 209 | $err[9] = "Partial Results\n"; 210 | $err[10] = "Referral Received\n"; 211 | $err[11] = "Administrative Limit Exceeded (Look Through Limit)\n"; 212 | $err[12] = "Unavailable Critical Extension\n"; 213 | $err[13] = "Confidentiality Required\n"; 214 | $err[14] = "SASL Bind in Progress\n"; 215 | $err[16] = "No Such Attribute\n"; 216 | $err[17] = "Undefined Type\n"; 217 | $err[18] = "Inappropriate Matching\n"; 218 | $err[19] = "Constraint Violation\n"; 219 | $err[20] = "Type or Value Exists\n"; 220 | $err[21] = "Invalid Syntax\n"; 221 | $err[32] = "No Such Object\n"; 222 | $err[33] = "Alias Problem\n"; 223 | $err[34] = "Invalid DN Syntax\n"; 224 | $err[35] = "Is Leaf\n"; 225 | $err[36] = "Alias Deref Problem\n"; 226 | $err[48] = "Inappropriate Authentication (No password presented, etc)\n"; 227 | $err[49] = "Invalid Credentials (Bad Password)\n"; 228 | $err[50] = "Insufficent (write) Privledges\n"; 229 | $err[51] = "Busy\n"; 230 | $err[52] = "Unavailable\n"; 231 | $err[53] = "Unwilling To Perform\n"; 232 | $err[54] = "Loop Detected\n"; 233 | $err[60] = "Sort Control Missing\n"; 234 | $err[61] = "Index Range Error\n"; 235 | $err[64] = "Naming Violation\n"; 236 | $err[65] = "Objectclass Violation\n"; 237 | $err[66] = "Not Allowed on Non Leaf\n"; 238 | $err[67] = "Not Allowed on RDN\n"; 239 | $err[68] = "Already Exists\n"; 240 | $err[69] = "No Objectclass Mods\n"; 241 | $err[70] = "Results Too Large\n"; 242 | $err[71] = "Effect Multiple DSA's\n"; 243 | $err[80] = "Other :-)\n"; 244 | $err[81] = "Server Down\n"; 245 | $err[82] = "Local Error\n"; 246 | $err[83] = "Encoding Error\n"; 247 | $err[84] = "Decoding Error\n"; 248 | $err[85] = "Timeout\n"; 249 | $err[86] = "Authentication Unknown\n"; 250 | $err[87] = "Filter Error\n"; 251 | $err[88] = "User Canceled\n"; 252 | $err[89] = "Parameter Error\n"; 253 | $err[90] = "No Memory\n"; 254 | $err[91] = "Connect Error\n"; 255 | $err[92] = "Not Supported\n"; 256 | $err[93] = "Control Not Found\n"; 257 | $err[94] = "No Results Returned\n"; 258 | $err[95] = "More Results To Return\n"; 259 | $err[96] = "Client Loop\n"; 260 | $err[97] = "Referral Limit Exceeded\n"; 261 | $err[118] = "Canceled\n"; 262 | $err[119] = "No Such Operation\n"; 263 | $err[120] = "Too Late\n"; 264 | $err[121] = "Cannot Cancel\n"; 265 | $err[122] = "Assertion Failed\n"; 266 | $err[123] = "Authorization Denied\n"; 267 | 268 | $conn{"A1"} = "A1"; 269 | $conn{"B1"} = "B1"; 270 | $conn{"B4"} = "B4"; 271 | $conn{"T1"} = "T1"; 272 | $conn{"T2"} = "T2"; 273 | $conn{"B2"} = "B2"; 274 | $conn{"B3"} = "B3"; 275 | $conn{"R1"} = "R1"; 276 | $conn{"P1"} = "P1"; 277 | $conn{"P2"} = "P2"; 278 | $conn{"U1"} = "U1"; 279 | 280 | $connmsg{"A1"} = "Client Aborted Connections"; 281 | $connmsg{"B1"} = "Bad Ber Tag Encountered"; 282 | $connmsg{"B4"} = "Server failed to flush data (response) back to Client"; 283 | $connmsg{"T1"} = "Idle Timeout Exceeded"; 284 | $connmsg{"T2"} = "IO Block Timeout Exceeded or NTSSL Timeout"; 285 | $connmsg{"B2"} = "Ber Too Big"; 286 | $connmsg{"B3"} = "Ber Peek"; 287 | $connmsg{"R1"} = "Revents"; 288 | $connmsg{"P1"} = "Plugin"; 289 | $connmsg{"P2"} = "Poll"; 290 | $connmsg{"U1"} = "Cleanly Closed Connections"; 291 | 292 | %monthname = ( 293 | "Jan" => 0, 294 | "Feb" => 1, 295 | "Mar" => 2, 296 | "Apr" => 3, 297 | "May" => 4, 298 | "Jun" => 5, 299 | "Jul" => 6, 300 | "Aug" => 7, 301 | "Sep" => 8, 302 | "Oct" => 9, 303 | "Nov" => 10, 304 | "Dec" => 11, 305 | ); 306 | 307 | ########################################## 308 | # # 309 | # Parse Access Logs # 310 | # # 311 | ########################################## 312 | 313 | if ($files[$#files] =~ m/access.rotationinfo/) { $fc--; } 314 | 315 | print "Processing $fc Access Log(s)...\n\n"; 316 | 317 | print "Filename\t\t\tTotal Lines\tLines processed\n"; 318 | print "---------------------------------------------------------------\n"; 319 | for ($count=0; $count < $fc; $count++) { 320 | 321 | $logsize = `wc -l $files[$count]`; 322 | $logsize =~ /([0-9]+)/; 323 | $ff="";$iff=""; 324 | print sprintf "%-30s %7s",$files[$count],$1; 325 | open(LOG,"$files[$count]") || die "Error: Can't open file $infile: $!"; 326 | 327 | $firstline = "yes"; 328 | while () { 329 | unless ($endFlag) { 330 | if ($firstline eq "yes") { 331 | if (/^\[/) { 332 | $tline = $_; 333 | $firstline = "no"; 334 | } 335 | $ff++;$iff++; 336 | } elsif (/^\[/ && $firstline eq "no") { 337 | &parseLine($tline); 338 | $tline = $_; 339 | } else { 340 | $tline = $tline . $_; 341 | $tline =~ s/\n//; 342 | } 343 | } 344 | } 345 | &parseLine($tline); 346 | close (LOG); 347 | print sprintf "\t\t%10s\n",--$ff; 348 | } 349 | 350 | #$notes = $notes - $vlvnotes; 351 | if ($notes < 0){ $notes = "0";} 352 | 353 | $allOps = $search + $mod + $add + $delete + $moddn + $bind + $extendedop; 354 | 355 | ##################################### 356 | # # 357 | # Display Basic Results # 358 | # # 359 | ##################################### 360 | 361 | 362 | print "\n\n----------- Access Log Output ------------\n"; 363 | if ($startTime) {print "\nStart of Log: $start\n";} 364 | if ($endTime) {print "\nEnd of Log: $end\n";} 365 | print "\nRestarts: $restarts\n"; 366 | print "\n"; 367 | print "Total Connections: $connectionCount\n"; 368 | print "Peak Concurrent Connections: $maxsimConnection\n"; 369 | print "Total Operations: $allOps\n"; 370 | print "Total Results: $allResults\n"; 371 | if ($allOps ne "0"){ 372 | print sprintf "Overall Performance: %.1f%\n\n" , ($perf = ($tmp = ($allResults / $allOps)*100) > 100 ? 100.0 : $tmp) ; 373 | } else { 374 | print "Overall Performance: No Operations to evaluate\n\n"; 375 | } 376 | print "Searches: $search\n"; 377 | print "Modifications: $mod\n"; 378 | print "Adds: $add\n"; 379 | print "Deletes: $delete\n"; 380 | print "Mod DNs: $moddn\n"; 381 | print "Delete Subtree $deleteExt\n"; 382 | print "Sort Server Side $sortServerSide\n"; 383 | print "\n"; 384 | print "Persistent Searches: $persistent\n"; 385 | print "Internal Operations: $internal\n"; 386 | print "Entry Operations: $entryOp\n"; 387 | print "Extended Operations: $extendedop\n"; 388 | print "Abandoned Requests: $abandon\n"; 389 | print "Smart Referrals Received: $referral\n"; 390 | print "\n"; 391 | print "VLV Operations: $vlv\n"; 392 | print "VLV Unindexed Searches: $vlvnotes\n"; 393 | print "SORT VLV Operations: $sortvlv\n"; 394 | print "SSL Connections: $sslconn\n"; 395 | print "\n"; 396 | print "Entire Search Base Queries: $objectclass\n"; 397 | print "Unindexed Searches: $notes\n"; 398 | if ($verb eq "yes" || $usage =~ /u/){ 399 | if ($notes > 0){ 400 | $ns = "1"; 401 | for ($n = 0; $n <= $#notesEtime; $n++){ 402 | @alreadyseenDN = (); 403 | print "\n Unindexed Search #".$ns."\n"; 404 | $ns++; 405 | print " - Date/Time: $notesTime[$n]\n"; 406 | print " - Connection Number: $notesConn[$n]\n"; 407 | print " - Operation Number: $notesOp[$n]\n"; 408 | print " - Etime: $notesEtime[$n]\n"; 409 | print " - Nentries: $notesNentries[$n]\n"; 410 | print " - IP Address: $conn_hash{$notesConn[$n]}\n"; 411 | print " - Search Base: $notesBase[$n]\n"; 412 | print " - Scope: $notesScope[$n]\n"; 413 | for ($nn = 0; $nn <= $bc; $nn++){ 414 | if ($notesConn[$n] eq $bindInfo[$nn][1]) { 415 | 416 | ## Here, we check if the bindDN is already printed. 417 | ## If not, we print it and push it to @alreadyseenDN. 418 | ## So, in the beginning, we iterate thru @alreadyseenDN 419 | 420 | for ($j=0, $DNisThere=0; $j <=$#alreadyseenDN; $j++) { 421 | if ($alreadyseenDN[$j] eq $bindInfo[$nn][0]) { 422 | $DNisThere = 1; 423 | } 424 | } 425 | unless ($DNisThere) { 426 | print " - Bind DN: $bindInfo[$nn][0]\n"; 427 | push @alreadyseenDN, $bindInfo[$nn][0]; 428 | } 429 | } 430 | } 431 | for ($nnn = 0; $nnn <= $fcc; $nnn++){ 432 | if ($notesConn[$n] eq $filterInfo[$nnn][1] && $notesOp[$n] eq $filterInfo[$nnn][2]){ 433 | print " - Search Filter: $filterInfo[$nnn][0]\n"; 434 | } 435 | } 436 | } 437 | } 438 | } 439 | 440 | print "\n"; 441 | print "FDs Taken: $fdtake\n"; 442 | print "FDs Returned: $fdreturn\n"; 443 | # print "Highest FD Taken: $highfd\n\n"; 444 | print "Broken Pipes: $broken\n"; 445 | if ($broken > 0){ 446 | foreach $key (sort { $rc{$b} <=> $rc{$a} } keys %rc) { 447 | if ($rc{$key} > 0){ 448 | if ($conn{$key} eq ""){$conn{$key} = "** Unknown **";} 449 | push @etext, sprintf " - %-4s (%2s) %-40s\n",$rc{$key},$conn{$key},$connmsg{$key}; 450 | } 451 | } 452 | print @etext; 453 | print "\n"; 454 | } 455 | 456 | print "Connections Reset By Peer: $reset\n"; 457 | if ($reset > 0){ 458 | foreach $key (sort { $src{$b} <=> $src{$a} } keys %src) { 459 | if ($src{$key} > 0){ 460 | if ($conn{$key} eq ""){$conn{$key} = "** Unknown **";} 461 | push @retext, sprintf " - %-4s (%2s) %-40s\n",$src{$key},$conn{$key},$connmsg{$key}; 462 | } 463 | } 464 | print @retext; 465 | print "\n"; 466 | } 467 | 468 | print "Resource Unavailable: $resource\n"; 469 | if ($resource > 0){ 470 | foreach $key (sort { $rsrc{$b} <=> $rsrc{$a} } keys %rsrc) { 471 | if ($rsrc{$key} > 0){ 472 | if ($conn{$key} eq ""){$conn{$key} = "** Resource Issue **";} 473 | push @rtext, sprintf " - %-4s (%2s) %-40s\n",$rsrc{$key},$conn{$key},$connmsg{$key}; 474 | } 475 | } 476 | print @rtext; 477 | } 478 | print "\n"; 479 | print "Binds: $bind\n"; 480 | print "Unbinds: $unbind\n"; 481 | print "\n"; 482 | print " LDAP v2 Binds: $version2\n"; 483 | print " LDAP v3 Binds: $version3\n"; 484 | print " SSL Client Binds: $sslClientBind\n"; 485 | print " Failed SSL Client Binds: $sslClientFailed\n"; 486 | print " Start TLS: $startTLS\n"; 487 | print " SASL Binds: $sasl\n"; 488 | if ($sasl > 0){ 489 | foreach $saslb ( sort {$saslmech{$b} <=> $saslmech{$a} } (keys %saslmech) ){ 490 | printf " %-4s %-12s\n",$saslmech{$saslb}, $saslb; 491 | } 492 | } 493 | 494 | print "\n Directory Manager Binds: $dirmgr\n"; 495 | print " Anonymous Binds: $anony\n"; 496 | $other = $bind -($dirmgr + $anony); 497 | print " Other Binds: $other"; 498 | 499 | if ($verb eq "yes" || $usage =~ /y/){ 500 | print "\n\n----- Connection Duration Details -----\n\n"; 501 | print " (in seconds)\t\t<=1\t2\t3\t4-5\t6-10\t11-15\t>15\n"; 502 | print " --------------------------------------------------------------------------\n"; 503 | print " (# of connections)\t"; 504 | for ($i=0; $i <=$#latency; $i++) { 505 | print "$latency[$i]\t"; 506 | } 507 | } 508 | 509 | if ($verb eq "yes" || $usage =~ /p/){ 510 | print "\n\n----- Current Open Connection IDs ----- \n\n"; 511 | for ($i=0; $i <= $#openConnection ; $i++) { 512 | if ($openConnection[$i]) { 513 | print "\t$i\n"; 514 | } 515 | } 516 | } 517 | 518 | ################################### 519 | # # 520 | # Display Error Codes # 521 | # # 522 | ################################### 523 | 524 | if ($usage =~ /e/i || $verb eq "yes"){ 525 | print "\n\n----- Errors -----\n"; 526 | 527 | %er = sort( {$b <=> $a} %er); 528 | for ($i = 0; $i<98; $i++){ 529 | if ($err[$i] ne "" && $er[$i] >0) { 530 | push @errtext, sprintf "%-8s %12s %-25s","err=$i",$er[$i],$err[$i]; 531 | } 532 | } 533 | 534 | for ($i = 0; $i < $#errtext; $i++){ 535 | for ($ii = 0; $ii < $#errtext; $ii++){ 536 | $yy="0"; 537 | $zz="0"; 538 | while ($errtext[$ii] =~ /(\w+)\s/g){ 539 | $errornum[$yy]="$1"; 540 | $yy++; 541 | } 542 | while ($errtext[$ii+1] =~ /(\w+)\s/g){ 543 | $errornum2[$zz]="$1"; 544 | $zz++; 545 | } 546 | 547 | if ($errornum2[1] > $errornum[1]){ 548 | $tmp = $errtext[$ii]; 549 | $errtext[$ii] = $errtext[$ii+1]; 550 | $errtext[$ii+1] = $tmp; 551 | } 552 | } 553 | } 554 | 555 | for ($i = 0; $i <= $#errtext; $i++){ 556 | $errtext[$i] =~ s/\n//g; 557 | print "\n" . $errtext[$i]; 558 | } 559 | } 560 | 561 | #################################### 562 | # # 563 | # Print Failed Logins # 564 | # # 565 | #################################### 566 | 567 | if ($verb eq "yes" || $usage =~ /f/i ){ 568 | if ($bpc > 0){ 569 | print "\n\n----- Top $sizeCount Failed Logins ------\n\n"; 570 | 571 | $eloop = "0"; 572 | foreach $dsbp (sort { $ds6xbadpwd{$b} <=> $ds6xbadpwd{$a} } keys %ds6xbadpwd) { 573 | $eloop++; 574 | if ($eloop > $sizeCount){ last; } 575 | printf "%-4s %-40s\n", $ds6xbadpwd{$dsbp}, $dsbp; 576 | } 577 | } 578 | } 579 | 580 | 581 | #################################### 582 | # # 583 | # Print Connection Codes # 584 | # # 585 | #################################### 586 | 587 | 588 | if ($concount > 0){ 589 | if ($usage =~ /c/i || $verb eq "yes"){ 590 | print "\n\n----- Total Connection Codes -----\n\n"; 591 | 592 | foreach $key (sort { $conncount{$b} <=> $conncount{$a} } keys %conncount) { 593 | if ($conncount{$key} > 0){ 594 | push @conntext, sprintf "%-4s %6s %-40s\n",$conn{ $key },$conncount{$key},$connmsg{ $key }; 595 | } 596 | } 597 | print @conntext; 598 | } 599 | } 600 | 601 | ######################################## 602 | # # 603 | # Gather and Process all unique IPs # 604 | # # 605 | ######################################## 606 | 607 | if ($usage =~ /i/i || $verb eq "yes"){ 608 | @ipkeys = keys %ip_hash; 609 | @exxCount = keys %exCount; 610 | $ip_count = ($#ipkeys + 1)-($#exxCount + 1); 611 | if ($ip_count > 0){ 612 | print "\n\n----- Top $sizeCount Clients -----\n\n"; 613 | print "Number of Clients: $ip_count\n\n"; 614 | 615 | foreach $key (sort { $ip_hash{$b}{"count"} <=> $ip_hash{$a}{"count"} } keys %ip_hash) { 616 | $exc = "no"; 617 | if ($ccount > $sizeCount){ last;} 618 | $ccount++; 619 | for ($xxx =0; $xxx <= $#exclude; $xxx++){ 620 | if ($exclude[$xxx] eq $key){$exc = "yes";} 621 | } 622 | if ($exc ne "yes"){ 623 | if ($ip_hash{ $key }{"count"} eq ""){$ip_hash{ $key }{"count"} = "*";} 624 | printf "%-6s %-17s\n", $ip_hash{ $key }{"count"}, $key; 625 | } 626 | 627 | if ($exc ne "yes"){ 628 | foreach $code (sort { $ip_hash{ $key }{$b} <=> $ip_hash{ $key }{$a} } keys %{$ip_hash{ $key }}) { 629 | if ($code eq 'count' ) { next; } 630 | printf "\t\t %6s - %3s %s\n", $ip_hash{ $key }{ $code }, $code, $connmsg{ $code }; 631 | } 632 | } 633 | 634 | if ($exc ne "yes"){ print "\n";} 635 | } 636 | } 637 | } 638 | 639 | 640 | 641 | ################################### 642 | # # 643 | # Gather All unique Bind DNs # 644 | # # 645 | ################################### 646 | 647 | if ($usage =~ /b/i || $verb eq "yes"){ 648 | @bindkeys = keys %bindlist; 649 | $bind_count = $#bindkeys + 1; 650 | if ($bind_count > 0){ 651 | print "\n----- Top $sizeCount Bind DNs -----\n\n"; 652 | print "Number of Unique Bind DN's: $bind_count\n\n"; 653 | 654 | $bindcount = 0; 655 | 656 | foreach $dn (sort { $bindlist{$b} <=> $bindlist{$a} } keys %bindlist) { 657 | if ($bindcount < $sizeCount){ 658 | printf "%-8s %-40s\n", $bindlist{ $dn },$dn; 659 | } 660 | $bindcount++; 661 | } 662 | } 663 | } 664 | 665 | 666 | ######################################### 667 | # # 668 | # Gather and process search bases # 669 | # # 670 | ######################################### 671 | 672 | if ($usage =~ /a/i || $verb eq "yes"){ 673 | @basekeys = keys %base; 674 | $base_count = $#basekeys + 1; 675 | if ($base_count > 0){ 676 | print "\n\n----- Top $sizeCount Search Bases -----\n\n"; 677 | print "Number of Unique Search Bases: $base_count\n\n"; 678 | 679 | $basecount = 0; 680 | 681 | foreach $bas (sort { $base{$b} <=> $base{$a} } keys %base) { 682 | if ($bas !~ m/.*cn=config$/){ # Requested by AMR - SMW 683 | if ($basecount < $sizeCount){ 684 | printf "%-8s %-40s\n", $base{ $bas },$bas; 685 | } 686 | $basecount++; 687 | } 688 | } 689 | } 690 | } 691 | 692 | ######################################### 693 | # # 694 | # Gather and process search filters # 695 | # # 696 | ######################################### 697 | 698 | if ($usage =~ /l/ || $verb eq "yes"){ 699 | 700 | @filterkeys = keys %filter; 701 | $filter_count = $#filterkeys + 1; 702 | if ($filter_count > 0){ 703 | print "\n\n----- Top $sizeCount Search Filters -----\n"; 704 | print "\nNumber of Unique Search Filters: $filter_count\n\n"; 705 | 706 | $filtercount = 0; 707 | 708 | foreach $filt (sort { $filter{$b} <=> $filter{$a} } keys %filter){ 709 | if ($config) { 710 | if ($filtercount < $sizeCount){ 711 | printf "%-8s %-40s\n", $filter{$filt}, $filt; 712 | $filtercount++; 713 | } 714 | } else { 715 | if ($filt !~ m/^\(objectclass=ds-cfg-.*$/){ 716 | if ($filtercount < $sizeCount){ 717 | printf "%-8s %-40s\n", $filter{$filt}, $filt; 718 | } 719 | $filtercount++; 720 | } 721 | } 722 | } 723 | } 724 | } 725 | 726 | ######################################### 727 | # # 728 | # Gather and Process the unique etimes # 729 | # # 730 | ######################################### 731 | 732 | 733 | # 734 | # print most often etimes 735 | # 736 | 737 | if ($usage =~ /t/i || $verb eq "yes"){ 738 | print "\n\n----- Top $sizeCount Most Frequent etimes -----\n\n"; 739 | $eloop = 0; 740 | foreach $et (sort { $etime{$b} <=> $etime{$a} } keys %etime) { 741 | if ($eloop == $sizeCount) { last; } 742 | if ($retime ne "2"){ 743 | $first = $et; 744 | $retime = "2"; 745 | } 746 | printf "%-8s %-12s\n", $etime{ $et }, "etime=$et"; 747 | $eloop++; 748 | } 749 | 750 | # 751 | # print longest etimes 752 | # 753 | 754 | print "\n\n----- Top $sizeCount Longest etimes -----\n\n"; 755 | $eloop = 0; 756 | foreach $et (sort { $b <=> $a } (keys %etime)) { 757 | if ($eloop == $sizeCount) { last; } 758 | printf "%-12s %-10s\n","etime=$et",$etime{ $et }; 759 | $eloop++; 760 | } 761 | } 762 | 763 | ####################################### 764 | # # 765 | # Gather and Process unique nentries # 766 | # # 767 | ####################################### 768 | 769 | 770 | if ($usage =~ /n/i || $verb eq "yes"){ 771 | print "\n\n----- Top $sizeCount Largest nentries -----\n\n"; 772 | $eloop = 0; 773 | foreach $nentry (sort { $b <=> $a } (keys %nentries)){ 774 | if ($eloop == $sizeCount) { last; } 775 | printf "%-18s %12s\n","nentries=$nentry", $nentries{ $nentry }; 776 | $eloop++; 777 | } 778 | 779 | print "\n\n----- Top $sizeCount Most returned nentries -----\n\n"; 780 | $eloop = 0; 781 | foreach $nentry (sort { $nentries{$b} <=> $nentries{$a} } (keys %nentries)){ 782 | if ($eloop == $sizeCount) { last; } 783 | printf "%-12s %-14s\n", $nentries{ $nentry }, "nentries=$nentry"; 784 | $eloop++; 785 | } 786 | 787 | print "\n"; 788 | } 789 | 790 | 791 | ########################################## 792 | # # 793 | # Gather and process extended operations # 794 | # # 795 | ########################################## 796 | 797 | if ($usage =~ /x/i || $verb eq "yes"){ 798 | 799 | if ($extendedop > 0){ 800 | print "\n\n----- Extended Operations -----\n\n"; 801 | foreach $oids (sort { $oid{$b} <=> $oid{$a} } (keys %oid) ){ 802 | # This is the list of supported Extended Operations in OpenDJ 803 | if ($oids eq "1.3.6.1.1.8"){ $oidmessage = "Cancel Operation"} 804 | elsif ($oids eq "1.3.6.1.4.1.26027.1.6.2"){ $oidmessage = "Get Connection ID"} 805 | elsif ($oids eq "1.3.6.1.4.1.4203.1.11.1"){ $oidmessage = "Password Modify"} 806 | elsif ($oids eq "1.3.6.1.4.1.26027.1.6.1"){ $oidmessage = "Password Policy State"} 807 | elsif ($oids eq "1.3.6.1.4.1.1466.20037"){ $oidmessage = "Start TLS"} 808 | elsif ($oids eq "1.3.6.1.4.1.4203.1.11.3"){ $oidmessage = "Who Am I ?"} 809 | else {$oidmessage = "Other"} 810 | 811 | printf "%-6s %-23s %-60s\n", $oid{ $oids }, $oids, $oidmessage; 812 | } 813 | } 814 | } 815 | 816 | ############################################ 817 | # 818 | # Print most commonly requested attributes 819 | # 820 | ############################################ 821 | 822 | if ($usage =~ /r/i || $verb eq "yes"){ 823 | if ($anyAttrs > 0){ 824 | print "\n\n----- Top $sizeCount Most Requested Attributes -----\n\n"; 825 | $eloop = "0"; 826 | foreach $mostAttr (sort { $attr{$b} <=> $attr{$a} } (keys %attr) ){ 827 | if ($eloop eq $sizeCount){ last; } 828 | if ($config){ 829 | printf "%-10s %-19s\n", $attr{$mostAttr}, $mostAttr; 830 | $eloop++; 831 | } else { 832 | if (grep(!/^ds-cfg-/,split(',',$mostAttr))) { 833 | printf "%-10s %-19s\n", $attr{$mostAttr}, $mostAttr; 834 | $eloop++; 835 | } 836 | } 837 | } 838 | } 839 | } 840 | 841 | ################################# 842 | # 843 | # abandoned operation stats 844 | # 845 | ################################# 846 | 847 | if ($usage =~ /g/i || $verb eq "yes"){ 848 | $acTotal = $sconn + $dconn + $mconn + $aconn + $mdconn + $bconn + $ubconn + $econn; 849 | if ($verb eq "yes" && $ac > 0 && $acTotal > 0){ 850 | 851 | print "\n\n----- Abandon Request Stats -----\n\n"; 852 | 853 | for ($g = 0; $g < $ac; $g++){ 854 | for ($sc = 0; $sc < $sconn; $sc++){ 855 | if ($srchConn[$sc] eq $targetConn[$g] && $srchOp[$sc] eq $targetOp[$g] ){ 856 | print " - SEARCH conn=$targetConn[$g] op=$targetOp[$g] msgid=$msgid[$g] client=$conn_hash{$targetConn[$g]}\n"; 857 | } 858 | } 859 | for ($dc = 0; $dc < $dconn; $dc++){ 860 | if ($delConn[$dc] eq $targetConn[$g] && $delOp[$dc] eq $targetOp[$g]){ 861 | print " - DELETE conn=$targetConn[$g] op=$targetOp[$g] msgid=$msgid[$g] client=$conn_hash{$targetConn[$g]}\n"; 862 | } 863 | } 864 | for ($adc = 0; $adc < $aconn; $adc++){ 865 | if ($addConn[$adc] eq $targetConn[$g] && $addOp[$adc] eq $targetOp[$g]){ 866 | print " - ADD conn=$targetConn[$g] op=$targetOp[$g] msgid=$msgid[$g] client=$conn_hash{$targetConn[$g]}\n"; 867 | } 868 | } 869 | for ($mc = 0; $mc < $mconn; $mc++){ 870 | if ($modConn[$mc] eq $targetConn[$g] && $modOp[$mc] eq $targetOp[$g]){ 871 | print " - MODIFY conn=$targetConn[$g] op=$targetOp[$g] msgid=$msgid[$g] client=$conn_hash{$targetConn[$g]}\n"; 872 | } 873 | } 874 | for ($mdc = 0; $mdc < $mdconn; $mdc++){ 875 | if ($moddnConn[$mdc] eq $targetConn[$g] && $moddnOp[$mdc] eq $targetOp[$g]){ 876 | print " - MODIFYDN conn=$targetConn[$g] op=$targetOp[$g] msgid=$msgid[$g] client=$conn_hash{$targetConn[$g]}\n"; 877 | } 878 | } 879 | for ($bcb = 0; $bcb < $bconn; $bcb++){ 880 | if ($bindConn[$bcb] eq $targetConn[$g] && $bindOp[$bcb] eq $targetOp[$g]){ 881 | print " - BIND conn=$targetConn[$g] op=$targetOp[$g] msgid=$msgid[$g] client=$conn_hash{$targetConn[$g]}\n"; 882 | } 883 | } 884 | for ($ubc = 0; $ubc < $ubconn; $ubc++){ 885 | if ($unbindConn[$ubc] eq $targetConn[$g] && $unbindOp[$ubc] eq $targetOp[$g]){ 886 | print " - UNBIND conn=$targetConn[$g] op=$targetOp[$g] msgid=$msgid[$g] client=$conn_hash{$targetConn[$g]}\n"; 887 | } 888 | } 889 | for ($ec = 0; $ec < $econn; $ec++){ 890 | if ($extConn[$ec] eq $targetConn[$g] && $extOp[$ec] eq $targetOp[$g]){ 891 | print " - EXTENDED conn=$targetConn[$g] op=$targetOp[$g] msgid=$msgid[$g] client=$conn_hash{$targetConn[$g]}\n"; 892 | } 893 | } 894 | } 895 | } 896 | } 897 | 898 | 899 | 900 | print "\n"; 901 | 902 | ####################################### 903 | # # 904 | # Recommendations # 905 | # # 906 | ####################################### 907 | 908 | if ($usage =~ /j/i || $verb eq "yes"){ 909 | print "\n----- Recommendations -----\n"; 910 | $recCount = "1"; 911 | if ($notes > 0){ 912 | print "\n $recCount. You have unindexed searches, this can be caused from a search on an unindexed attribute, or your returned results exceeded the index-entry-limit. Unindexed searches are not recommended. You can allow or reject unindexed search by granting or revocating the \"unindexed-search\" privilege.\n"; 913 | $recCount++; 914 | } 915 | 916 | if ($conncount{"T1"} > 0){ 917 | print "\n $recCount. You have some connections that are are being closed by the idletimeout setting. You may want to increase the idletimeout if it is set low.\n"; 918 | $recCount++; 919 | } 920 | 921 | if ($conncount{"T2"} > 0){ 922 | print "\n $recCount. You have some coonections that are being closed by the ioblocktimeout setting. You may want to increase the ioblocktimeout.\n"; 923 | $recCount++; 924 | } 925 | 926 | # compare binds to unbinds, if the difference is more than 30% of the binds, then report a issue 927 | 928 | if (($bind - $unbind) > ($bind*.3)){ 929 | print "\n $recCount. You have a significant difference between binds and unbinds. You may want to investigate this difference.\n"; 930 | $recCount++; 931 | } 932 | 933 | # compare fds taken and return, if the difference is more than 30% report a issue 934 | 935 | if (($fdtake -$fdreturn) > ($fdtake*.3)){ 936 | print "\n $recCount. You have a significant difference between file descriptors taken and file descriptors returned. You may want to investigate this difference.\n"; 937 | $recCount++; 938 | } 939 | 940 | if ($dirmgr > ($bind *.2)){ 941 | print "\n $recCount. You have a high number of Directory Manager binds. The Directory Manager account should only be used under certain circumstances. Avoid using this account for client applications.\n"; 942 | $recCount++; 943 | } 944 | 945 | if ($errorck > $errorsucc){ 946 | print "\n $recCount. You have more unsuccessful operations than successful operations. You should investigate this difference.\n"; 947 | $recCount++; 948 | } 949 | 950 | if ($conncount{"U1"} < ($concount - $conncount{"U1"})){ 951 | print "\n $recCount. You have more abnormal connection codes than cleanly closed connections. You may want to investigate this difference.\n"; 952 | $recCount++; 953 | } 954 | 955 | if ($first > 0){ 956 | print "\n $recCount. You have a majority of etimes that are greater than zero, you may want to investigate this performance problem.\n"; 957 | $recCount++; 958 | } 959 | 960 | if ($objectclass > ($search *.25)){ 961 | print "\n $recCount. You have a high number of searches that query the entire search base. Although this is not necessarily bad, it could be resource intensive if the search base contains many entries.\n"; 962 | $recCount++; 963 | } 964 | 965 | if ($recCount == 1){ 966 | print "\nNone.\n"; 967 | } 968 | } 969 | 970 | print "\n"; 971 | # dispaly usage 972 | 973 | sub displayUsage { 974 | 975 | print "Usage:\n\n"; 976 | 977 | print " ./logconv.pl [-h] [-d ] [-s ] [-v] [-V]\n"; 978 | print " [-S ] [-E ]\n"; 979 | print " [-efcibaltnxgju] [ access log ... ... ]"; 980 | print "\n\n"; 981 | 982 | print "- Commandline Switches:\n\n"; 983 | 984 | print " -h help/usage\n"; 985 | print " -d DEFAULT -> cn=directory manager\n"; 986 | print " -s DEFAULT -> 20\n"; 987 | print " -X E.g. Load balancers\n"; 988 | print " -v show version of tool\n"; 989 | print " -S