summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2782a51)
raw | patch | inline | side by side (parent: 2782a51)
author | Andrés J. Díaz <ajdiaz@connectical.com> | |
Tue, 24 Feb 2015 16:54:08 +0000 (17:54 +0100) | ||
committer | Andrés J. Díaz <ajdiaz@connectical.com> | |
Wed, 25 Feb 2015 13:01:46 +0000 (14:01 +0100) |
Now the IPC plugin uses a combination of plugin_instance and type_instance
to avoid creation of types.db. Just "segments" type is needed now.
to avoid creation of types.db. Just "segments" type is needed now.
src/Makefile.am | patch | blob | history | |
src/ipc.c | patch | blob | history | |
src/types.db | patch | blob | history |
diff --git a/src/Makefile.am b/src/Makefile.am
index eb10a2bcefab92f37a1db98b34102a3227e9616c..3a165440db6193c1b6935df9d2be46e487ffa9ba 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
if BUILD_PLUGIN_IPC
pkglib_LTLIBRARIES += ipc.la
ipc_la_SOURCES = ipc.c
-ipc_la_LDFLAGS = -module -avoid-version
-collectd_LDADD += "-dlopen" ipc.la
-collectd_DEPENDENCIES += ipc.la
+ipc_la_CFLAGS = $(AM_CFLAGS)
+ipc_la_LDFLAGS = $(PLUGIN_LDFLAGS)
endif
if BUILD_PLUGIN_IPTABLES
diff --git a/src/ipc.c b/src/ipc.c
index c10cdb1d687b6c1e2b2787c3e4f5c8469d216ecc..3cf5367ae99427a6e75f2e72959e48bf24bbbf75 100644 (file)
--- a/src/ipc.c
+++ b/src/ipc.c
#endif
__attribute__ ((nonnull(1)))
-static void ipc_submit_g (const char *type, gauge_t value) /* {{{ */
+static void ipc_submit_g (const char *plugin_instance,
+ const char *type,
+ const char *type_instance,
+ gauge_t value) /* {{{ */
{
value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
vl.values_len = 1;
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ipc", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
+ if (type_instance != NULL)
+ sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (&vl);
} /* }}} */
return (-1);
}
- ipc_submit_g("sem_used_arrays", seminfo.semusz);
- ipc_submit_g("sem_used", seminfo.semaem);
+ ipc_submit_g("sem", "count", "arrays", seminfo.semusz);
+ ipc_submit_g("sem", "count", "total", seminfo.semaem);
/* #endif KERNEL_LINUX */
#elif KERNEL_AIX
}
free(ipcinfo_sem);
- ipc_submit_g("sem_used_arrays", sem_nsems);
- ipc_submit_g("sem_used", sems);
+ ipc_submit_g("sem", "count", "arrays", sem_nsems);
+ ipc_submit_g("sem", "count", "total", sems);
#endif /* KERNEL_AIX */
return (0);
ERROR("Kernel is not configured for shared memory");
return (-1);
}
- ipc_submit_g("shm_segments", shm_info.used_ids);
- ipc_submit_g("shm_bytes_total", shm_info.shm_tot * pagesize_g);
- ipc_submit_g("shm_bytes_rss", shm_info.shm_rss * pagesize_g);
- ipc_submit_g("shm_bytes_swapped", shm_info.shm_swp * pagesize_g);
+ ipc_submit_g("shm", "segments", NULL, shm_info.used_ids);
+ ipc_submit_g("shm", "bytes", "total", shm_info.shm_tot * pagesize_g);
+ ipc_submit_g("shm", "bytes", "rss", shm_info.shm_rss * pagesize_g);
+ ipc_submit_g("shm", "bytes", "swapped", shm_info.shm_swp * pagesize_g);
/* #endif KERNEL_LINUX */
#elif KERNEL_AIX
ipcinfo_shm_t *ipcinfo_shm;
}
free(ipcinfo_shm);
- ipc_submit_g("shm_segments", shm_segments);
- ipc_submit_g("shm_bytes_total", shm_bytes);
+ ipc_submit_g("shm", "segments", NULL, shm_segments);
+ ipc_submit_g("shm", "bytes", "total", shm_bytes);
#endif /* KERNEL_AIX */
return (0);
ERROR("Kernel is not configured for message queues");
return (-1);
}
- ipc_submit_g("msg_alloc_queues", msginfo.msgmni);
- ipc_submit_g("msg_used_headers", msginfo.msgmap);
- ipc_submit_g("msg_used_space", msginfo.msgtql);
+ ipc_submit_g("msg", "count", "queues", msginfo.msgmni);
+ ipc_submit_g("msg", "count", "headers", msginfo.msgmap);
+ ipc_submit_g("msg", "count", "space", msginfo.msgtql);
/* #endif KERNEL_LINUX */
#elif KERNEL_AIX
ipcinfo_msg_t *ipcinfo_msg;
}
free(ipcinfo_msg);
- ipc_submit_g("msg_alloc_queues", msg_alloc_queues);
- ipc_submit_g("msg_used_headers", msg_qnum);
- ipc_submit_g("msg_used_space", msg_used_space);
+ ipc_submit_g("msg", "count", "queues", msg_alloc_queues);
+ ipc_submit_g("msg", "count", "headers", msg_qnum);
+ ipc_submit_g("msg", "count", "space", msg_used_space);
#endif /* KERNEL_AIX */
return (0);
}
diff --git a/src/types.db b/src/types.db
index 2df98cd83f18e478ff84eaebf59df52b04094dda..b11aa3c01c8114e4c0f839bd3ac5b638a1caa701 100644 (file)
--- a/src/types.db
+++ b/src/types.db
memcached_ops value:DERIVE:0:U
memory value:GAUGE:0:281474976710656
memory_lua value:GAUGE:0:281474976710656
-msg_alloc_queues value:GAUGE:0:65535
-msg_used_headers value:GAUGE:0:65535
-msg_used_space value:GAUGE:0:65535
multimeter value:GAUGE:U:U
mutex_operations value:DERIVE:0:U
mysql_commands value:DERIVE:0:U
route_etx value:GAUGE:0:U
route_metric value:GAUGE:0:U
routes value:GAUGE:0:U
-sem_used_arrays value:GAUGE:0:65535
-sem_used value:GAUGE:0:65535
+segments value:GAUGE:0:65535
serial_octets rx:DERIVE:0:U, tx:DERIVE:0:U
-shm_bytes_rss value:GAUGE:0:65535
-shm_bytes_swapped value:GAUGE:0:65535
-shm_bytes_total value:GAUGE:0:65535
-shm_segments value:GAUGE:0:65535
signal_noise value:GAUGE:U:0
signal_power value:GAUGE:U:0
signal_quality value:GAUGE:0:U