-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JMXTrans can execute simple JMX operations #803
Open
jnovak-netsystemcz
wants to merge
4
commits into
jmxtrans:master
Choose a base branch
from
jnovak-netsystemcz:execute_operation
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
JMXTrans can execute simple JMX operations #803
jnovak-netsystemcz
wants to merge
4
commits into
jmxtrans:master
from
jnovak-netsystemcz:execute_operation
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jnovak-netsystemcz
force-pushed
the
execute_operation
branch
from
September 5, 2021 17:05
e858a03
to
a4430ce
Compare
❌ Build jmxtrans 524 failed (commit 302019bda5 by @jnovak-netsystemcz) |
Our environment runs a lot of Java applications in Linux HA cluster. So application can run on any of cluster nodes. We are not able to maintain JMXTrans config files to match applications running on the node and JMXTrans configuration is same on every HA node. So many of applications are not reachable for JMX and JMXTrans logs are full of exceptions. Currently, when Exception happens during Query, full stack trace is written to the log. This patch allows to specify attribute jmxErrorHandling to a query with three ways how to handle Query exception: dump, warn and ignore. Dump is current behaving. Warn just prints warning about imposibility to collect the data (1 line). Ignore just ignores any message. Example: { "servers" : [ { ... "queries" : [ { ... "jmxErrorHandling" : "warn", ... } ] } ] }
jnovak-netsystemcz
force-pushed
the
execute_operation
branch
from
September 5, 2021 18:58
a4430ce
to
db533eb
Compare
ConfigurationParser creates variables based on host: hostname, reversed_hostname, escaped_hostname, escaped_reversed_hostname, canonical_hostname, reversed_canonical_hostname, escaped_canonical_hostname, escaped_reversed_canonical_hostname, hostaddress, escaped_hostaddress They are similar to jmxtrans-agent (see https://github.com/jmxtrans/jmxtrans-agent/wiki/Expression-Language). ConfigurationParser creates variables based on file name: filename - filename without path and extension filename1..N - parts of filename splitted by '_' All variables can be used in any item of configuration. E.g.: ... "host" : "${filename3}", "port" : "${filename2}", "alias" : "${hostname}", ... for host myhost and filename test_1234_srv1.json creates: ... "host" : "srv1", "port" : "1234", "alias" : "myhost", ...
JMXTrans can execute JMX operation, if it is without parameters. Return value is returned as string with .toString(). Example of configuration: "queries" : [ { ... "operation" : [ "listSessions" ], ... It can be combined with "attr" on same object. When no "attr" is used, just operation is executed. When "attr" and "operation" is used, all listed attrs and operations are queried. Note: Before this change, when there was no "attr" in query all attributes were queried. With the patch, behaving is slightly changed. When no "operation" and no "attr" is used, all attributes are queried. When "operation" is used, but no "attr" is used, just operations are queried. Note 2: Patch must be applied after "Query can specify how JMX Exceptions are handled." PR#805 and "Extended list of variables usable in configuration files with ${...}" PR#804.
jnovak-netsystemcz
force-pushed
the
execute_operation
branch
from
September 5, 2021 20:19
db533eb
to
c8d9876
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JMXTrans can execute JMX operation, if it is without parameters. Return
value is returned as string with .toString().
Example of configuration:
It can be combined with "attr" on same object. When no "attr" is used,
just operation is executed. When "attr" and "operation" is used, all
listed attrs and operations are queried.
Note: Before this change, when there was no "attr" in query all
attributes were queried. With the patch, behaving is slightly changed.
When no "operation" and no "attr" is used, all attributes are queried.
When "operation" is used, but no "attr" is used, just operations are
queried.