utils llist: Updated documentation.
utils llist: Added lookup callback type to be used for llist_search.
Lookups should be more flexible than comparing two objects.
Lookups should be more flexible than comparing two objects.
utils llist: Added sdb_llist_cmp_cb type.
This is to make sure that comparators always use the same signature.
This is to make sure that comparators always use the same signature.
plugin: Removed sdb_ prefix from private functions.
plugin: Store real plugin name and filename in the context.
plugin: Store plugin info attributes in the plugin context.
plugin: Manage all context information in the core.
Store the new dynamic context in callbacks. The daemon may no longer set the
context before loading a plugin. Instead, sdb_plugin_load now accepts a second
parameter specifying the public context attributes.
Store the new dynamic context in callbacks. The daemon may no longer set the
context before loading a plugin. Instead, sdb_plugin_load now accepts a second
parameter specifying the public context attributes.
plugin: Made plugin context a dynamic object.
A custom type is used for that. The previous context type is used as a public
member of the new internal type. Thus, the external interface does not change.
A custom type is used for that. The previous context type is used as a public
member of the new internal type. Thus, the external interface does not change.
plugin: Dynamically allocate plugin info attributes.
This will allow to keep the information around forever.
This will allow to keep the information around forever.
unit tests: Added basic tests for unixsock utils; mocking libc I/O functions.
GNU libc's fopencookie is used to mock fdopen() and socket handling. This
allows to mock a UNIX socket.
GNU libc's fopencookie is used to mock fdopen() and socket handling. This
allows to mock a UNIX socket.
utils unixsock: Explicitely enable line-buffering.
The module is based on that, so say it explicitely.
The module is based on that, so say it explicitely.
t/utils/strbuf_test: Added lists of golden data for various checks.
This makes it much easier to add more checks for particular functions.
This makes it much easier to add more checks for particular functions.
sysdb.h.in: Reintroduced SDB_STATIC_ARRAY_LEN().
Previously only added to the auto-generated sysdb.h :-/ D'oh!
Previously only added to the auto-generated sysdb.h :-/ D'oh!
t/: Added unit tests for the string buffer utilities.
utils strbuf: Fixed a wrong assertion.
utils strbuf: Allow the initial size to be zero.
t/utils/: Name test-cases after the tested function.
This might make it possible to do coverage tests.
This might make it possible to do coverage tests.
t/utils/dbi_test: Added test queries covering 2-5 columns.
t/utils/dbi_test: Fixed further indexing.
t/utils/dbi_test: Fixed indexing into the golden_data array.
t/utils/dbi_test: Added missing cases in dbi_result_get_field_length_idx().
t/utils/dbi_test: Verify the received data.
t/utils/dbi_test: Added mock queries covering various corner cases.
t/utils/dbi_test: Mock some actual query results; added simple query.
The unit-test now supports mocking arbitrary query results. For that,
appropriate mocks for the dbi_result_get*() functions have been added.
The test now executes a simple query returning one column of data.
The unit-test now supports mocking arbitrary query results. For that,
appropriate mocks for the dbi_result_get*() functions have been added.
The test now executes a simple query returning one column of data.
t/libsysdb_test: Use a list of test-suite creators.
… rather than adding a new block for each new test-suite.
… rather than adding a new block for each new test-suite.
t/utils/dbi_test: Added a simple test-case for query execution.
Added simple mocks for query and result handling.
Added simple mocks for query and result handling.
t/: Added initial version of unit tests for utils/dbi.
The test cases mocks out any (expected) calls to libdbi.
The test cases mocks out any (expected) calls to libdbi.
t/: Make the test-suite compile with strict compiler flags.
t/: Fixed header include order.
Makefile, t/Makefile: Added 'test' alias for 'check'.
t/utils/llist_test: Check sdb_llist_create() return value in setup().
t/utils/llist_test: Added tests for clone and destroy.
Added unit testing framework based on ‘check’.
For now, some basic tests for utils::list have been added.
For now, some basic tests for utils::list have been added.
configure: Added cname::dns to summary output.
sysdbd.conf(5): Added a short description for each plugin.
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.
This is not used currently. Since it only introduces unneeded complexity (and
somewhat ugly code in some cases), it's better to remove it.
store: Support NULL attribute values.
store: Handle cname translation centrally.
store: Handle locking correctly when storing attributes.
We cannot release the lock before the attribute update is finished.
We cannot release the lock before the attribute update is finished.
store: Use generic store function also to store attributes.
Except for small special cases, this is exactly the same as storing other
store objects.
Except for small special cases, this is exactly the same as storing other
store objects.
store: Pass the right timestamp to newly created store objects.
Also, fixed object initialization.
Also, fixed object initialization.
store: Use sdb_object_vcreate() when creating objects from super-class.
This allows to pass all required arguments to the init function.
This allows to pass all required arguments to the init function.
object: Added sdb_object_vcreate().
This function expects an va_list argument rather than a "true" variadic list
of arguments.
This function expects an va_list argument rather than a "true" variadic list
of arguments.
store: Use store super-class when storing objects.
This makes the function even more flexible.
This makes the function even more flexible.
store: Canonicalize hostname before storing a service.
Else, host to service mapping is not correct.
Else, host to service mapping is not correct.
store: Refactored host/service store code.
Simplified the code based on the new internal data structures.
Simplified the code based on the new internal data structures.
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.
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.
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.
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.
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.
The user should interact through the objects names or 'features' rather than
accessing any of the objects themselves.
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.
There's no need in letting the caller construct a service object. All passed
in strings are treated as constant values anyway.
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.
… rather than an attribute object. This eases memory management for the caller
and removes unnecessary string duplicates.
store: Removed unused function sdb_store_get_service().
This may be reintroduced if and when it's needed.
This may be reintroduced if and when it's needed.
store: Removed unsed function sdb_service_create().
There is no need to expose this data-type.
There is no need to expose this data-type.
store: Removed unused sdb_attribute_create().
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.
… 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.
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.
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.
store: Removed unused sdb_host_create() function.
store: Renamed 'parent' attribute to 'super'.
We might use 'parent' in different places in the future.
We might use 'parent' in different places in the future.
sysdbd.conf: Improved 'cname' documentation.
sysdbd.conf: Added and documented a sample LoadPlugin "cname::dns".
cname::dns: Added first version of a plugin to query DNS for cnames.
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.
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.
plugin: Added formatting log functions.
plugin: Removed another custom lookup-by-name function.
… and use sdb_llist_search_by_name() instead.
… and use sdb_llist_search_by_name() instead.
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.
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.
sysdbd.conf(5): Added 'syslog' plugin.
error: Updated documentation; removed obsolete TODO note.
syslog plugin: Added plugin to log to syslog.
config: Added support for (generic) LoadPlugin.
plugin: Added support for log callbacks.
Use this logging mechanism to log messages from the error module.
Use this logging mechanism to log messages from the error module.
sysdbd.conf(5): Added an initial manpage for sysdbd's configuration.
Merged branch 'master' of git://git.tokkee.org/sysdb.git.
Moved data.h from utils to core.
This should also be considered a core component ;-)
This should also be considered a core component ;-)
Moved error / time from utils to core.
This is more appropriate.
This is more appropriate.
store: Use sdb_object_clone, rather than the private, specific functions.
store: Let all store types be public.
This allows to initialize all store objects in a correctly typed fashion.
This allows to initialize all store objects in a correctly typed fashion.
store: Removed the store specific clone callbacks.
… in favor of sdb_object_clone().
… in favor of sdb_object_clone().
object: Introduced sdb_object_clone().
object system: Introduced a 'clone' callback for types.
This is currently registered for all 'store' types.
This is currently registered for all 'store' types.
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.
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.
Simplified inherited attribute naming in store objects.
This way, we avoid name clashes with other variables that would also be
replaced by the preprocessor.
This way, we avoid name clashes with other variables that would also be
replaced by the preprocessor.
plugin: Log a warning in the main loop if there are no collectors.
sysdbd: Set a default interval of 60 seconds.
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.
The actual logging callback should take care of handling that appropriately in
these cases as well.
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.
These functions may be used to remove all consecutive newline characters from
the end of the respective strings.
Removed newline at the end of sdb_log()'ed strings.
The actual logging callback should take care of handling that appropriately.
The actual logging callback should take care of handling that appropriately.
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.
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.
utils error: Use string buffers rather than static strings.
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.
Whenever writing to the buffer, it will ensure that enough space is allocated
to store all of the string.
mk-livestatus backend: Use '::' to separate instance in callback names.
This is just to be consistent with the other plugins.
This is just to be consistent with the other plugins.
Renamed puppet-storeconfigs backend to puppet::store-configs.
Renamed collectd backend to collectd::unixsock.
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.
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.
configure.ac: Renamed package tarname to all lowercase 'sysdb'.
This name is used throughout the project, e.g., as file or directory names.
This name is used throughout the project, e.g., as file or directory names.
Moved sdb_strerror() from utils/string.h to utils/error.h.
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.
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.
Use the sdb_error* function throughout the project.
utils error: Make sure to destroy memory allocated for error information.
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.
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.
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).
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).