Code

sysdb.git
10 years agoAdded unit testing framework based on ‘check’.
Sebastian Harl [Fri, 23 Aug 2013 18:44:10 +0000 (20:44 +0200)]
Added unit testing framework based on ‘check’.

For now, some basic tests for utils::list have been added.

10 years agoconfigure: Added cname::dns to summary output.
Sebastian Harl [Thu, 22 Aug 2013 19:13:44 +0000 (21:13 +0200)]
configure: Added cname::dns to summary output.

10 years agosysdbd.conf(5): Added a short description for each plugin.
Sebastian Harl [Wed, 21 Aug 2013 19:42:39 +0000 (21:42 +0200)]
sysdbd.conf(5): Added a short description for each plugin.

10 years agoobject: Removed support for cloning typed objects.
Sebastian Harl [Sat, 17 Aug 2013 20:21:51 +0000 (22:21 +0200)]
object: Removed support for cloning typed objects.

This is not used currently. Since it only introduces unneeded complexity (and
somewhat ugly code in some cases), it's better to remove it.

10 years agostore: Support NULL attribute values.
Sebastian Harl [Sat, 17 Aug 2013 20:09:10 +0000 (22:09 +0200)]
store: Support NULL attribute values.

10 years agostore: Handle cname translation centrally.
Sebastian Harl [Sat, 17 Aug 2013 20:05:41 +0000 (22:05 +0200)]
store: Handle cname translation centrally.

10 years agostore: Handle locking correctly when storing attributes.
Sebastian Harl [Sat, 17 Aug 2013 19:58:00 +0000 (21:58 +0200)]
store: Handle locking correctly when storing attributes.

We cannot release the lock before the attribute update is finished.

10 years agostore: Use generic store function also to store attributes.
Sebastian Harl [Sat, 17 Aug 2013 19:53:15 +0000 (21:53 +0200)]
store: Use generic store function also to store attributes.

Except for small special cases, this is exactly the same as storing other
store objects.

10 years agostore: Pass the right timestamp to newly created store objects.
Sebastian Harl [Sat, 17 Aug 2013 19:28:51 +0000 (21:28 +0200)]
store: Pass the right timestamp to newly created store objects.

Also, fixed object initialization.

10 years agostore: Use sdb_object_vcreate() when creating objects from super-class.
Sebastian Harl [Sat, 17 Aug 2013 19:20:41 +0000 (21:20 +0200)]
store: Use sdb_object_vcreate() when creating objects from super-class.

This allows to pass all required arguments to the init function.

10 years agoobject: Added sdb_object_vcreate().
Sebastian Harl [Sat, 17 Aug 2013 18:35:00 +0000 (20:35 +0200)]
object: Added sdb_object_vcreate().

This function expects an va_list argument rather than a "true" variadic list
of arguments.

10 years agostore: Use store super-class when storing objects.
Sebastian Harl [Sat, 17 Aug 2013 18:23:07 +0000 (20:23 +0200)]
store: Use store super-class when storing objects.

This makes the function even more flexible.

10 years agostore: Canonicalize hostname before storing a service.
Sebastian Harl [Sat, 17 Aug 2013 18:10:45 +0000 (20:10 +0200)]
store: Canonicalize hostname before storing a service.

Else, host to service mapping is not correct.

10 years agostore: Refactored host/service store code.
Sebastian Harl [Sat, 17 Aug 2013 18:07:13 +0000 (20:07 +0200)]
store: Refactored host/service store code.

Simplified the code based on the new internal data structures.

10 years agostore: Unified host and service objects into a hierarchical store object.
Sebastian Harl [Sat, 17 Aug 2013 17:22:23 +0000 (19:22 +0200)]
store: Unified host and service objects into a hierarchical store object.

This allows both hosts and services to support attributes. Also, hosts and
services may be children of other objects allowing to represent dependencies
or other hierarchical structures.

The external interface does not support hierarchical stores yet, though.

10 years agostore: Removed now duplicate code.
Sebastian Harl [Sat, 17 Aug 2013 16:55:16 +0000 (18:55 +0200)]
store: Removed now duplicate code.

When creating a new host object, the services/attributes list are always
initialized to an empty list object. No need to further check this anymore.
This was only required in earlier code when copying a user-provided host
object.

10 years agostore: Let store object-types be private types.
Sebastian Harl [Fri, 2 Aug 2013 00:11:14 +0000 (17:11 -0700)]
store: Let store object-types be private types.

The user should interact through the objects names or 'features' rather than
accessing any of the objects themselves.

10 years agostore: Let sdb_store_service() accept const arguments.
Sebastian Harl [Thu, 1 Aug 2013 23:59:19 +0000 (16:59 -0700)]
store: Let sdb_store_service() accept const arguments.

There's no need in letting the caller construct a service object. All passed
in strings are treated as constant values anyway.

10 years agostore: Let sdb_store_attribute() accept const arguments.
Sebastian Harl [Thu, 1 Aug 2013 23:47:39 +0000 (16:47 -0700)]
store: Let sdb_store_attribute() accept const arguments.

… rather than an attribute object. This eases memory management for the caller
and removes unnecessary string duplicates.

10 years agostore: Removed unused function sdb_store_get_service().
Sebastian Harl [Thu, 1 Aug 2013 23:36:15 +0000 (16:36 -0700)]
store: Removed unused function sdb_store_get_service().

This may be reintroduced if and when it's needed.

10 years agostore: Removed unsed function sdb_service_create().
Sebastian Harl [Thu, 1 Aug 2013 23:34:05 +0000 (16:34 -0700)]
store: Removed unsed function sdb_service_create().

There is no need to expose this data-type.

10 years agostore: Removed unused sdb_attribute_create().
Sebastian Harl [Wed, 24 Jul 2013 04:02:51 +0000 (21:02 -0700)]
store: Removed unused sdb_attribute_create().

10 years agostore: Renamed sdb_store_get_host() to sdb_store_has_host().
Sebastian Harl [Wed, 24 Jul 2013 01:45:40 +0000 (18:45 -0700)]
store: Renamed sdb_store_get_host() to sdb_store_has_host().

… and make the function return a boolean value. We don't currently need a
function to access the actual host object. So, don't expose it that way.

10 years agostore: Simplified sdb_store_host().
Sebastian Harl [Wed, 24 Jul 2013 01:42:04 +0000 (18:42 -0700)]
store: Simplified sdb_store_host().

Let the function accept constant arguments describing the hostname and last
update timestamp rather than a host object. This is more flexible for the
caller.

10 years agostore: Removed unused sdb_host_create() function.
Sebastian Harl [Wed, 24 Jul 2013 01:30:13 +0000 (18:30 -0700)]
store: Removed unused sdb_host_create() function.

10 years agostore: Renamed 'parent' attribute to 'super'.
Sebastian Harl [Mon, 22 Jul 2013 15:20:55 +0000 (08:20 -0700)]
store: Renamed 'parent' attribute to 'super'.

We might use 'parent' in different places in the future.

10 years agosysdbd.conf: Improved 'cname' documentation.
Sebastian Harl [Sat, 20 Jul 2013 00:40:53 +0000 (17:40 -0700)]
sysdbd.conf: Improved 'cname' documentation.

10 years agosysdbd.conf: Added and documented a sample LoadPlugin "cname::dns".
Sebastian Harl [Sat, 20 Jul 2013 00:37:40 +0000 (17:37 -0700)]
sysdbd.conf: Added and documented a sample LoadPlugin "cname::dns".

10 years agocname::dns: Added first version of a plugin to query DNS for cnames.
Sebastian Harl [Sat, 20 Jul 2013 00:11:44 +0000 (17:11 -0700)]
cname::dns: Added first version of a plugin to query DNS for cnames.

10 years agoplugin/store: Added support for "cname" plugins.
Sebastian Harl [Sat, 20 Jul 2013 00:08:27 +0000 (17:08 -0700)]
plugin/store: Added support for "cname" plugins.

This type of plugins may be used to canonicalize hostnames. Before storing a
new hosts, all registered cname callbacks will be used to translate the
specified hostname before actually storing it.

10 years agoplugin: Added formatting log functions.
Sebastian Harl [Sat, 20 Jul 2013 00:06:35 +0000 (17:06 -0700)]
plugin: Added formatting log functions.

10 years agoplugin: Removed another custom lookup-by-name function.
Sebastian Harl [Thu, 18 Jul 2013 01:56:44 +0000 (18:56 -0700)]
plugin: Removed another custom lookup-by-name function.

… and use sdb_llist_search_by_name() instead.

10 years agoLet objects be named.
Sebastian Harl [Thu, 18 Jul 2013 01:50:27 +0000 (18:50 -0700)]
Let objects be named.

This allows to move common code into helper functions. The objects module now
provides a function to compare two objects by name and linked-lists support to
lookup objects by name now.

This removes the need for various custom and somewhat ugly helper functions
and data-types.

10 years agosysdbd.conf(5): Added 'syslog' plugin.
Sebastian Harl [Wed, 10 Jul 2013 14:58:43 +0000 (16:58 +0200)]
sysdbd.conf(5): Added 'syslog' plugin.

10 years agoerror: Updated documentation; removed obsolete TODO note.
Sebastian Harl [Wed, 10 Jul 2013 14:56:22 +0000 (16:56 +0200)]
error: Updated documentation; removed obsolete TODO note.

10 years agosyslog plugin: Added plugin to log to syslog.
Sebastian Harl [Wed, 10 Jul 2013 14:55:16 +0000 (16:55 +0200)]
syslog plugin: Added plugin to log to syslog.

10 years agoconfig: Added support for (generic) LoadPlugin.
Sebastian Harl [Wed, 10 Jul 2013 14:54:39 +0000 (16:54 +0200)]
config: Added support for (generic) LoadPlugin.

10 years agoplugin: Added support for log callbacks.
Sebastian Harl [Wed, 10 Jul 2013 14:15:41 +0000 (16:15 +0200)]
plugin: Added support for log callbacks.

Use this logging mechanism to log messages from the error module.

11 years agosysdbd.conf(5): Added an initial manpage for sysdbd's configuration.
Sebastian Harl [Mon, 1 Apr 2013 21:30:01 +0000 (23:30 +0200)]
sysdbd.conf(5): Added an initial manpage for sysdbd's configuration.

11 years agoMerged branch 'master' of git://git.tokkee.org/sysdb.git.
Sebastian Harl [Mon, 1 Apr 2013 18:09:28 +0000 (20:09 +0200)]
Merged branch 'master' of git://git.tokkee.org/sysdb.git.

11 years agoMoved data.h from utils to core.
Sebastian Harl [Mon, 1 Apr 2013 18:01:26 +0000 (20:01 +0200)]
Moved data.h from utils to core.

This should also be considered a core component ;-)

11 years agoMoved error / time from utils to core.
Sebastian Harl [Mon, 1 Apr 2013 17:56:55 +0000 (19:56 +0200)]
Moved error / time from utils to core.

This is more appropriate.

11 years agostore: Use sdb_object_clone, rather than the private, specific functions.
Sebastian Harl [Sat, 23 Mar 2013 04:14:04 +0000 (21:14 -0700)]
store: Use sdb_object_clone, rather than the private, specific functions.

11 years agostore: Let all store types be public.
Sebastian Harl [Sat, 23 Mar 2013 04:10:08 +0000 (21:10 -0700)]
store: Let all store types be public.

This allows to initialize all store objects in a correctly typed fashion.

11 years agostore: Removed the store specific clone callbacks.
Sebastian Harl [Sat, 23 Mar 2013 03:48:20 +0000 (20:48 -0700)]
store: Removed the store specific clone callbacks.

… in favor of sdb_object_clone().

11 years agoobject: Introduced sdb_object_clone().
Sebastian Harl [Sat, 23 Mar 2013 03:25:44 +0000 (20:25 -0700)]
object: Introduced sdb_object_clone().

11 years agoobject system: Introduced a 'clone' callback for types.
Sebastian Harl [Sat, 23 Mar 2013 03:19:20 +0000 (20:19 -0700)]
object system: Introduced a 'clone' callback for types.

This is currently registered for all 'store' types.

11 years agoobject system: Introduced a concept of types.
Sebastian Harl [Sat, 23 Mar 2013 03:01:57 +0000 (20:01 -0700)]
object system: Introduced a concept of types.

A type is defined by its size and init/destroy functions. This is now used
when creating a new object (of that type) rather than passing all required
callbacks to the object create function.

11 years agoSimplified inherited attribute naming in store objects.
Sebastian Harl [Fri, 22 Mar 2013 05:26:37 +0000 (22:26 -0700)]
Simplified inherited attribute naming in store objects.

This way, we avoid name clashes with other variables that would also be
replaced by the preprocessor.

11 years agoplugin: Log a warning in the main loop if there are no collectors.
Sebastian Harl [Wed, 20 Mar 2013 07:16:08 +0000 (00:16 -0700)]
plugin: Log a warning in the main loop if there are no collectors.

11 years agosysdbd: Set a default interval of 60 seconds.
Sebastian Harl [Wed, 20 Mar 2013 07:12:53 +0000 (00:12 -0700)]
sysdbd: Set a default interval of 60 seconds.

11 years agoUse sdb_error_chomp() to remove newlines from multi-part messages.
Sebastian Harl [Wed, 20 Mar 2013 07:03:42 +0000 (00:03 -0700)]
Use sdb_error_chomp() to remove newlines from multi-part messages.

The actual logging callback should take care of handling that appropriately in
these cases as well.

11 years agoutils error, strbuf: Added sdb_error_chomp(), sdb_strbuf_chomp().
Sebastian Harl [Wed, 20 Mar 2013 07:02:54 +0000 (00:02 -0700)]
utils error, strbuf: Added sdb_error_chomp(), sdb_strbuf_chomp().

These functions may be used to remove all consecutive newline characters from
the end of the respective strings.

11 years agoRemoved newline at the end of sdb_log()'ed strings.
Sebastian Harl [Wed, 20 Mar 2013 06:48:10 +0000 (23:48 -0700)]
Removed newline at the end of sdb_log()'ed strings.

The actual logging callback should take care of handling that appropriately.

11 years agoutils strbuf: Copy va_lists rather than using them twice.
Sebastian Harl [Wed, 20 Mar 2013 06:30:43 +0000 (23:30 -0700)]
utils strbuf: Copy va_lists rather than using them twice.

After a va_list has been passed to a function that uses va_arg(), the value of
the va_list is undefined. Thus, rather copy the list before using it for the
first time to make sure we've got a valid va_list object on the second usage.

11 years agoutils error: Use string buffers rather than static strings.
Sebastian Harl [Wed, 20 Mar 2013 06:29:48 +0000 (23:29 -0700)]
utils error: Use string buffers rather than static strings.

11 years agoutils strbuf: Added an automatically growing string implementation.
Sebastian Harl [Wed, 20 Mar 2013 05:54:20 +0000 (22:54 -0700)]
utils strbuf: Added an automatically growing string implementation.

Whenever writing to the buffer, it will ensure that enough space is allocated
to store all of the string.

11 years agomk-livestatus backend: Use '::' to separate instance in callback names.
Sebastian Harl [Sun, 10 Mar 2013 22:05:11 +0000 (23:05 +0100)]
mk-livestatus backend: Use '::' to separate instance in callback names.

This is just to be consistent with the other plugins.

11 years agoRenamed puppet-storeconfigs backend to puppet::store-configs.
Sebastian Harl [Sun, 10 Mar 2013 22:04:23 +0000 (23:04 +0100)]
Renamed puppet-storeconfigs backend to puppet::store-configs.

11 years agoRenamed collectd backend to collectd::unixsock.
Sebastian Harl [Sun, 10 Mar 2013 21:57:19 +0000 (22:57 +0100)]
Renamed collectd backend to collectd::unixsock.

11 years agoplugin, daemon: Use '::' in plugin names to indicate subdirectories.
Sebastian Harl [Sun, 10 Mar 2013 21:38:05 +0000 (22:38 +0100)]
plugin, daemon: Use '::' in plugin names to indicate subdirectories.

That is, behave similar to Perl when encountering a '::' in a plugin's name and
translate that to a slash. "foo::bar" will thus become PKGLIBDIR/foo/bar.so.
This will be used to name plugins accessing the same backend using different
methods and to have an, imho, nicer name for those.

The daemon will now use that to prepend "backend::" to the name of backends.
This is no different to the behavior before but only uses different names that
will be displayed in log messages.

11 years agoconfigure.ac: Renamed package tarname to all lowercase 'sysdb'.
Sebastian Harl [Sun, 10 Mar 2013 21:20:08 +0000 (22:20 +0100)]
configure.ac: Renamed package tarname to all lowercase 'sysdb'.

This name is used throughout the project, e.g., as file or directory names.

11 years agoMoved sdb_strerror() from utils/string.h to utils/error.h.
Sebastian Harl [Sun, 10 Mar 2013 21:12:07 +0000 (22:12 +0100)]
Moved sdb_strerror() from utils/string.h to utils/error.h.

11 years agoRenamed error recording / logging functions.
Sebastian Harl [Sun, 10 Mar 2013 21:02:35 +0000 (22:02 +0100)]
Renamed error recording / logging functions.

sdb_error_set() now is sdb_log(); the sdb_error_start(), _append(), _finish()
triple is now called sdb_error_set(), _append(), _log(). These names better
describe what's actually going on.

11 years agoUse the sdb_error* function throughout the project.
Sebastian Harl [Sun, 10 Mar 2013 20:45:08 +0000 (21:45 +0100)]
Use the sdb_error* function throughout the project.

11 years agoutils error: Make sure to destroy memory allocated for error information.
Sebastian Harl [Sun, 10 Mar 2013 19:30:11 +0000 (20:30 +0100)]
utils error: Make sure to destroy memory allocated for error information.

11 years agoutils error: Added module for error reporting.
Sebastian Harl [Sun, 10 Mar 2013 19:24:41 +0000 (20:24 +0100)]
utils error: Added module for error reporting.

This module will transparently store error information for each thread (similar
to errno). Support functions to store and retrieve error messages are available
on top of that. Once the error message has been passed to SysDB, it will log
the entire message. Currently, only printing to the standard error channel are
available.

11 years agoRenamed sysdbd.conf to sysdbd.conf.sample.
Sebastian Harl [Sun, 10 Mar 2013 18:37:06 +0000 (19:37 +0100)]
Renamed sysdbd.conf to sysdbd.conf.sample.

Also, unconditionally install that file; the user is expected to not change the
.sample file but rather use her own custom sysdbd.conf (there is no generic
config file anyway that could be shipped and enabled by default).

11 years agosysdbd.conf: Added sample configuration for each plugin.
Sebastian Harl [Sun, 10 Mar 2013 18:31:16 +0000 (19:31 +0100)]
sysdbd.conf: Added sample configuration for each plugin.

11 years agoMerged branch 'master' of git://git.tokkee.org/sysdb.git.
Sebastian Harl [Tue, 5 Mar 2013 01:11:13 +0000 (02:11 +0100)]
Merged branch 'master' of git://git.tokkee.org/sysdb.git.

11 years agoREADME: Added a note about flex/bison.
Sebastian Harl [Mon, 4 Mar 2013 23:06:22 +0000 (00:06 +0100)]
README: Added a note about flex/bison.

11 years agoconfigure: Also check for xmlto (in addition to xsltproc).
Sebastian Harl [Mon, 4 Mar 2013 18:05:47 +0000 (19:05 +0100)]
configure: Also check for xmlto (in addition to xsltproc).

This is also needed by the asciidoc tool-chain (in our situation?).

11 years agoconfigure: Don't use -Wunreachable-code.
Sebastian Harl [Mon, 4 Mar 2013 17:55:03 +0000 (18:55 +0100)]
configure: Don't use -Wunreachable-code.

This seems to cause errors with some versions of GCC when using assertions
that (after optimization, inlining, and code-analysis) will never be true.

11 years agobackends, daemon: Don't shadow global 'socket' and 'daemon' symbols.
Sebastian Harl [Mon, 4 Mar 2013 16:27:31 +0000 (17:27 +0100)]
backends, daemon: Don't shadow global 'socket' and 'daemon' symbols.

11 years agostore, llist: Don't shadow the global symbol 'clone'.
Sebastian Harl [Mon, 4 Mar 2013 16:23:59 +0000 (17:23 +0100)]
store, llist: Don't shadow the global symbol 'clone'.

11 years agoconfigure: Improved the check for disabled puppet-storeconfigs.
Sebastian Harl [Mon, 4 Mar 2013 15:52:36 +0000 (16:52 +0100)]
configure: Improved the check for disabled puppet-storeconfigs.

11 years agosdb_plugin.m4: Provide more details if a plugin is disabled by default.
Sebastian Harl [Mon, 4 Mar 2013 15:51:26 +0000 (16:51 +0100)]
sdb_plugin.m4: Provide more details if a plugin is disabled by default.

The default value passed to AC_SDB_PLUGIN might contain additional information
about why the plugin has been disabled by default. This information should be
forwarded to the user.

11 years agoconfigure: Don't pre-set enable_<plugin> variables.
Sebastian Harl [Mon, 4 Mar 2013 15:49:59 +0000 (16:49 +0100)]
configure: Don't pre-set enable_<plugin> variables.

This would cause AC_SDB_PLUGIN to assume that the respective --enable-<plugin>
option was given on the command-line and, thus, behave unexpected when this is
not the case.

11 years agopuppet-storeconfigs backend: Check database connection in collect callback.
Sebastian Harl [Wed, 20 Feb 2013 21:52:38 +0000 (22:52 +0100)]
puppet-storeconfigs backend: Check database connection in collect callback.

11 years agoutils dbi: Added sdb_dbi_client_check_conn().
Sebastian Harl [Wed, 20 Feb 2013 21:50:15 +0000 (22:50 +0100)]
utils dbi: Added sdb_dbi_client_check_conn().

This functions checks the database connection and tries to reconnect if there
was a problem. The return code determines if the connection was usable
afterwards.

11 years agoutils dbi: Avoid segfault when executing queries when not connected.
Sebastian Harl [Tue, 19 Feb 2013 17:39:46 +0000 (18:39 +0100)]
utils dbi: Avoid segfault when executing queries when not connected.

Apparently, the libdbi functions don't check for that condition.

11 years agoRenamed the project to SysDB (System DataBase).
Sebastian Harl [Wed, 2 Jan 2013 21:10:00 +0000 (22:10 +0100)]
Renamed the project to SysDB (System DataBase).

This name more closely resembles the actual intent / goal of the project.

The prefix for defines / function / etc. has been changed to sdb_.

11 years agoAdded missing daemon/config.h.
Sebastian Harl [Wed, 2 Jan 2013 21:07:14 +0000 (22:07 +0100)]
Added missing daemon/config.h.

11 years agostore: Fixed host lock handling.
Sebastian Harl [Wed, 2 Jan 2013 09:18:01 +0000 (10:18 +0100)]
store: Fixed host lock handling.

Release the lock before returning in error conditions.

11 years agoPuppet storeconfigs backend: Query facts and store them as host attributes.
Sebastian Harl [Mon, 17 Dec 2012 10:42:02 +0000 (11:42 +0100)]
Puppet storeconfigs backend: Query facts and store them as host attributes.

11 years agostore: Added support for host attributes.
Sebastian Harl [Mon, 17 Dec 2012 10:39:48 +0000 (11:39 +0100)]
store: Added support for host attributes.

Attributes are a list of key / value pairs assigned to a host object. They may
be used to store arbitrary properties, settings, or other characteristics of a
host.

Later on, this information will also be used to filter, group, or
hierarchically order hosts.

11 years agostore: Print the right update timestamp when dumping services.
Sebastian Harl [Mon, 17 Dec 2012 10:37:56 +0000 (11:37 +0100)]
store: Print the right update timestamp when dumping services.

11 years agoMK Livestatus backend: Added support for querying services.
Sebastian Harl [Thu, 13 Dec 2012 13:15:12 +0000 (14:15 +0100)]
MK Livestatus backend: Added support for querying services.

This is done using the livestatus 'GET services' command.

11 years agoMK Livestatus backend: Converted to use sc_unixsock_client_process_lines().
Sebastian Harl [Thu, 13 Dec 2012 12:57:38 +0000 (13:57 +0100)]
MK Livestatus backend: Converted to use sc_unixsock_client_process_lines().

This removes the need to do the parsing of returned lines in the backend code.

11 years agocollectd backend: Converted to use sc_unixsock_client_process_lines().
Sebastian Harl [Thu, 13 Dec 2012 12:37:45 +0000 (13:37 +0100)]
collectd backend: Converted to use sc_unixsock_client_process_lines().

This removes the need to do the parsing of returned lines in the backend code.

11 years agoobject.h: Added SC_OBJECT_WRAPPER_STATIC().
Sebastian Harl [Thu, 13 Dec 2012 12:37:14 +0000 (13:37 +0100)]
object.h: Added SC_OBJECT_WRAPPER_STATIC().

This may be used to initialize static sc_object_wrapper_t objects.

11 years agostore: Changed various parameters to 'const char *'.
Sebastian Harl [Thu, 13 Dec 2012 12:35:34 +0000 (13:35 +0100)]
store: Changed various parameters to 'const char *'.

None of these parameters will be modified, so all to pass in constant strings.

11 years agoutils dbi + unixsock: Pass user-data object to data processing callbacks.
Sebastian Harl [Wed, 12 Dec 2012 05:15:11 +0000 (06:15 +0100)]
utils dbi + unixsock: Pass user-data object to data processing callbacks.

This may be used to access, for example, state information throughout each
call.

11 years agoutils unixsock: Added sc_unixsock_client_process_lines().
Sebastian Harl [Tue, 11 Dec 2012 18:43:26 +0000 (19:43 +0100)]
utils unixsock: Added sc_unixsock_client_process_lines().

This function may be used to process data returned from the socket line by
line. The function will split each line into columns. The data-types of each
column may be specified by the caller.

This is similar to the DBI query abstraction function (sc_dbi_exec_query()) in
that in takes care of all the annoying data parsing and conversion stuff.

11 years agoutils data: Added module providing a data-type to store arbitrary backend data
Sebastian Harl [Tue, 11 Dec 2012 18:40:04 +0000 (19:40 +0100)]
utils data: Added module providing a data-type to store arbitrary backend data

This has been ripped out of the DBI module to make the functionality available
to other modules as well through a uniform interface.

11 years agosyscollectord: Include extra version information in startup/shutdown messages.
Sebastian Harl [Tue, 11 Dec 2012 10:03:16 +0000 (11:03 +0100)]
syscollectord: Include extra version information in startup/shutdown messages.

11 years agoAdded initial version of the MK Livestatus backend.
Sebastian Harl [Tue, 11 Dec 2012 10:00:11 +0000 (11:00 +0100)]
Added initial version of the MK Livestatus backend.

This backend uses the MK Livestatus interface available for Nagios, Icinga,
Shinken and possibly other software, to retrieve host information from those
monitoring systems.

11 years agoutils unixsock: Added wrappers for clearerr(), feof(), and ferror().
Sebastian Harl [Tue, 11 Dec 2012 09:58:13 +0000 (10:58 +0100)]
utils unixsock: Added wrappers for clearerr(), feof(), and ferror().

11 years agoutils unixsock: Added sc_unixsock_client_shutdown().
Sebastian Harl [Tue, 11 Dec 2012 09:55:36 +0000 (10:55 +0100)]
utils unixsock: Added sc_unixsock_client_shutdown().

This function is a wrapper around shutdown(3). After shutting down send /
receive operations, the client will automatically re-connect on the next
send() / recv() call.

11 years agostore: Return a positive value when to-be-stored host/service is too old.
Sebastian Harl [Tue, 11 Dec 2012 09:43:42 +0000 (10:43 +0100)]
store: Return a positive value when to-be-stored host/service is too old.

This allows to let the caller decide what to do in that case.