SysDB is a system management and inventory collection service that collects information about hardware and software systems from multiple sources and aggregates it into a single database. It focuses on metadata and links to more specific data. SysDB collects data like host attributes, services, metrics, and monitoring information. It provides a query language to search and filter the aggregated data. The goal is to provide a flexible platform for system overview, comparison of data sources, and enhancing configuration management databases.
SysDB — The system management and inventory collection service
1. SysDB – System DataBase
A system management and inventory collection service
Sebastian ‘tokkee’ Harl
<tokkee@sysdb.io>
Icinga Camp San Francisco 2014
September 25, 2014
2. Disclaimer
WARNING:
SysDB is still under heavy development
and not considered stable yet1.
Flaming, bashing or other forms of constructive
feeback are very appreciated ... also, contributions :-)
1 That is, interfaces may still change quickly.
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 2
4. Motivation
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 4
5. Motivation
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 4
6. Motivation
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 4
7. Motivation
Database Server Foo
External Gateway
Zooperserver
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 4
8. Motivation
Database Server Foo
External Gateway
Zooperserver
gw1.domain.tld
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 4
9. Motivation
Database Server Foo
External Gateway
Zooperserver
gw1.domain.tld gw1.domain.tld
arch=amd64
lsbdistid=Debian
loc=BayArea
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 4
10. Motivation
Database Server Foo
External Gateway
Zooperserver
gw1.domain.tld gw1.domain.tld
arch=amd64
lsbdistid=Debian
loc=BayArea
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 4
11. The System DataBase
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 5
12. SysDB – System information platform
Mod1 Mod2
SysDB
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 6
13. SysDB – Overview
SysDB collects information about arbitrary hardware and software
systems for a global overview of the entire infrastructure.
Focus on meta-data and links to more specific information.
Simple examples:
Hosts and their attributes (“facts”)
Services and their attributes
Metrics (pointer to performance data)
Monitoring information (e.g. current state)
SysDB collects these information and merges objects from
multiple back-ends by hostname.
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 7
14. SysDB – Core features
https://sysdb.io/, https://github.com/sysdb
CI: https://travis-ci.org/sysdb/sysdb
80% code (function) unit-test coverage in the core
BSD license
Written in C (UI written in Go WIP)
Generic store aggregating system information
Multi-threaded, event-based client/server architecture
Easy to extend (simple plugin API)
Simple network protocol and query language
Most of the code implemented as a library (reusable)
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 8
15. SysDB – Plugins
Currently available collectors (back-ends):
collectd::unixsock – query collectd’s UNIX socket interface
! host metrics
mk-livestatus – query Monitoring systems (Nagios, Naemon,
Icinga, Shinken) using Check MK Livestatus
! hosts and services (metrics planned)
puppet::store-configs – query Puppet
! host attributes
Planned: Passive data collection (e.g. using Gearman), Foreman,
PuppetDB, $your favorite system (send patches!) :-)
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 9
16. SysDB – Plugins (2)
Time-series fetchers:
timeseries::rrdtool – fetch time-series from local RRD files
Misc plugins:
cname::dns – canonicalize host-names using DNS
syslog – syslog logging
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 10
17. SysDB – Architecture
RRD
infra
back-ends
sysdbd
store FE
sysdb
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 11
18. The SysDB Store
Stores generic objects (in memory atm)
Canonicalization of hosts (by their name as provided by
back-ends)
Each object stores the time-stamp of the last update and the
(automatically calculated) update interval
Interface to query data
Generic access to time-series data
JSON is the external data representation
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 12
19. The SysDB Store – Stored objects
Host – any kind of physical resource
Service – any kind of service
Metric – identifier for metrics data
! time-series data is not stored in SysDB
Attribute – attributes of hosts and services
! values support multiple types
Common core attributes:
unique name
time-stamp of last update
update interval
list of back-ends providing the object
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 13
20. The SysDB Store – Example
kvm0
kvm1
kvm2
ovirt0 vhost0
vhost1
vhost2
(Full graph-support not implemented yet.)
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 14
21. The SysDB Client
Interactive client program for SysDB
Connects to a SysDB daemon
Interactive command shell
Receives and displays asynchronous log messages
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 15
22. The SysDB Query Language
Remotely similar to SQL
But it’s not SQL1
List and query hosts
Fetch time-series information (from some back-end data-store)
1 Yes, a DSL might limit options but it was the easiest for now – believe it or not ;-)
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 16
23. The SysDB Query Language (2)
LIST hosts
FETCH host hostname
LOOKUP hosts MATCHING condition
... FILTER condition
TIMESERIES host.metric
START 2014-01-01 END 2014-12-31
! https://sysdb.io/manpages/head/sysdbql.7.html
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 17
24. The SysDB Query Language – Example
sysdb= LIST hosts FILTER :age 2 * :interval;
[{
name: monitor.lxc.tokkee.net,
last_update: 2014-04-03 10:26:41 +0200,
update_interval: 5m4s,
},{
name: puppet.lxc.tokkee.net,
last_update: 2014-04-05 11:04:08 +0200,
update_interval: 5m2s
}]
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 18
25. The SysDB Query Language – Example (2)
sysdb= LOOKUP hosts WHERE attribute.architecture = ’amd64’
AND service.name =˜ ’postgres’;
{ name: db.lxc.tokkee.net,
last_update: ..., update_interval: 10s,
attributes: [{
name: architecture, value: amd64,
last_update: ..., update_interval: 5m3s
},{ ... }],
services: [{
name: PostgreSQL Master,
last_update: ..., update_interval: 5m
},{ ... }],
metrics: [{...}]
}
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 19
26. The SysDB Query Language – Conditionals
Search and filter conditions:
MATCHING attribute.architecture = ’amd64’
AND service.name = ’postgres’
MATCHING host = ’.tokkee.net$’
FILTER :age = 3 * :interval
FILTER :backend != ’mk-livestatus’
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 20
27. Use Cases
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 21
28. Use Cases
More flexible web front-ends combining multiple back-ends
! correlate and annotate information
! central dashboard
! link to specialized front-ends
Compare the back-ends (monitoring)
! Which hosts / services are missing in a back-end?
! Base for business-processes: What is the global status of all
Windows systems in some data-center?
Extend your CMDB with dynamic annotations or cross-checks
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 22
29. Future Directions
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 23
30. Future Directions
Better and more integration with other systems
Persistent store: RDBMS, graph database (?)
Interface to query other live data (e.g., monitoring status) from
back-ends
Distributed architecture (HA and load-balancing)
Extensible Web-Interface
Extend the type system and filters
. . .
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 24
31. SysDB – System DataBase
Thank you for your attention!
Questions, comments, rants?
https://sysdb.io/, https://github.com/sysdb
https://sysdb.io/+ https://sysdb.io/facebook
@SystemDatabase
c 2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 25