187 Commits

Author SHA1 Message Date
Dagobert Michelsen
27564149d6 Merge pull request #3044 from Caden94/patch-1
GenericJMX plugin: Support boolean input
2020-02-29 14:39:54 +01:00
Dagobert Michelsen
44583c1aa6 Merge pull request #3083 from guillemj/pu/perl-robust-unixsock
Make the perl Unixsock module robust against socket errors and disconnects
2020-02-26 11:26:05 +01:00
Christian Bartolomäus
cae34d6608 Fix indentation of some closing curlies 2019-07-31 20:43:44 +02:00
Guillem Jover
d7af9ef00a Collectd::Unixsock: Make code robust against socket errors and disconnections
We should check the errors on socket operations, and in case of EPIPE,
which happens on socket disconnection, such as when the server gets
restarted, we should try to reconnect and retry the last operation
to avoid losing data.
2019-02-18 13:23:54 +01:00
Guillem Jover
37416d36eb Collectd::Unixsock: Remove unused $fh variables 2019-02-18 13:23:54 +01:00
Caden
73ba929d7d obey contrib format 2019-01-22 15:10:25 -08:00
Caden
78ca55e446 Don't know why empty space is removed by contrib/format.sh 2019-01-22 14:28:05 -08:00
Caden
29f7f1d1e3 Remove empty line 2019-01-22 14:26:17 -08:00
Caden
063d6a9143 Support boolean input 2019-01-22 14:15:54 -08:00
Pierre Mauduit
8bef0ac26d Java bindings - Adding Atomic* support
AtomicIntegers are used to address some concurrency problems in Java, and this
is advised by some metrics libraries like Netflix's servo:

https://github.com/Netflix/servo/wiki#jmx

Unfortunately, the GenericJMXConfValue.java class is not able to get the values
from such types, hence this PR.

I scanned the Java doc for the Java package:
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/package-summary.html
I think I have not forgotten any types.

Tests: tested at runtime
2017-01-30 18:05:03 +01:00
Ruben Kerkhof
c5cfdb069b Switch to non-recursive make
Recursive make caused various dependency issues, mainly with linked
libraries or objects from other directories. Switch to a single Makefile
to solve this. An addded benefit is that this should speed up the build.
It also opens up the possibility to improve on our directory layout.
2016-12-21 17:58:05 +01:00
Matthias Bethke
b1f183c582 use deterministic time values in MockDaemon 2016-11-23 00:36:12 +07:00
Matthias Bethke
eeff4955c4 recognize seconds with and without fractional part 2016-11-22 23:53:30 +07:00
Matthias Bethke
e9d54bc4c6 pass fractional seconds upwards as floats 2016-11-22 23:37:33 +07:00
Matthias Bethke
e620d437b8 allow fractional seconds in listval_filter() 2016-11-22 23:35:36 +07:00
Matthias Bethke
88800275e0 update MockDaemon to report fractional seconds 2016-11-22 23:30:37 +07:00
Matthias Bethke
2fa2acea8c fix indentation (consistently use tabs) 2016-11-22 23:22:19 +07:00
Pavel Rochnyack
814f21ff67 perl plugin: Added 'flush' fallback 2016-09-16 10:46:26 +06:00
Pavel Rochnyack
f01c3e143c perl plugin: Fixed Collectd::plugin_call_all function name im DEBUG()/ERROR() 2016-09-16 10:46:26 +06:00
Pavel Rochnyack
108b6a44ac perl plugin: Register perl plugins with use of 'userdata'. 2016-09-16 10:46:26 +06:00
Florian Forster
a82b047a8d GenericJMX plugin: Suppress "unchecked conversion" warning.
The internet tells me there is no elegant way around this.
2016-08-15 07:41:24 +02:00
Ruben Kerkhof
01e2d29ebc Merge pull request #1557 from rpv-tomsk/master
* Collectd::Unixsock: Split messages sent by flush() to 1024 byte chunks to not overflow buffer in unixsock.c us_handle_client().
2016-04-24 12:49:46 +02:00
Ruben Kerkhof
8003c1333f GenericJMX: fix potential dereference after NPE
Fixes CID #41723
2016-04-02 18:05:14 +02:00
Pavel Rochnyack
4d186e3dcd * Collectd::Unixsock: Split messages sent by flush() to 1024 byte chunks to not overflow buffer in unixsock.c us_handle_client(). 2016-02-24 20:16:05 +07:00
Frank de Jong
edba412f8a GenericJMX plugin: memory leak, indent and compile warn fixes
- call close() on JMXConnector if JMX connection fails; fixes memory leak
- fix indentation errors
- fix "unchecked" compile warnings
- some refactoring
2015-12-02 14:39:04 +01:00
Marc Fournier
cfb1c97ca0 GenericJMX plugin: fix indentation/bracket error
1e2ad9c0 contained a mistake which resulted in the following build
error. It seems to be a bad copy-paste when creating #1330 from the
patch in #1291.

```
./org/collectd/java/GenericJMXConfValue.java:535: error: variable tmp is already defined in constructor GenericJMXConfValue(OConfigItem)
          String tmp = getConfigString (child);
```
2015-12-02 08:58:28 +01:00
David Crane
1e2ad9c046 GenericJMX plugin: Implement the "PluginName" config option.
Issue: #1291
Signed-off-by: Florian Forster <octo@collectd.org>
2015-12-01 21:49:57 +01:00
David Crane
bef004d66a GenericJMX plugin: Support TabularData for java.lang:type=GarbageCollector.
Issue: #1290
Signed-off-by: Florian Forster <octo@collectd.org>
2015-12-01 21:46:39 +01:00
Marc Fournier
7bab45b57d Merge branch 'collectd-5.5' 2015-10-14 09:10:50 +02:00
Ciaran Mac An Iomaire
159083153e Fix 'Modification of a read-only value attempted' error 2015-10-14 09:00:25 +02:00
Matthias Bethke
35795ab65c make _escape_argument() readonly-safe on older Perls 2015-07-21 15:02:16 +07:00
Matthias Bethke
c80f8bd00c fix evil autoderef 2015-07-21 15:00:49 +07:00
Florian Forster
2cbd37356b bindings/java/Makefile.am: Add "uninstall-local" target.
Otherwise "make distcheck" will complain about leftover files.
2015-05-23 11:01:19 +02:00
Florian Forster
37105d4bfe bindings/java/Makefile.am: Use $(srcdir) when specifying dependencies.
This fixes out-of-tree builds, like "make distcheck" does.
2015-05-23 11:00:38 +02:00
Pierre-Yves Ritschard
04b620afa8 Merge pull request #728 from mbethke/test-and-clean
Test and clean
2014-11-21 10:32:55 +01:00
Matthias Bethke
baf396c908 add listval_filter method and corresponding tests
Rationale:
A frequent use case for LISTVAL is to retrieve a list of resources for a certain
host or host group that is not known in advance, such as when the hosts have
different disks installed. Using the existing listval() method,
Collectd::Unixsock retrieves the entire list, parses each entry into a hash and
returns the list, only to have the caller throw away the vast majority of
entries immediately. listval_filter() allows the caller to pass any attribute
that can be passed to getval() and filters the list of resources retrieved from
the socket before parsing it, resulting in a large speedup.
The current implemntation has some code duplication, although listval() could be
implemented as a small wrapper around listval_filter() with just a few percent
speed penalty due to the extra dynamically built regexp.
2014-09-10 19:34:50 +02:00
Matthias Bethke
04c92d78fd refactor common query-response code 2014-09-10 18:48:44 +02:00
Matthias Bethke
bf66419c77 clean up Perl style a bit
- Remove some superfluous parenthesis clutter
- Shorten a lot of single-line conditionals using postfix constructions
- Merge variable declarations
- Use $class/$self instead of $pkg/$obj as is customary
- Remove quotes around literal hash keys
2014-09-10 18:39:52 +02:00
Matthias Bethke
dd2e6520f3 replace Regexp::Common with core Scalar::Util 2014-09-10 18:34:00 +02:00
Matthias Bethke
11196f8875 add a test suite 2014-09-10 18:32:39 +02:00
Florian Forster
061c3c091d Merge branch 'collectd-5.4' 2014-09-06 11:30:20 +02:00
Florian Forster
e2f2a97fd8 GenericJMXConfConnection: Remove unused imports. 2014-08-29 07:02:18 +02:00
Pierre-Yves Ritschard
84dd85dc85 Merge pull request #264 from ChrisLundquist/cl/perl-openvz
Improve OpenVZ.pm
2014-07-29 17:37:03 +02:00
Florian Forster
8f4a48a804 Merge remote-tracking branch 'github/pr/682' 2014-07-29 16:25:31 +02:00
Florian Forster
01f04ae581 bindings/perl/lib/Collectd/Unixsock.pm: Relicense to MIT. 2014-07-29 16:21:02 +02:00
Florian Forster
633c3966f7 {GPL, other}: Relicense to MIT license.
This change relicenses all files where the sole owner(s) are Sebastian
Harl and/or Florian Forster to the MIT license. This change happens
according to prior agreement with Sebastian.
2014-07-29 15:38:34 +02:00
Pierre-Yves Ritschard
f554ef29b3 Bring in hostname as defined in the main configuration by default
supersedes collectd/collectd#530
2014-07-29 14:37:05 +02:00
Alexandre Moutot
9d0c6edab1 Add a JMXProvider Class Loader to be able to load Provider using
getConnectorAsService from JMXConnectorFactory. The protocol remoting-jmx
using by JBOSS > 7 need that to work.
2013-10-09 15:47:48 +02:00
Sebastian Harl
5ac466c751 bindings/Makefile: Hint the user at --with-perl-bindings.
… in case 'perl Makefile.PL' fails.

Fixes Github issue #290.

Signed-off-by: Florian Forster <octo@collectd.org>
2013-04-06 11:03:28 -07:00
Sebastian Harl
6c769cf76d build system (Perl bindings): Make Makefile.PL's PREFIX/INSTALL_BASE optional.
Both options may cause problems:

 - PREFIX might clash with INSTALL_BASE being set in $PERL_MM_OPT.
 - INSTALL_BASE without any further options set will install into non-standard
   directories in many cases.

Rather, use PREFIX=${prefix} as default but overwrite that if
--with-perl-bindings=... has been used.

Thanks to faxm0dem for reporting the INSTALL_BASE problems on IRC and
bvarner and nirik for reporting this in GH #177 and #196.

This is a follow-up / fix for 97e8f346a8.

Fixes Github issue #290.

Signed-off-by: Florian Forster <octo@collectd.org>
2013-04-06 11:02:48 -07:00