Andy Smith <ansmith at redhat.com>
- AMQP 1.0 plugin.
-
+
Aneesh Puttur <aputtur at redhat.com>
- connectivity plugin.
Antony Dovgal <tony at daylessday.org>
- memcached plugin.
+Asaf Kahlon <asafka7 at gmail.com>
+ - buddyinfo plugin
+
Aurélien Reynaud <collectd at wattapower.net>
- LPAR plugin.
- Various fixes for AIX, HP-UX and Solaris.
bind_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
endif
+if BUILD_PLUGIN_BUDDYINFO
+pkglib_LTLIBRARIES += buddyinfo.la
+buddyinfo_la_SOURCES = src/buddyinfo.c
+buddyinfo_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+buddyinfo_la_LIBADD = libignorelist.la
+endif
+
if BUILD_PLUGIN_CEPH
pkglib_LTLIBRARIES += ceph.la
ceph_la_SOURCES = src/ceph.c
Name server and resolver statistics from the `statistics-channel'
interface of BIND 9.5, 9,6 and later.
+ - buddyinfo
+ Statistics from buddyinfo file about memory fragmentation.
+
- ceph
Statistics from the Ceph distributed storage system.
plugin_barometer="no"
plugin_battery="no"
plugin_bind="no"
+plugin_buddyinfo="no"
plugin_ceph="no"
plugin_cgroups="no"
plugin_connectivity="no"
# Linux
if test "x$ac_system" = "xLinux"; then
plugin_battery="yes"
+ plugin_buddyinfo="yes"
plugin_cgroups="yes"
plugin_conntrack="yes"
plugin_contextswitch="yes"
AC_PLUGIN([barometer], [$plugin_barometer], [Barometer sensor on I2C])
AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
+AC_PLUGIN([buddyinfo], [$plugin_buddyinfo], [buddyinfo statistics])
AC_PLUGIN([ceph], [$plugin_ceph], [Ceph daemon statistics])
AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
AC_PLUGIN([chrony], [yes], [Chrony statistics])
AC_MSG_RESULT([ barometer . . . . . . $enable_barometer])
AC_MSG_RESULT([ battery . . . . . . . $enable_battery])
AC_MSG_RESULT([ bind . . . . . . . . $enable_bind])
+AC_MSG_RESULT([ buddyinfo . . . . . . $enable_buddyinfo])
AC_MSG_RESULT([ ceph . . . . . . . . $enable_ceph])
AC_MSG_RESULT([ cgroups . . . . . . . $enable_cgroups])
AC_MSG_RESULT([ chrony. . . . . . . . $enable_chrony])
--- /dev/null
+/**
+ * collectd - src/buddyinfo.c
+ * Copyright (C) 2005-2010 Florian octo Forster
+ * Copyright (C) 2009 Manuel Sanmartin
+ *
+ * This program 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; only version 2 of the License is applicable.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Authors:
+ * Asaf Kahlon <asafka7 at gmail.com>
+ **/
+
+#include "collectd.h"
+
+#include "plugin.h"
+#include "utils/common/common.h"
+#include "utils/ignorelist/ignorelist.h"
+
+#if !KERNEL_LINUX
+#error "No applicable input method."
+#endif
+
+#include <unistd.h>
+
+#define MAX_ORDER 11
+#define BUDDYINFO_FIELDS MAX_ORDER + 2 // "zone" + Name + (MAX_ORDER entries)
+#define NUM_OF_KB(pagesize, order) ((pagesize) / 1024) * (1 << (order))
+
+static const char *config_keys[] = {"Zone"};
+static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
+
+static ignorelist_t *ignorelist;
+
+static int buddyinfo_config(const char *key, const char *value) {
+ if (ignorelist == NULL)
+ ignorelist = ignorelist_create(1);
+
+ if (strcasecmp(key, "Zone") == 0)
+ ignorelist_add(ignorelist, value);
+ else
+ return -1;
+
+ return 0;
+}
+
+static void buddyinfo_submit(const char *zone, const char *size,
+ const int freepages) {
+ value_list_t vl = VALUE_LIST_INIT;
+ value_t value = {.gauge = freepages};
+
+ if (ignorelist_match(ignorelist, zone) != 0)
+ return;
+
+ vl.values = &value;
+ vl.values_len = 1;
+ sstrncpy(vl.plugin, "buddyinfo", sizeof(vl.plugin));
+ sstrncpy(vl.plugin_instance, zone, sizeof(vl.plugin_instance));
+ sstrncpy(vl.type, "freepages", sizeof(vl.type));
+ sstrncpy(vl.type_instance, size, sizeof(vl.type_instance));
+
+ plugin_dispatch_values(&vl);
+}
+
+static int buddyinfo_read(void) {
+ FILE *fh;
+ char buffer[1024], pagesize_kb[8];
+ char *dummy, *zone;
+ char *fields[BUDDYINFO_FIELDS];
+ int numfields, pagesize = getpagesize();
+
+ if ((fh = fopen("/proc/buddyinfo", "r")) == NULL) {
+ WARNING("buddyinfo plugin: fopen: %s", STRERRNO);
+ return -1;
+ }
+
+ while (fgets(buffer, sizeof(buffer), fh) != NULL) {
+ if (!(dummy = strstr(buffer, "zone")))
+ continue;
+
+ numfields = strsplit(dummy, fields, BUDDYINFO_FIELDS);
+ if (numfields != BUDDYINFO_FIELDS)
+ continue;
+
+ zone = fields[1];
+ for (int i = 1; i <= MAX_ORDER; i++) {
+ ssnprintf(pagesize_kb, sizeof(pagesize_kb), "%dKB",
+ NUM_OF_KB(pagesize, i - 1));
+ buddyinfo_submit(zone, pagesize_kb, atoll(fields[i + 1]));
+ }
+ }
+
+ fclose(fh);
+ return 0;
+}
+
+void module_register(void) {
+ plugin_register_config("buddyinfo", buddyinfo_config, config_keys,
+ config_keys_num);
+ plugin_register_read("buddyinfo", buddyinfo_read);
+}
#@BUILD_PLUGIN_BAROMETER_TRUE@LoadPlugin barometer
#@BUILD_PLUGIN_BATTERY_TRUE@LoadPlugin battery
#@BUILD_PLUGIN_BIND_TRUE@LoadPlugin bind
+#@BUILD_PLUGIN_BUDDYINFO_TRUE@LoadPlugin buddyinfo
#@BUILD_PLUGIN_CEPH_TRUE@LoadPlugin ceph
#@BUILD_PLUGIN_CGROUPS_TRUE@LoadPlugin cgroups
#@BUILD_PLUGIN_CHRONY_TRUE@LoadPlugin chrony
# </View>
#</Plugin>
+#<Plugin buddyinfo>
+# Zone "Normal"
+#</Plugin>
+
#<Plugin ceph>
# LongRunAvgLatency false
# ConvertSpecialMetricTypes true
#<Plugin "procevent">
# BufferLength 10
-# ProcessRegex "/^ovs.*$/"
+# ProcessRegex "/^ovs.*$/"
# Process tuned
#</Plugin>
=back
+=head2 Plugin C<buddyinfo>
+
+The B<buddyinfo> plugin collects information by reading "/proc/buddyinfo".
+This file contains information about the number of available contagious
+physical pages at the moment.
+
+=over 4
+
+=item B<Zone> I<ZoneName>
+
+Zone to collect info about. Will collect all zones by default.
+
+=back
+
=head2 Plugin C<ceph>
The ceph plugin collects values from JSON data to be parsed by B<libyajl>
Interface eth1
IgnoreSelected true
</Plugin>
-
+
=over 4
=item B<Interface> I<interface_name>
-interface(s) to monitor connect to.
+interface(s) to monitor connect to.
=back
Set the outgoing IP address for IP packets. This option can be used instead of
the I<Interface> option to explicitly define the IP address which will be used
-to send Packets to the remote server.
+to send Packets to the remote server.
=item B<ResolveInterval> I<Seconds>
matches.
=head2 Plugin C<procevent>
-
+
The I<procevent> plugin monitors when processes start (EXEC) and stop (EXIT).
-
+
B<Synopsis:>
-
+
<Plugin procevent>
BufferLength 10
Process "name"
ProcessRegex "regex"
</Plugin>
-
+
B<Options:>
-
+
=over 4
-
+
=item B<BufferLength> I<length>
-
+
Maximum number of process events that can be stored in plugin's ring buffer.
By default, this is set to 10. Once an event has been read, its location
becomes available for storing a new event.
-
+
=item B<Process> I<name>
-
+
Enumerate a process name to monitor. All processes that match this exact
name will be monitored for EXECs and EXITs.
=item B<ProcessRegex> I<regex>
-
-Enumerate a process pattern to monitor. All processes that match this
+
+Enumerate a process pattern to monitor. All processes that match this
regular expression will be monitored for EXECs and EXITs.
-
+
=back
=head2 Plugin C<protocols>
=back
=head2 Plugin C<sysevent>
-
+
The I<sysevent> plugin monitors rsyslog messages.
-
+
B<Synopsis:>
-
+
<Plugin sysevent>
Listen "192.168.0.2" "6666"
BufferSize 1024
*.* @192.168.0.2:6666;ls_json
Please note that these rsyslog.conf examples are *not* complete, as rsyslog
- requires more than these options in the configuration file. These examples
+ requires more than these options in the configuration file. These examples
are meant to demonstration the proper remote logging and JSON format syntax.
B<Options:>
-
+
=over 4
-
+
=item B<Listen> I<host> I<port>
-
+
Listen on this IP on this port for incoming rsyslog messages.
=item B<BufferSize> I<length>
-
-Maximum allowed size for incoming rsyslog messages. Messages that exceed
+
+Maximum allowed size for incoming rsyslog messages. Messages that exceed
this number will be truncated to this size. Default is 4096 bytes.
=item B<BufferLength> I<length>
-
+
Maximum number of rsyslog events that can be stored in plugin's ring buffer.
By default, this is set to 10. Once an event has been read, its location
becomes available for storing a new event.
=item B<RegexFilter> I<regex>
-
+
Enumerate a regex filter to apply to all incoming rsyslog messages. If a
message matches this filter, it will be published.
-
+
=back
=head2 Plugin C<syslog>
Bucket 20 50
Bucket 50 0
-Metrics are reported with the I<type> set by B<BucketType> option (C<bucket>
+Metrics are reported with the I<type> set by B<BucketType> option (C<bucket>
by default) and the I<type instance>
C<E<lt>TypeE<gt>[-E<lt>InstanceE<gt>]-E<lt>lower_boundE<gt>_E<lt>upper_boundE<gt>>.
filter_result value:DERIVE:0:U
flow value:GAUGE:0:U
fork_rate value:DERIVE:0:U
+freepages value:GAUGE:0:U
frequency value:GAUGE:0:U
frequency_error value:GAUGE:-1000000:1000000
frequency_offset value:GAUGE:-1000000:1000000