Skip to content
This repository was archived by the owner on Apr 18, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ hs_err_pid*
# Maven
target/

# netdata-plugin-java-daemon-installer.sh
netdata-plugin-java-daemon-installer.log
netdata-plugin-java-daemon-uninstaller.sh
# netdata-java-orchestrator-installer.sh
netdata-java-orchestrator-installer.log
netdata-java-orchestrator-uninstaller.sh

# macOS
.DS_Store
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Java Plugin
# Java Orchestrator

## Code Style

Expand Down
37 changes: 0 additions & 37 deletions LICENSE-REDISTRIBUTED.md

This file was deleted.

32 changes: 12 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# Important: Deprecation Note

This repository is outdated. I will not merge any pull requests here. I continue developing this plugin on my [netdata fork](https://github.com/simonnagl/netdata). For issues and requests for the java plugin you can use the [netdata issue tracker](https://github.com/firehol/netdata/issues). If you want to contribute with code please open a pull request to the fork.

As soon as the fork gets stable I can merge it directly to netdata.

# Netdata Java Plugin Daemon
# Netdata Java Orchestrator

[![Build Status](https://travis-ci.org/simonnagl/netdata-plugin-java-daemon.svg?branch=master)](https://travis-ci.org/simonnagl/netdata-plugin-java-daemon)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/c5196ea860ba4cb8a47f40c5264cc17f)](https://www.codacy.com/app/simonnagl/netdata-plugin-java-daemon?utm_source=github.com&utm_medium=referral&utm_content=simonnagl/netdata-plugin-java-daemon&utm_campaign=Badge_Coverage)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c5196ea860ba4cb8a47f40c5264cc17f)](https://www.codacy.com/app/simonnagl/netdata-plugin-java-daemon?utm_source=github.com&utm_medium=referral&utm_content=simonnagl/netdata-plugin-java-daemon&utm_campaign=badger)

netdata-java-plugin-daeimon is a [netdata](https://github.com/firehol/netdata) plugin which can collect any data in java and send it to netdata.
netdata-java-orchestrator is a [netdata](https://github.com/firehol/netdata) plugin which can collect any data in java and send it to netdata.

## Java Plugins
## Java Modules

- JMX Collector

Expand All @@ -30,33 +24,31 @@ netdata-java-plugin-daeimon is a [netdata](https://github.com/firehol/netdata) p
- netdata
- JRE 8.x

### 2. Install netdata-plugin-java-daemon
### 2. Install netdata-java-orchestrator

Do this to install and run netdata-plugin-java:
Do this to install and run netdata-java-orchestrator:

```(sh)
# download it - the directory 'netdata-plugin-java-daemon' will be created
git clone https://github.com/simonnagl/netdata-plugin-java-daemon.git --depth=1
cd netdata-plugin-java-daemon
# download it - the directory 'netdata-java-orchestrator' will be created
git clone https://github.com/simonnagl/netdata-java-orchestrator.git --depth=1
cd netdata-java-orchestrator

# run script with root privileges to build and install the plugin and restart netdata.
netdata-plugin-java-daemon-installer.sh
netdata-java-orchestrator-installer.sh
````

## Configuration

Configuration files contain JSON Objects.
Additional to the JSON specification Java/C++ style comments (both '/'+'*' and '//' varieties) are allowed.

Each plugin get's it's own configuration file. The standard configuration should have enogh examples and comments to extend or adapt it. The table below references the classes which describe the JSON schemes of the configuration files.
Each module get's it's own configuration file. The standard configuration should have enogh examples and comments to extend or adapt it. The table below references the classes which describe the JSON schemes of the configuration files.

File | Schema | Purpose
---------------------------- | ------ | -------
/etc/netdata/java.d/jmx.conf | [JmxPluginConfiguration](https://github.com/simonnagl/netdata-plugin-java-daemon/blob/master/src/main/java/org/firehol/netdata/plugin/jmx/configuration/JmxPluginConfiguration.java)| JMX plugin configuration
/etc/netdata/java.d/jmx.conf | [JmxModuleConfiguration](https://github.com/simonnagl/netdata-java-orchestrator/blob/master/src/main/java/org/firehol/netdata/module/jmx/configuration/JmxModuleConfiguration.java)| JMX module configuration


## License

netdata-plugin-java-daemon is [GPLv3+](LICENSE).

It re-distributes other open-source tools and libraries. Please check the [third party licenses](LICENSE-REDISTRIBUTED.md).
netdata-java-orchestrator is [GPLv3+](LICENSE).
8 changes: 4 additions & 4 deletions config/java.d/jmx.conf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// netdata-plugin-java-daemon JMX plugin configuration
// netdata-java-orchestrator JMX module configuration
//
// The comments in this file should help you to extend this configuration.
// Comments starting with '//' are descriptive comments. Uncommenting them leads to syntax errors.
// Block comments ('/* {...} */') are used to exclude configuration examples.
// These can be uncommented.
//
// For a more formal reference user the configuration scheme: org.firehol.netdata.plugin.jmx.configuration.JmxPluginConfiguration
// For a more formal reference user the configuration scheme: org.firehol.netdata.module.jmx.configuration.JmxModuleConfiguration

{
// If true auto detect and monitor running local virtual machines on plugin start.
// If true auto detect and monitor running local virtual machines.
"autoDetectLocalVirtualMachines": "true",
// Configure a list of JMX servers to monitor.
"jmxServers": [
Expand All @@ -29,7 +29,7 @@
// Every monitored JMX Servers tries to monitor each chart configuration.
// If a JMX Server does not have the required M(X)Beans we won't try adding it over and over again.
//
// The netdata-plugin-java-daemon maintains a set of common charts.
// Set of common charts:
// Feel free to open pull requests to share new chart configurations of M(X)Beans distributed with java
// or any open source project.
"commonCharts": [
Expand Down
2 changes: 1 addition & 1 deletion eclipse-formatter.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="13">
<profile kind="CodeFormatterProfile" name="netdata-java-plugin" version="13">
<profile kind="CodeFormatterProfile" name="netdata-java-orchestrator" version="13">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
Expand Down
2 changes: 1 addition & 1 deletion installer/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ netdata_banner() {
l3=" | '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' " \
l4=" +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->" \
sp=" " \
netdata="netdata-plugin-java-daemon" start end msg="${*}" chartcolor="${TPUT_DIM}"
netdata="netdata-java-orchestrator" start end msg="${*}" chartcolor="${TPUT_DIM}"

[ ${#msg} -lt ${#netdata} ] && msg="${msg}${sp:0:$(( ${#netdata} - ${#msg}))}"
[ ${#msg} -gt $(( ${#l2} - 20 )) ] && msg="${msg:0:$(( ${#l2} - 23 ))}..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ else
source "${source_dir}/installer/functions.sh" || exit 1
fi

run_logfile="netdata-plugin-java-daemon-installer.log"
run_logfile="netdata-java-orchestrator-installer.log"

umask 002

Expand All @@ -52,7 +52,7 @@ Valid <installer options> are:
--install /PATH/TO/INSTALL

If you give: --install /opt
netdata-plugin-java-daemon will be installed in /opt/netdata
netdata-java-orchestrator will be installed in /opt/netdata
Use the same value you used for netdata-installer.sh.

--dont-start-it
Expand Down Expand Up @@ -107,16 +107,16 @@ do
fi
done

netdata_banner "java plugin daemon with jmx monitoring"
netdata_banner "java orchestrator with jmx monitoring"
cat <<BANNER1

You are about to build and install netdata-plugin-java-daemon to your system.
You are about to build and install netdata-java-orchestrator to your system.
Please make shure you called the installer with the same privileges and options you used to install netdata.

It will be installed at these locations:

- executable at ${TPUT_CYAN}${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/java.d.plugin${TPUT_RESET}
- jar file at ${TPUT_CYAN}${NETDATA_PREFIX}/usr/netdata-plugin-java-daemon/java-daemon.jar${TPUT_RESET}
- jar file at ${TPUT_CYAN}${NETDATA_PREFIX}/usr/netdata-java-orchestrator/java-orchestrator.jar${TPUT_RESET}
- config files in ${TPUT_CYAN}${NETDATA_PREFIX}/etc/netdata${TPUT_RESET}
BANNER1

Expand Down Expand Up @@ -153,7 +153,7 @@ if [ "${UID}" -ne 0 ]

${TPUT_RED}${TPUT_BOLD}Sorry! This will fail!${TPUT_RESET}

You are attempting to install netdata-plugin-java-daemon as non-root, but you plan
You are attempting to install netdata-java-orchestrator as non-root, but you plan
to install it in system paths.

Please set an installation prefix, like this:
Expand All @@ -174,9 +174,9 @@ NONROOTNOPREFIX
cat <<NONROOT

${TPUT_RED}${TPUT_BOLD}IMPORTANT${TPUT_RESET}:
You are about to install netdata-plugin-java-daemon as a non-root user.
You are about to install netdata-java-orchestrator as a non-root user.

If you installing netdata-plugin-java-daemon permanently on your system, run
If you installing netdata-java-orchestrator permanently on your system, run
the installer like this:

${TPUT_YELLOW}${TPUT_BOLD}sudo $0 ${@}${TPUT_RESET}
Expand All @@ -189,9 +189,9 @@ if [ ${DONOTWAIT} -eq 0 ]
then
if [ ! -z "${NETDATA_PREFIX}" ]
then
eval "read >&2 -ep \$'\001${TPUT_BOLD}${TPUT_GREEN}\002Press ENTER to build and install netdata-plugin-java-daemon to \'\001${TPUT_CYAN}\002${NETDATA_PREFIX}\001${TPUT_YELLOW}\002\'\001${TPUT_RESET}\002 > ' -e -r REPLY"
eval "read >&2 -ep \$'\001${TPUT_BOLD}${TPUT_GREEN}\002Press ENTER to build and install netdata-java-orchestrator to \'\001${TPUT_CYAN}\002${NETDATA_PREFIX}\001${TPUT_YELLOW}\002\'\001${TPUT_RESET}\002 > ' -e -r REPLY"
else
eval "read >&2 -ep \$'\001${TPUT_BOLD}${TPUT_GREEN}\002Press ENTER to build and install netdata-plugin-java-daemon to your system\001${TPUT_RESET}\002 > ' -e -r REPLY"
eval "read >&2 -ep \$'\001${TPUT_BOLD}${TPUT_GREEN}\002Press ENTER to build and install netdata-java-orchestrator to your system\001${TPUT_RESET}\002 > ' -e -r REPLY"
fi
fi

Expand All @@ -201,11 +201,11 @@ build_error() {

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Sorry! netdata-plugin-java-daemon failed to build...
Sorry! netdata-java-orchestrator failed to build...

If you cannot figure out why, ask for help at github:

https://github.com/simonnagl/netdata-plugin-java-daemon/issues
https://github.com/simonnagl/netdata-java-orchestrator/issues


EOF
Expand All @@ -219,20 +219,20 @@ progress "Cleanup compilation directory"
[ -d target ] && run ./mvnw -o clean

# -----------------------------------------------------------------------------
progress "Compile and package netdata-plugin-java-daemon"
progress "Compile and package netdata-java-orchestrator"

run ./mvnw -o -T 1C package || build_error

# -----------------------------------------------------------------------------
progress "Install netdata-plugin-java-daemon"
progress "Install netdata-java-orchestrator"

# Create directory for jar if necessary
[ -d "${NETDATA_PREFIX}/usr/libexec/netdata-plugin-java-daemon" ] || run mkdir -p "${NETDATA_PREFIX}/usr/libexec/netdata-plugin-java-daemon"
[ -d "${NETDATA_PREFIX}/usr/libexec/netdata-java-orchestrator" ] || run mkdir -p "${NETDATA_PREFIX}/usr/libexec/netdata-java-orchestrator"
# Copy the jar
run cp target/java-daemon-*.jar "${NETDATA_PREFIX}/usr/libexec/netdata-plugin-java-daemon/java-daemon.jar"
run cp target/java-orchestrator-*.jar "${NETDATA_PREFIX}/usr/libexec/netdata-java-orchestrator/java-orchestrator.jar"

# Write the executable
run echo "exec java -Djava.util.logging.SimpleFormatter.format='%1\$tF %1\$TT: java.d: %4\$s: %3\$s: %5\$s%6\$s%n' -jar ${NETDATA_PREFIX}/usr/libexec/netdata-plugin-java-daemon/java-daemon.jar \$@" \
run echo "exec java -Djava.util.logging.SimpleFormatter.format='%1\$tF %1\$TT: java.d: %4\$s: %3\$s: %5\$s%6\$s%n' -jar ${NETDATA_PREFIX}/usr/libexec/netdata-java-orchestrator/java-orchestrator.jar \$@" \
> ${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/java.d.plugin
run chmod 0755 "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/java.d.plugin"

Expand Down Expand Up @@ -269,16 +269,16 @@ if [ ${DONOTSTART} -ne 1 ]
fi

# -----------------------------------------------------------------------------
progress "Generate netdata-plugin-java-daemon-uninstaller.sh"
progress "Generate netdata-java-orchestrator-uninstaller.sh"

cat >netdata-plugin-java-daemon-uninstaller.sh <<UNINSTALL
cat >netdata-java-orchestrator-uninstaller.sh <<UNINSTALL
#!/usr/bin/env bash

# this script will uninstall netdata

if [ "\$1" != "--force" ]
then
echo >&2 "This script will REMOVE netdata-plugin-java-daeimon from your system."
echo >&2 "This script will REMOVE netdata-java-orchestrator from your system."
echo >&2 "Run it again with --force to do it."
exit 1
fi
Expand All @@ -292,24 +292,24 @@ deletedir() {
fi
}

deletedir "${NETDATA_PREFIX}/usr/libexec/netdata-plugin-java-daemon"
deletedir "${NETDATA_PREFIX}/usr/libexec/netdata-java-orchestrator"
rm -f ${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/java.d.plugin
rm -f ${NETDATA_PREFIX}/etc/netdata/java.d.conf
deletedir "${NETDATA_PREFIX}/etc/netdata/java.d"

UNINSTALL
chmod 750 netdata-plugin-java-daemon-uninstaller.sh
chmod 750 netdata-java-orchestrator-uninstaller.sh

# -----------------------------------------------------------------------------
progress "Basic netdata-plugin-java-daemon instructions"
progress "Basic netdata-java-orchestrator instructions"

cat <<END

netdata-plugin-java-daemon must be called by netdata.
netdata-java-orchestrator must be called by netdata.
You may need to restart netdata.

END
echo >&2 "Uninstall script generated: ${TPUT_RED}${TPUT_BOLD}./netdata-plugin-java-daemon-uninstaller.sh${TPUT_RESET}"
echo >&2 "Uninstall script generated: ${TPUT_RED}${TPUT_BOLD}./netdata-java-orchestrator-uninstaller.sh${TPUT_RESET}"

# -----------------------------------------------------------------------------
echo >&2
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.firehol.netdata.plugin</groupId>
<artifactId>java-daemon</artifactId>
<groupId>org.firehol.netdata</groupId>
<artifactId>java-orchestrator</artifactId>
<packaging>jar</packaging>
<version>0.1.0-SNAPSHOT</version>
<name>netdata-plugin-java-daemon</name>
<name>netdata-java-orchestrator</name>
<url>http://netdata.firehol.org</url>
<properties>
<!-- dependencies properties -->
Expand Down Expand Up @@ -174,13 +174,13 @@
<url>http://firehol.org</url>
</organization>
<scm>
<url>https://github.com/simonnagl/netdata-plugin-java-daemon</url>
<connection>scm:git:https://github.com/simonnagl/netdata-plugin-java-daemon.git</connection>
<developerConnection>scm:git:https://github.com/simonnagl/netdata-plugin-java-daemon.git</developerConnection>
<url>https://github.com/simonnagl/netdata-java-orchestrator</url>
<connection>scm:git:https://github.com/simonnagl/netdata-java-orchestrator.git</connection>
<developerConnection>scm:git:https://github.com/simonnagl/netdata-java-orchestrator.git</developerConnection>
<tag>HEAD</tag>
</scm>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/simonnagl/netdata-plugin-java-daemon/issues</url>
<url>https://github.com/simonnagl/netdata-java-orchestrator/issues</url>
</issueManagement>
</project>
2 changes: 1 addition & 1 deletion src/main/java/org/firehol/netdata/CommandLineArgs.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2017 Simon Nagl
*
* netadata-plugin-java-daemon is free software: you can redistribute it and/or modify
* netdata-java-orchestrator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
Expand Down
Loading