Synapse

Universal API for remote system administration

Fork me on GitHub

What is the Synapse Agent ?

Synapse enables you to remotely manage a large number of hosts. It brings together features of Configuration Management and Orchestration in a lightweight framework. Written in Python and using AMQP for messaging between the nodes.

Key features

  • Descriptive approach: In Synapse, you don't execute commands (i.e. RPC model) on the target host. Instead you describe a resource (files,package,service,..) and ask synapse to put it in a defined state. This means that the synapse agent knows the resources your are interested in, it can monitor them and alert you when their state changes (e.g. a file is changed, a service is stopped,..).
  • OS abstraction: The resource definition is OS independent. If you want a service to be started you just update the resource definition for that service (e.g. {"running": true}). Synapse will do what it needs to start the service, whatever the underlying OS. This means that your scripts and orchestration logic use always the same API, you don't have to particularize the logic per platform.
  • Fine grained permissions: Fine grained permissions can be set to control user access to resources. You can thus easily say that user x can restart service y or user a can read the content of file b, etc.

Example use cases

Retrieve information about all your hosts

synapse-client hosts status --all
INFO Discovered 3 hosts...
[3836A360BC6111E1B936E9D57F000001]
uptime        1 hour, 30 minutes, 59 seconds
memtotal      604356
ip            {'lo': '127.0.0.1', 'eth0': '10.56.73.148'}
hostname      ip-10-56-73-148.eu-west-1.compute.internal
mac_addresses {'lo': '00:00:00:00:00:00', 'eth0': '12:31:42:00:46:6a'}
platform      ['ubuntu', '12_04']

[37AAB710BC6111E1B936E9D57F000001]
uptime        2 hours, 33 minutes, 11 seconds
memtotal      604356
ip            {'lo': '127.0.0.1', 'eth0': '10.64.7.207'}
hostname      ip-10-64-7-207.eu-west-1.compute.internal
mac_addresses {'lo': '00:00:00:00:00:00', 'eth0': '12:31:43:07:08:21'}
platform      ['ubuntu', '12_04']

[3ED0D210D57811E1AFF139357F000001]
uptime        19 hours, 51 minutes, 52 seconds
memtotal      502612
ip            {'lo': '127.0.0.1', 'eth0': '192.168.5.89'}
hostname      ip89.angleur.guardis.be
mac_addresses {'lo': '00:00:00:00:00:00', 'eth0': '00:50:56:2c:40:0e'}
platform      ['centos', '6_3']

Install a package on all your hosts

synapse-client packages install htop

You don't have to know about yum, apt or whatever package manager your hosts use thanks to synapse-agent's abstraction layer.

INFO Discovered 3 hosts...
[3836A360BC6111E1B936E9D57F000001]
installed True

[37AAB710BC6111E1B936E9D57F000001]
installed True

[3ED0D210D57811E1AFF139357F000001]
installed True

Get the status of all your apache2 services filtered by hostname

synapse-client services status apache2 --filter_hostnames=*.be

Note that you don't have to know how to manage services on specific machines. The synapse-agent takes care of it.

INFO Discovered 2 hosts...
[3836A360BC6111E1B936E9D57F000001]
running True
enabled False

[37AAB710BC6111E1B936E9D57F000001]
running True
enabled True

Enable them at bootup

synapse-client services enable apache2 --filter_hostnames=*.be
INFO Discovered 2 hosts...
[3836A360BC6111E1B936E9D57F000001]
running True
enabled True

[37AAB710BC6111E1B936E9D57F000001]
running True
enabled True

Modify the resolv.conf on all your hosts at once

synapse-client files edit /etc/resolv.conf

This command retrieves this file content from your hosts. You edit it locally, and synapse-client pushes it back to all your hosts with the new content.

Convinced ? Try it out, it is free and open source




Funded by Wallonia in association with CECOTEPE, HEPL and Guardis.

Logo Wallonie Logo CECOTEPE Logo HEPL Logo Guardis