store: Don't report an error in scan() if the store is still empty.
sysdb: Simplified prompt used for continuation lines.
frontend/store: Free dynamically allocated memory of attribute values.
frontend/store: Fixed parsing of STORE attribute commands.
In this case, the object type is a bit-wise OR of the parent type and the
attribute type.
In this case, the object type is a bit-wise OR of the parent type and the
attribute type.
frontend/store: Fixed parsing of STORE command.
After parsing the type, keep it still around in the current buffer. The
sdb_proto_unmarshal_<type> functions expect to find it as well.
After parsing the type, keep it still around in the current buffer. The
sdb_proto_unmarshal_<type> functions expect to find it as well.
plugin: Let store writer plugin object inherit from generic plugin objects.
Else, we cannot use them in the same way.
Else, we cannot use them in the same way.
client: Use sdb_client_rpc in sdb_client_connect.
client: Added sdb_client_rpc.
This function handles a full RPC call: it sends a message to the server and
waits for the reply. While doing so, it handles all asynchronous log messages.
That is, it'll return the actual result status of the command.
This function handles a full RPC call: it sends a message to the server and
waits for the reply. While doing so, it handles all asynchronous log messages.
That is, it'll return the actual result status of the command.
store: Pass on all stored objects to store writer plugins.
core: Add the store writer plugin type.
A plugin may now provide an implementation of a store by providing a set of
callbacks. For now, this is only about writing to a store. Queries are not
supported through this interface.
A plugin may now provide an implementation of a store by providing a set of
callbacks. For now, this is only about writing to a store. Queries are not
supported through this interface.
plugin: Reload time-series fetcher callbacks as well.
integration/config.sh: Add a test to load and reload a plugin.
t/integration: Add a simple time-series fetcher test.
connection_test: Updated according to latest changes.
sysdbql(7): Document the STORE commands.
connection: Log peer information after accepting a connection.
sysdb: Use the current user's homedir rather than the SysDB user.
connection: Let sdb_connection_accept() handle all connection setup.
… rather than having it split up between the caller and accept().
… rather than having it split up between the caller and accept().
client: Add support for TCP connections.
frontend: Add support for TCP connections.
This is the new default listener type (unless the listen address starts with a
slash in which case a UNIXSOCK connection is used).
This does not support any kind of peer lookup yet. Instead, it'll fully trust
the client for now and accept any username. In the future, this will be
configurable and multiple mechanisms (e.g. ident, SSL cert) will be supported.
This is the new default listener type (unless the listen address starts with a
slash in which case a UNIXSOCK connection is used).
This does not support any kind of peer lookup yet. Instead, it'll fully trust
the client for now and accept any username. In the future, this will be
configurable and multiple mechanisms (e.g. ident, SSL cert) will be supported.
frontend: Make peer detection more flexible.
It's now a property of a listener implementation.
Moved the unixsock implementation over from frontend/connection to
frontend/sock.
It's now a property of a listener implementation.
Moved the unixsock implementation over from frontend/connection to
frontend/sock.
os utils: Fixed a typo in the UDP resolver implementation.
frontend/sock: Simplified internal address handling.
Strip the <type>: prefix early. Else, we'd have to strip it off over and over
again when working with the address string.
Strip the <type>: prefix early. Else, we'd have to strip it off over and over
again when working with the address string.
connection: Update the connection name as early as possible.
This is just to avoid weird error messages if setting up the connection
failed.
This is just to avoid weird error messages if setting up the connection
failed.
os utils: Added sdb_resolve().
This is a convenient wrapper around getaddrinfo().
This is a convenient wrapper around getaddrinfo().
client: Make I/O handling more flexible.
frontend: Make connection I/O handling more flexible.
That'll allow to create connection objects which require special I/O
operations.
That'll allow to create connection objects which require special I/O
operations.
sysdb: Accept status=OK after sending a query.
OK is sent back on successful STORE commands.
OK is sent back on successful STORE commands.
frontend/grammar: Added 'STORE host|service|metric [attribute]' commands.
This implements the STORE command in SysQL.
This implements the STORE command in SysQL.
frontend: Add support for SDB_CONNECTION_STORE.
The front-end now supports parsing and executing STORE commands.
The front-end now supports parsing and executing STORE commands.
store: Let store_metric() accept non-NULL but empty metric-store.
proto: Added support for unmarshaling hosts/services/metrics/attributes.
proto: Let unmarshaled string/binary data point into the provided buffer.
The caller may decide whether to keep a copy or not.
The caller may decide whether to keep a copy or not.
utils unixsock: Avoid memory allocations in common cases.
data: Let sdb_data_parse() accept a const string and copy it if necessary.
Given that we need a copy for regex values anyway, this is more consistent.
Given that we need a copy for regex values anyway, this is more consistent.
frontend/scanner: Pass the right size to strncat.
Thanks to clang for identifying this :-)
Thanks to clang for identifying this :-)
sysdb/scanner.l: Include ctype.h; needed for isspace().
Link librt into libsysdbclient.
That's required for clock_gettime.
That's required for clock_gettime.
proto: Added sdb_proto_unmarshal_data().
This function decodes a datum from the wire format.
This function decodes a datum from the wire format.
data: Free binary and regex array values as well.
data: Let sdb_data_cmp() support all array types.
proto: Let unmarshal functions return the number of bytes processed.
That's a more flexible and straight-forward interface allowing callers to not
care about the size of the expected data.
That's a more flexible and straight-forward interface allowing callers to not
care about the size of the expected data.
proto: Added support for marshaling attribute objects.
proto: Use hton instead of ntoh functions in marshal functions.
D'oh!
D'oh!
proto: Define a wire format for host/service/metric and add marshal functions.
proto: Don't include a string's length in the wire format.
That's not necessary given that all strings are null-terminated.
That's not necessary given that all strings are null-terminated.
Add a suffix to integer marshal/unmarshal functions specifying the int size.
proto: Add support for marshaling all data types.
proto: Add support for marshaling regex types.
That is, marshal the regex's raw string to be recompiled by the receiver.
That is, marshal the regex's raw string to be recompiled by the receiver.
proto: Added support for marshaling double-precision values.
For this, determine the memory layout of doubles in 'configure' and then use
IEEE-754 big-endian encoding on the wire. For now, only little- and big-endian
IEEE-754 doubles are supported but that'll cover the vast majority of all
systems.
For this, determine the memory layout of doubles in 'configure' and then use
IEEE-754 big-endian encoding on the wire. For now, only little- and big-endian
IEEE-754 doubles are supported but that'll cover the vast majority of all
systems.
proto: Added sdb_proto_marshal_data.
This function encodes a datum into the wire format.
This function encodes a datum into the wire format.
utils/proto: Let all unmarshal functions accept strings instead of strbufs.
This is more consistent and flexible.
This is more consistent and flexible.
utils/strbuf: Added SDB_STRBUF_STR.
This macro returns a tuple describing the buffer content and length. The idea
is that functions which operate on (binary) strings should accept two such
arguments and the macro will make it easier to pass them in.
This macro returns a tuple describing the buffer content and length. The idea
is that functions which operate on (binary) strings should accept two such
arguments and the macro will make it easier to pass them in.
proto: Renamed sdb_proto_get_int to sdb_proto_unmarshal_int.
… to be consistent with the other functions.
… to be consistent with the other functions.
connection: Use sdb_connection_close to close a connection.
connection: Use sdb_proto_unmarshal_header.
proto: Add sdb_proto_unmarshal_header().
Moved sdb_proto_send/sdb_proto_select to sdb_write/sdb_select.
These functions are not protocol-specific but rather simple wrappers around
system calls.
These functions are not protocol-specific but rather simple wrappers around
system calls.
connection: Let sdb_connection_close not deallocate the connection.
That'll allow for more flexible use.
That'll allow for more flexible use.
connection: Renamed sdb_connection_read to sdb_connection_handle.
The function does more than read from the connection, so the old name was a
bad choice.
The function does more than read from the connection, so the old name was a
bad choice.
utils/proto: Replaced sdb_proto_send_msg with sdb_proto_marshal.
The new function won't actually send the message but write it into a provided
buffer in the wire format. This allows for more flexible use of the function.
The new function won't actually send the message but write it into a provided
buffer in the wire format. This allows for more flexible use of the function.
Merged branch 'master' of git://git.tokkee.org/sysdb.
sysdb: Use sdb_log() instead of printf().
sysdb: Wait for the actual reply after sending a command.
Otherwise, multiple replies (log messages) will be interleaved with input
prompts.
Otherwise, multiple replies (log messages) will be interleaved with input
prompts.
sysdb: Only try to reconnect before executing a command or on an empty line.
sysdb: Fixed check for duplicate history entries.
current_history() returns the currently *selected* history entry. Rather, we
want the latest entry, that is, the one added last.
current_history() returns the currently *selected* history entry. Rather, we
want the latest entry, that is, the one added last.
sysdb: Store all commands in the history; even if they failed.
sysdb: Parse strings correctly.
… and focus only on syntax elements that may include semicolons and escape
their meaning as a query terminator.
… and focus only on syntax elements that may include semicolons and escape
their meaning as a query terminator.
sysdb: Do an attempt to reconnect on all user input.
sysdb: Don't exit if the server closed the connection.
Instead, notify the user an try to reconnect before executing the next
command.
Instead, notify the user an try to reconnect before executing the next
command.
sysdb: Make sure to properly reset term attributes.
Don't record the "old" settings on each call to rawmode since we do that a lot
of times. Also, don't use up all atexit handler slots this way.
Don't record the "old" settings on each call to rawmode since we do that a lot
of times. Also, don't use up all atexit handler slots this way.
sysdb: Clear the current command from the buffer after error.
store.h: Make it such that HOST/SERVICE/METRIC don't share bits with ATTRIBUTE
An attribute can be assigned to any of the other types. This approach allows
to represent host-, service-, and metric-attributes in one byte.
An attribute can be assigned to any of the other types. This approach allows
to represent host-, service-, and metric-attributes in one byte.
frontend: Get the username of the remote peer from a UNIX socket.
Then, only allow that user to authenticate against the daemon. That is, use
the same as PostgreSQL's "peer" authentication for all connections.
Then, only allow that user to authenticate against the daemon. That is, use
the same as PostgreSQL's "peer" authentication for all connections.
utils/os: Added sdb_get_current_user().
… copied from sysdb/main.c which now uses this new function.
… copied from sysdb/main.c which now uses this new function.
README: Added libfacter and librrd to list of prerequisites.
Added documentation and sample configuration for the facter backend.
facter plugin: Added a plugin collecting local facter values.
The plugin uses libfacter from the cfacter project. libfacter is a C++
library, so the plugin is implemented in C++ as well using a small shim to
talk to SysDB.
The plugin uses libfacter from the cfacter project. libfacter is a C++
library, so the plugin is implemented in C++ as well using a small shim to
talk to SysDB.
Bootstrap the build system for C++ as well.
That is, check CXX support for strict compiler flags.
Also, use all configured strict flags when checking for other strict flags.
This way, we detect problems when using flags that are not supported in C++
mode.
That is, check CXX support for strict compiler flags.
Also, use all configured strict flags when checking for other strict flags.
This way, we detect problems when using flags that are not supported in C++
mode.
Use stdbool.h's bool type instead of _Bool.
That'll work with C++ as well.
That'll work with C++ as well.
analyzer: Analyze expressions as well; validate typed expressions.
Also, added various tests for typed expressions.
Also, added various tests for typed expressions.
frontend/grammar: Added support for <obj_type> . <obj_expression>.
… where <obj_expression> may be an arbitrary expression accessing an object's
fields or attributes.
… where <obj_expression> may be an arbitrary expression accessing an object's
fields or attributes.
store: Added sdb_store_expr_typed.
This function creates an expression which evaluates another expression in the
context of an object's sibling. The sibling is specified by type and refers to
a parent or child node of the specified type.
This function creates an expression which evaluates another expression in the
context of an object's sibling. The sibling is specified by type and refers to
a parent or child node of the specified type.
store.h: Fixed a typo.
core/store.h: Reordered file to group related functions better.
frontend/scanner: Fixed parsing of time values.
It turns out, mktime() cannot be used to parse a time (at day 0). Let's do it
manually then, it's no big magic anyway ;-)
It turns out, mktime() cannot be used to parse a time (at day 0). Let's do it
manually then, it's no big magic anyway ;-)
timeseries::rrdtool: Limit to 1000 data-points for now.
That's good enough for most use cases (ought to be enough for anybody!) and
avoids excessive memory use when requesting data.
That's good enough for most use cases (ought to be enough for anybody!) and
avoids excessive memory use when requesting data.
store: Include in metric JSON whether access to time-series is available.
… based on whether a time-series store is configured for the metric.
… based on whether a time-series store is configured for the metric.
store_json: Escape special characters in strings.
version-gen.sh: Added .git suffix to default version again.
Release SysDB 0.6.0.
Make sure to print non-a-number as 'nan'.
Some versions of GNU libc use '-nan' instead which we don't want. For example,
Go's JSON package doesn't support that at all.
Some versions of GNU libc use '-nan' instead which we don't want. For example,
Go's JSON package doesn't support that at all.
sysdbql(7): Documented arrays.
Drafted release notes for 0.6.0.
data: Let concat support empty arrays; add various tests for empty arrays.
Merged branch 'master' of git://git.tokkee.org/sysdb.
sysdbql(7): Documented <array> IN <array>.
frontend: Added support for array constants.
data: Let inarray() support <array> IN <array> checks.
This check returns true if all elements of the first array are included in the
second array where order does not matter.
This check returns true if all elements of the first array are included in the
second array where order does not matter.
Renamed CONNECTION_* constants to SDB_CONNECTION_*.
All public symbols should use the "sdb" prefix.
All public symbols should use the "sdb" prefix.