osdc 2014: sebastian harl - sysdb the system management and inventory collection service
DESCRIPTION
System DataBase” (SysDB) is a multi-backend system management and inventory collection service. It may be used to (continuously) collect information about your systems from various backends (inventory services, monitoring services, etc. like Nagios, Puppet, collectd) and provides a unique interface to access the information independent of the active backends. This is done by storing and mapping the backend objects to generic objects and correlating the attributes to create a single hierarchical view of your infrastructure. This way, all important information about your systems is accessible from a central location allowing for use-cases such as central dashboards, cross-link monitoring or inventory information, identify missing pieces in your system configuration, and much more. This talk provides an overview over SysDB and its features as well as sample use-cases. The project is still in an early development stage but already usable. The talk also covers future directions and further integration with existing services.TRANSCRIPT
![Page 1: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/1.jpg)
SysDB – System DataBasea system management and inventory collection service
Sebastian ‘tokkee’ Harl<[email protected]>
SysDB developer
Open Source Data Center Conference 2014April, 10 2014
Berlin
![Page 2: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/2.jpg)
Disclaimer
WARNING:SysDB is still under heavy development.
Flaming, bashing or other forms of constructivefeeback are very appreciated :-)
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 2
![Page 3: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/3.jpg)
Background / Motivation
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 3
![Page 4: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/4.jpg)
Motivation
Why SysDB?
• Who uses Nagios/Icinga/Naemon/OpenNMS/etc.?
• Who also uses Puppet/Chef/etc.?• Who also uses collectd/Munin/etc.?• Who also uses some inventory service?• Who also maintains a CMDB?• Who likes their setup? ;-)
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 4
![Page 5: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/5.jpg)
Motivation
Why SysDB?
• Who uses Nagios/Icinga/Naemon/OpenNMS/etc.?• Who also uses Puppet/Chef/etc.?
• Who also uses collectd/Munin/etc.?• Who also uses some inventory service?• Who also maintains a CMDB?• Who likes their setup? ;-)
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 4
![Page 6: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/6.jpg)
Motivation
Why SysDB?
• Who uses Nagios/Icinga/Naemon/OpenNMS/etc.?• Who also uses Puppet/Chef/etc.?• Who also uses collectd/Munin/etc.?
• Who also uses some inventory service?• Who also maintains a CMDB?• Who likes their setup? ;-)
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 4
![Page 7: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/7.jpg)
Motivation
Why SysDB?
• Who uses Nagios/Icinga/Naemon/OpenNMS/etc.?• Who also uses Puppet/Chef/etc.?• Who also uses collectd/Munin/etc.?• Who also uses some inventory service?
• Who also maintains a CMDB?• Who likes their setup? ;-)
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 4
![Page 8: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/8.jpg)
Motivation
Why SysDB?
• Who uses Nagios/Icinga/Naemon/OpenNMS/etc.?• Who also uses Puppet/Chef/etc.?• Who also uses collectd/Munin/etc.?• Who also uses some inventory service?• Who also maintains a CMDB?
• Who likes their setup? ;-)
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 4
![Page 9: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/9.jpg)
Motivation
Why SysDB?
• Who uses Nagios/Icinga/Naemon/OpenNMS/etc.?• Who also uses Puppet/Chef/etc.?• Who also uses collectd/Munin/etc.?• Who also uses some inventory service?• Who also maintains a CMDB?• Who likes their setup? ;-)
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 4
![Page 10: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/10.jpg)
History
• Initially, I wanted a new front-end for collectd suitable for large,heterogeneous environments.
• First idea: group graphs using Puppet facts.• Second thought: oh, then we can also add monitoring
information.• Then: this should be generic and extensible.• Then I realized that I don’t like web development.• Also, a system like that would need a good back-end.• → the idea for SysDB was born
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 5
![Page 11: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/11.jpg)
History
• Initially, I wanted a new front-end for collectd suitable for large,heterogeneous environments.
• First idea: group graphs using Puppet facts.
• Second thought: oh, then we can also add monitoringinformation.
• Then: this should be generic and extensible.• Then I realized that I don’t like web development.• Also, a system like that would need a good back-end.• → the idea for SysDB was born
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 5
![Page 12: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/12.jpg)
History
• Initially, I wanted a new front-end for collectd suitable for large,heterogeneous environments.
• First idea: group graphs using Puppet facts.• Second thought: oh, then we can also add monitoring
information.
• Then: this should be generic and extensible.• Then I realized that I don’t like web development.• Also, a system like that would need a good back-end.• → the idea for SysDB was born
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 5
![Page 13: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/13.jpg)
History
• Initially, I wanted a new front-end for collectd suitable for large,heterogeneous environments.
• First idea: group graphs using Puppet facts.• Second thought: oh, then we can also add monitoring
information.• Then: this should be generic and extensible.
• Then I realized that I don’t like web development.• Also, a system like that would need a good back-end.• → the idea for SysDB was born
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 5
![Page 14: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/14.jpg)
History
• Initially, I wanted a new front-end for collectd suitable for large,heterogeneous environments.
• First idea: group graphs using Puppet facts.• Second thought: oh, then we can also add monitoring
information.• Then: this should be generic and extensible.• Then I realized that I don’t like web development.
• Also, a system like that would need a good back-end.• → the idea for SysDB was born
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 5
![Page 15: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/15.jpg)
History
• Initially, I wanted a new front-end for collectd suitable for large,heterogeneous environments.
• First idea: group graphs using Puppet facts.• Second thought: oh, then we can also add monitoring
information.• Then: this should be generic and extensible.• Then I realized that I don’t like web development.• Also, a system like that would need a good back-end.
• → the idea for SysDB was born
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 5
![Page 16: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/16.jpg)
History
• Initially, I wanted a new front-end for collectd suitable for large,heterogeneous environments.
• First idea: group graphs using Puppet facts.• Second thought: oh, then we can also add monitoring
information.• Then: this should be generic and extensible.• Then I realized that I don’t like web development.• Also, a system like that would need a good back-end.• → the idea for SysDB was born
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 5
![Page 17: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/17.jpg)
The System DataBase
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 6
![Page 18: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/18.jpg)
SysDB – Overview
• SysDB collects information about arbitrary hardware and softwaresystems.
• The central idea is to get a central view of your infrastructure.• Simple examples:
Hosts and their attributes (“facts”)Services and their attributesMonitoring information (e.g. current state)
• SysDB collects these information and correlates objects fromvarious backends.
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 7
![Page 19: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/19.jpg)
SysDB – core features
• https://github.com/tokkee/sysdbCI: https://travis-ci.org/tokkee/sysdb> 60% code (function) unit-test coverage in the core
• BSD license• Written in C• Easy to extend (simple plugin API)• Simple network protocol• Most of the code implemented as a library (reusable)
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 8
![Page 20: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/20.jpg)
SysDB – Plugins
Currently available:
• collectd::unixsock – query collectd’s UNIX socket interface• mk-livestatus – query Monitoring systems (Nagios, Naemon,
Icing, Shinken) using Check MK Livestatus• puppet::store-configs – query Puppet
• cname::dns – canonicalize host-names using DNS• syslog – syslog logging
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
![Page 21: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/21.jpg)
SysDB – Architecture
infra
backends
store FE
sysdbd
network
sysdb
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 10
![Page 22: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/22.jpg)
The SysDB Store
• The actual database implementation (in memory)• Stores generic objects:
Host – any kind of physical resourceService – any kind of serviceAttribute – attributes of hosts and services
• Canonicalization of hosts• Each object stores the timestamp of the last update and the
(automatically calculated) update interval
• Interface to query data• JSON is the external data representation
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 11
![Page 23: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/23.jpg)
The SysDB Store – Examples
kvm0
kvm1
kvm2
ovirt0
vhost0
vhost0
vhost0
vhost0
vhost0
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 12
![Page 24: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/24.jpg)
Internal Data Structures
message Host {required string name;required DateTime last_update;required Interval update_interval;
repeated Attribute attributes;repeated Object children; // Host or Serviceoptional Object parent;
}
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 13
![Page 25: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/25.jpg)
Internal Data Structures
message Service {required string name;required DateTime last_update;required Interval update_interval;
repeated Attribute attributes;repeated Object children; // Host or Servicerepeated Object parent; // multiple!
}
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 14
![Page 26: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/26.jpg)
Internal Data Structures
message Attribute {required string name;required Type value;required DateTime last_update;required Interval update_interval;
optional Object parent;}
Type is either an integer, floating point number, DateTime or binarydata.
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 15
![Page 27: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/27.jpg)
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 16
![Page 28: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/28.jpg)
The SysDB Query Language
• Remotely similar to SQL• Meant to be easily usable in RPCs• Still under heavy development ;-)• Currently supported commands:
LIST – returns all hostsFETCH <hostname> – returns details for a hostLOOKUP hosts WHERE <expression> – query details formultiple hosts based on their attributes
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 17
![Page 29: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/29.jpg)
The SysDB Query Language – Example(I)
sysdb=> LIST;{"hosts":[{
"name": "nagios.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"
},{"name": "whisky.mobile.tokkee.net","last_update": "2014-04-05 11:09:15 +0200","update_interval": "10s"
}]}c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 18
![Page 30: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/30.jpg)
The SysDB Query Language – Example(II)
sysdb=> LOOKUP hosts WHERE attribute.architecture = ’amd64’AND service.name =˜ ’postgres’;
{ "name": "whisky.mobile.tokkee.net","last_update": "2014-04-05 11:09:15 +0200","update_interval": "10s","attributes": [{
"name": "architecture", "value": "amd64","last_update": "2014-04-03 10:26:41 +0200","update_interval": "5m3s" },{ ... }],
"services": [{"name": "cpu-0/cpu-idle","last_update": "2014-03-31 23:34:06 +0200","update_interval": "9.716754301s" },{ ... }]
}c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 19
![Page 31: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/31.jpg)
Use Cases
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 20
![Page 32: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/32.jpg)
Use Cases
• Extend (replace?) your CMDB→ put the CMDB behind and query it through SysDB
• Compare the back-ends (monitoring)→ Which hosts / services are missing in a back-end?→ What is the global status of all Windows systems in some
data-center?• More flexible web-frontend combining multiple back-ends
→ central dashboard
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 21
![Page 33: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/33.jpg)
Future Directions
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 22
![Page 34: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/34.jpg)
Future Directions
• More documentation!• RDBMS store back-end (?)• Interface to query live data (monitoring status, metrics) from
backends• Distributed architecture (HA and load-balancing)• Web-Interface• Extend the type system and filters• Add support for related informationen (?):
persons / groups (ACLs, . . . )Events / calendar (Change-Requests, . . . )
• . . .
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 23
![Page 35: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/35.jpg)
SysDB – System DataBase
Thank you for your attention!
Questions, comments, rants?
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 24
![Page 36: OSDC 2014: Sebastian Harl - SysDB the system management and inventory collection service](https://reader033.vdocuments.us/reader033/viewer/2022060115/557cf481d8b42a98158b479b/html5/thumbnails/36.jpg)
SysDB – System DataBase
Contakt:Sebastian “tokkee” Harl
https://github.com/tokkee/sysdb
Please send patches! :-)
c©2014 Sebastian ‘tokkee’ Harl The System DataBase – slide 25