[#376] FIX SNMP monitoring config (#381)
| | |
| | | Server Monitoring MIB</link>.</para> |
| | | |
| | | <para>OpenDJ SNMP-based monitoring depends on OpenDMK, which you must |
| | | <link xlink:href="http://opendmk.java.net/download/" xlink:show="new">download |
| | | separately</link>. Install the <link xlink:show="new" |
| | | xlink:href="http://java.net/projects/opendmk/content/download/opendmk-1.0-b02-bin-dual-01-Oct-2007_19-17-46.jar" |
| | | >Full Binary Bundle</link> by using the graphical installer, which requires |
| | | that you accept the <link xlink:show="new" |
| | | xlink:href="http://java.net/projects/opendmk/content/legal_notices/LICENSE_BINARY.txt" |
| | | >Binary License for Project OpenDMK</link>. OpenDJ directory server that you |
| | | download from ForgeRock is built with OpenDMK, but due to licensing OpenDMK |
| | | <link xlink:href="https://github.com/OpenIdentityPlatform/OpenDJ/raw/master/opendj-server-legacy/opendmk/jdmkrt.jar" xlink:show="new">download |
| | | separately</link>. OpenDJ directory server that you |
| | | download from GitHub is built with OpenDMK, but due to licensing OpenDMK |
| | | is not part of OpenDJ. SNMP is therefore not enabled by default.</para> |
| | | |
| | | <para>To run the OpenDMK installer, use the self-extracting .jar.</para> |
| | |
| | | rem
|
| | | rem Copyright 2008-2010 Sun Microsystems, Inc.
|
| | | rem Portions Copyright 2011-2016 ForgeRock AS.
|
| | | rem Portions Copyright 2020-2024 3A Systems, LLC.
|
| | |
|
| | | set SET_JAVA_HOME_AND_ARGS_DONE=false
|
| | | set SET_ENVIRONMENT_VARS_DONE=false
|
| | |
| | | set PATH=%SystemRoot%;%PATH%
|
| | | set SCRIPT_NAME_ARG=-Dorg.opends.server.scriptName=%SCRIPT_NAME%
|
| | | set SET_ENVIRONMENT_VARS_DONE=true
|
| | | "%OPENDJ_JAVA_BIN%" --add-exports java.base/sun.security.x509=ALL-UNNAMED --add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED --version > NUL 2>&1
|
| | | "%OPENDJ_JAVA_BIN%" --add-exports java.base/sun.security.x509=ALL-UNNAMED --add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED --add-opens java.base/jdk.internal.loader=ALL-UNNAMED --version > NUL 2>&1
|
| | | set RESULT_CODE=%errorlevel%
|
| | | if %RESULT_CODE% == 0 set OPENDJ_JAVA_ARGS=%OPENDJ_JAVA_ARGS% --add-exports java.base/sun.security.x509=ALL-UNNAMED --add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED
|
| | | if %RESULT_CODE% == 0 set OPENDJ_JAVA_ARGS=%OPENDJ_JAVA_ARGS% --add-exports java.base/sun.security.x509=ALL-UNNAMED --add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
|
| | | goto scriptBegin
|
| | |
|
| | | :testJava
|
| | |
| | | # |
| | | # Copyright 2008-2010 Sun Microsystems, Inc. |
| | | # Portions Copyright 2010-2016 ForgeRock AS. |
| | | |
| | | # Portions Copyright 2019-2024 3A Systems, LLC. |
| | | # |
| | | # Display an error message |
| | | # |
| | |
| | | SCRIPT_NAME_ARG=-Dorg.opends.server.scriptName=${SCRIPT_NAME} |
| | | export SCRIPT_NAME_ARG |
| | | |
| | | "${OPENDJ_JAVA_BIN}" --add-exports java.base/sun.security.x509=ALL-UNNAMED --add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED --version > /dev/null 2>&1 |
| | | "${OPENDJ_JAVA_BIN}" --add-exports java.base/sun.security.x509=ALL-UNNAMED --add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED --add-opens java.base/jdk.internal.loader=ALL-UNNAMED --version > /dev/null 2>&1 |
| | | RESULT_CODE=${?} |
| | | if test ${RESULT_CODE} -eq 0 |
| | | then |
| | | export OPENDJ_JAVA_ARGS="$OPENDJ_JAVA_ARGS --add-exports java.base/sun.security.x509=ALL-UNNAMED --add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED" |
| | | export OPENDJ_JAVA_ARGS="$OPENDJ_JAVA_ARGS --add-exports java.base/sun.security.x509=ALL-UNNAMED --add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED --add-opens java.base/jdk.internal.loader=ALL-UNNAMED" |
| | | fi |
| | | } |
| | | |
| | |
| | | information: "Portions Copyright [year] [name of copyright owner]". |
| | | |
| | | Copyright 2015-2016 ForgeRock AS. |
| | | Portions Copyright 2018-2024 3A Systems, LLC |
| | | --> |
| | | <!-- OpenDJ final archive content descriptor --> |
| | | <component> |
| | |
| | | </file> |
| | | <!-- Adds Generated config.ldif file --> |
| | | <file> |
| | | <source>${basedir}/resource/config/config.ldif</source> |
| | | <source>${project.build.directory}/template/config/config.ldif</source> |
| | | <outputDirectory>template/config</outputDirectory> |
| | | </file> |
| | | |
| | |
| | | * |
| | | * Portions Copyright 2006-2007-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2016 ForgeRock AS. |
| | | * Portions Copyright 2023 3A Systems LLC. |
| | | * Portions Copyright 2023-2024 3A Systems LLC. |
| | | */ |
| | | package org.opends.server.config; |
| | | |
| | |
| | | get(attributeName, configEntryDN, op.getErrorMessage()); |
| | | throw new AttributeNotFoundException(message.toString()); |
| | | } |
| | | |
| | | return getJmxAttribute(attributeName).getValue(); |
| | | Attribute attr=getJmxAttribute(attributeName); |
| | | if (attr==null) { |
| | | throw new AttributeNotFoundException(attributeName); |
| | | } |
| | | return attr.getValue(); |
| | | } |
| | | catch (AttributeNotFoundException e) |
| | | { |
| | |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS. |
| | | * Portions Copyright 2024 3A Systems, LLC. |
| | | */ |
| | | package org.opends.server.snmp; |
| | | |
| | |
| | | ObjectName name = (ObjectName) iter.next(); |
| | | Object value = this.monitor.getAttribute(name, |
| | | "ds-backend-entry-count"); |
| | | if (value != null) { |
| | | if (value != null && value instanceof String) { |
| | | result = result + new Long((String) value); |
| | | }else if (value != null && value instanceof Long) { |
| | | result = result + (Long)value; |
| | | } |
| | | } |
| | | return SNMPMonitor.gauge32Value(result); |
| | |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | * Portions Copyright 2024 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.snmp; |
| | | |
| | |
| | | try { |
| | | String url = "jar:" + file.toURI().toURL() + "!/"; |
| | | URL u = new URL(url); |
| | | URLClassLoader sysloader = |
| | | (URLClassLoader)ClassLoader.getSystemClassLoader(); |
| | | Class sysclass = URLClassLoader.class; |
| | | Method method = sysclass.getDeclaredMethod("addURL", URL.class); |
| | | method.setAccessible(true); |
| | | method.invoke(sysloader, u); |
| | | ClassLoader sysloader =ClassLoader.getSystemClassLoader(); |
| | | try { |
| | | Method method = sysloader.getClass().getDeclaredMethod("addURL", URL.class); |
| | | method.setAccessible(true); |
| | | method.invoke(sysloader, u); |
| | | }catch (NoSuchMethodException e) { |
| | | Method method = sysloader.getClass().getDeclaredMethod("appendToClassPathForInstrumentation", String.class); |
| | | method.setAccessible(true); |
| | | method.invoke(sysloader, file.toString()); |
| | | } |
| | | } |
| | | catch (Throwable t) { |
| | | } |
| | |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2014 ForgeRock AS. |
| | | * Portions Copyright 2024 3A Systems, LLC. |
| | | */ |
| | | package org.opends.server.snmp; |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | Attribute attr = (Attribute) server.getAttribute(name, attribute); |
| | | Object attr = server.getAttribute(name, attribute); |
| | | if (attr != null) |
| | | { |
| | | return attr.getValue(); |
| | | return attr instanceof Attribute ? ((Attribute) attr).getValue(): attr; |
| | | } |
| | | } |
| | | catch (Exception ex) |