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.
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.
data: Support array + element concatenation.
That is, concatenation may be used to prepend to or append to an array.
That is, concatenation may be used to prepend to or append to an array.
data: Let strlen() and format() support string/decimal/integer arrays.
core: Improved style related to conditionals using many branches.
sysdbql(7): Documented iterator support for arrays.
store: Avoid unnecessary data copies when "evaluating" constant values.
store: Let array iterators support regex matches as well.
That is, all operators are supported now.
That is, all operators are supported now.
store: Let NREGEX (!~) not match on NULL values.
parser_test: Added various ANY/ALL iterator tests; also for arrays.
data: Don't treat empty arrays (value = NULL) as NULL.
Treating them as NULL leads to weird behavior when using ANY/ALL iterators.
Treating them as NULL leads to weird behavior when using ANY/ALL iterators.
store, frontend: Added support for iterating arrays (using ALL / ANY).
Currently, this is limited to the 'backend' field of an object. Also, only
simple statements like 'ANY/ALL <array> <cmp> <value>' are supported by the
store (in contrast to service/metric iterators which support arbitrary
matchers to be applied). Given that matchers are object based, this limitation
should feel natural, though.
Currently, this is limited to the 'backend' field of an object. Also, only
simple statements like 'ANY/ALL <array> <cmp> <value>' are supported by the
store (in contrast to service/metric iterators which support arbitrary
matchers to be applied). Given that matchers are object based, this limitation
should feel natural, though.
store.h: Use separate value ranges for object and field types.
This allows to use the same flag to store either object or field types or even
a combination of both.
This allows to use the same flag to store either object or field types or even
a combination of both.
store: Merged implementations of compare matchers.
This allowed to factor out the actual comparison functionality, thus making it
reusable.
This allowed to factor out the actual comparison functionality, thus making it
reusable.
data: Added sdb_data_array_get().
This function retrieves an array element, returning an "alias" to its value.
This function retrieves an array element, returning an "alias" to its value.
sysdbql(7): Updated documentation according to latest language changes.
Lots of stuff has changed … and it's much better now :-)
Lots of stuff has changed … and it's much better now :-)
frontend/grammar: Drop support for the special 'host' field.
The old implementation didn't work when querying services or metrics and for
hosts it's the same as querying the 'name' field.
The old implementation didn't work when querying services or metrics and for
hosts it's the same as querying the 'name' field.
frontend/grammar: Let LOOKUP support all object types.
frontend: Let the 'lookup' command support services and metrics.
store_lookup: Let the iter operators support services and metrics.
frontend: Let the analyzer report details about errors.
data: Add to-string support for array types.
frontend: Improved parser error reporting.
All error messages are now written to a string buffer, allowing them to be
displayed as part of the main error messages associated with failed commands.
All error messages are now written to a string buffer, allowing them to be
displayed as part of the main error messages associated with failed commands.
frontend/grammar: Added sdb_fe_yyerrorf() helper.
utils/error: Added sdb_vlog().
This function is like sdb_log() but accept a va_list.
This function is like sdb_log() but accept a va_list.
frontend/grammar: Added support for FETCHing all object types.
frontend: Let the parser run the analyzer.
… but only when parsing a full statement. Otherwise, the analyzer is missing
the context for verification.
… but only when parsing a full statement. Otherwise, the analyzer is missing
the context for verification.
parser_test: Fixed semantically invalid filter statements.
These errors are only detected by the analyzer which is not used for the
parser test.
These errors are only detected by the analyzer which is not used for the
parser test.
frontend/analyzer: Check name parameters for FETCH.
frontend: Fixed various size checks.
frontend: Let the 'fetch' command support other types besides hosts.
store: Added sdb_store_get_child().
This function may be used to retrieve a host's child object (service, metric,
attribute) by it's name.
This function may be used to retrieve a host's child object (service, metric,
attribute) by it's name.
store: Removed now unused tojson functions.
frontend: Let FETCH and LIST use JSON formatters.
… instead of the old tojson functions.
… instead of the old tojson functions.
frontend: Let FETCH apply filters to the host as well.
store: Let JSON formatter know about the to-be-formatted object type.
When formatting services or metrics, expect those objects to be emitted on the
highest level and then create the host object for them first (once for a
series of objects belonging to the same host).
When formatting services or metrics, expect those objects to be emitted on the
highest level and then create the host object for them first (once for a
series of objects belonging to the same host).
store: Let the JSON formatter know about arrays at top level.
There's no reason to require this to be handled separately.
There's no reason to require this to be handled separately.
t/: Added tests for json_formatter-based JSON generation.
store: Record each object's parent.
frontend/query: Use the new JSON formatter to implement LOOKUP.
This will allow for more flexiblity.
This will allow for more flexiblity.
store: Added a generic JSON formatter.
It works by consuming single objects of any type (host, service, metric,
attribute) at a time and appending their JSON serialization to a string
buffer. The current position in the object tree is recorded in an internal
state.
A helper function is provided on top of the base formatter which allows to
handle an full object at a time.
It works by consuming single objects of any type (host, service, metric,
attribute) at a time and appending their JSON serialization to a string
buffer. The current position in the object tree is recorded in an internal
state.
A helper function is provided on top of the base formatter which allows to
handle an full object at a time.
store: Provide more verbose messages on errors during scanning.
store_lookup_test: Ensure that filters are applied before matchers.
sysdbql(7): Link to the JSON RFC.
store: Let sdb_store_scan() pass on filters to callback functions.
The callback function needs access to the filter anyway, so let's handle this
centrally.
The callback function needs access to the filter anyway, so let's handle this
centrally.
store: Use sdb_avltree_lookup() to retrieve attributes.
… rather than iterating through all attributes. D'oh!
… rather than iterating through all attributes. D'oh!
store: Let sdb_store_scan() support other object types besides hosts.
store: Merged sdb_store_iterate() into sdb_store_scan().
These functions are really the same when using a NULL matcher and filter.
These functions are really the same when using a NULL matcher and filter.
frontend: Added basic support for semantic AST analysis.
For now, the analyzer checks the types of all matcher operands.
For now, the analyzer checks the types of all matcher operands.
frontend: Let scanner/parser know about object types and field names.
This allows to handle all known objects and fields as part of the grammar
rather than manually parsing them and generating custom error messages.
This allows to handle all known objects and fields as part of the grammar
rather than manually parsing them and generating custom error messages.
frontend/grammar: Access fields by their name rather than '.<name>'.
There's no more need for a special and somewhat weird syntax.
There's no more need for a special and somewhat weird syntax.
frontend/grammar: Added support for 'ALL <obj> <cmp> <expr>'.
This matches, if all of the specified objects match the specified expression.
ALL also matches on empty object lists.
This matches, if all of the specified objects match the specified expression.
ALL also matches on empty object lists.
store: Removed unused types.
store: Added support for ALL matchers.
Similar to ANY, this matcher iterators over objects. It matches, if *all* of
those objects match another matcher.
Similar to ANY, this matcher iterators over objects. It matches, if *all* of
those objects match another matcher.
store: Don't special case negated matchers in the ANY matcher.
The old behavior no longer makes sense when thinking about matching *any*
object.
The old behavior no longer makes sense when thinking about matching *any*
object.
frontend/grammar: Changed '<obj> <cmp> <expr>' to 'ANY <obj> <cmp> <expr>'.
… for services, metrics, and attributes. That is, let this involve less magic
but make it clear that this looks at multiple objects and matches if any of
them match.
… for services, metrics, and attributes. That is, let this involve less magic
but make it clear that this looks at multiple objects and matches if any of
them match.
store: Renamed child-matcher to any-matcher.
It matches if any object of an iterable list matches, so this is a more
appropriate name.
It matches if any object of an iterable list matches, so this is a more
appropriate name.
data_test: Test various unsupported expressions.
store: During lookup use strcmp() only for unknown data-types.
Unknown data-types means that we don't know the type of either one expression
before hand. For example, this is true for attributes given that there is no
schema.
Unknown data-types means that we don't know the type of either one expression
before hand. For example, this is true for attributes given that there is no
schema.
store: Record the data-type of an expression.
data: Added sdb_data_expr_type().
This function returns the expected type of the result of an arithmetic
expression based on the operator and input types.
This function returns the expected type of the result of an arithmetic
expression based on the operator and input types.
store: Removed now unused name-matcher and sdb_store_matcher_parse_cmp().
t/: Converted name matcher tests to new style matchers.
frontend/grammar: Implement '<obj> <op> <expr>' using new-style matchers.
store: Added sdb_store_parse_object_type().
This function parses an object type name (singular) and returns the type ID.
This function parses an object type name (singular) and returns the type ID.
store: Let sdb_store_parse_object_type_plural support attributes.
However, the parser will not accept attributes in LIST commands as before.
Still, an attribute is considered to be a stored object.
However, the parser will not accept attributes in LIST commands as before.
Still, an attribute is considered to be a stored object.
store: Let child matchers handle negated operators as before.
That is, negated matchers have to match *all* children because a condition
like "service != 'foo'" would match only on hosts which do not have a service
called 'foo'.
That is, negated matchers have to match *all* children because a condition
like "service != 'foo'" would match only on hosts which do not have a service
called 'foo'.
store: Let child matcher actually match the child.
store: Fixed a typo in the type check of the child matcher.
store: Removed unused old sdb_store_attr_matcher().