All Projects → ogarcia → sysdweb

ogarcia / sysdweb

Licence: GPL-3.0 license
Control systemd services through Web or REST API

Programming Languages

python
139335 projects - #7 most used programming language
Smarty
1635 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to sysdweb

logback-journal
systemd journal appender for Logback
Stars: ✭ 25 (-61.54%)
Mutual labels:  journal, systemd
kernel-syslog
📝 Kernel module that can be used as a replacement for syslog, logger or logwrapper
Stars: ✭ 37 (-43.08%)
Mutual labels:  journal, systemd
Fluent Plugin Systemd
This is a fluentd input plugin. It reads logs from the systemd journal.
Stars: ✭ 124 (+90.77%)
Mutual labels:  journal, systemd
UIPheonix
Inspired by game development UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS. The same API apply for cross platform development! Think of it as using Lego blocks, you can use similar ones and move them around easy as pie.
Stars: ✭ 29 (-55.38%)
Mutual labels:  control
Chimera
System Remote Control Discord Bot written in Python discord.py
Stars: ✭ 77 (+18.46%)
Mutual labels:  control
preact-journal
14k offline-capable journaling PWA using preact, node, MySQL, and IndexedDB.
Stars: ✭ 33 (-49.23%)
Mutual labels:  journal
cya
Easy to use snapshot and restore utility for any Linux (Unix) OS and filesystem powered by BASH
Stars: ✭ 73 (+12.31%)
Mutual labels:  systemd
lua-systemd
Systemd bindings for Lua
Stars: ✭ 33 (-49.23%)
Mutual labels:  systemd
deploy
No description or website provided.
Stars: ✭ 23 (-64.62%)
Mutual labels:  systemd
InitKit
Neo-InitWare is a modular, cross-platform reimplementation of the systemd init system. It is experimental.
Stars: ✭ 364 (+460%)
Mutual labels:  systemd
parca-agent
eBPF based always-on profiler auto-discovering targets in Kubernetes and systemd, zero code changes or restarts needed!
Stars: ✭ 250 (+284.62%)
Mutual labels:  systemd
system-76-keyboards
Rainbow / CPU monitor for system76 colored keyboards
Stars: ✭ 37 (-43.08%)
Mutual labels:  systemd
guardian
Guardian is a tool for extensible and universal data access with automated access workflows and security controls across data stores, analytical systems, and cloud products.
Stars: ✭ 127 (+95.38%)
Mutual labels:  control
FlipperControlUWP
A control that uses flip transition to change different states for UWP apps.
Stars: ✭ 30 (-53.85%)
Mutual labels:  control
chronicle
Forming reliable memories.
Stars: ✭ 87 (+33.85%)
Mutual labels:  journal
typeioc
Dependency injection container for typescript / javascript
Stars: ✭ 32 (-50.77%)
Mutual labels:  control
linux-control
Control your Linux laptop/desktop via Google Assistant
Stars: ✭ 46 (-29.23%)
Mutual labels:  control
wsl-systemd
A script that spawns a namespace with systemd as PID1, and allows you to spawn interactive sessions or exec commands inside it
Stars: ✭ 37 (-43.08%)
Mutual labels:  systemd
dppm
An easy way to install and manage server applications
Stars: ✭ 107 (+64.62%)
Mutual labels:  systemd
logreader
📜 Log reader for Nextcloud
Stars: ✭ 46 (-29.23%)
Mutual labels:  admin-tool

sysdweb

Control systemd services through Web or REST API

Installation

Prerequisites

If you are a Ubuntu/Debian user you need to install libsystemd-dev, for CentOS users the package is systemd-devel.

From source

git clone https://github.com/ogarcia/sysdweb.git
virtualenv3 ./sysdweb-venv
source ./sysdweb-venv/bin/activate
cd sysdweb
pip install -r requirements.txt
python setup.py install

From pypi

virtualenv3 ./sysdweb-venv
source ./sysdweb-venv/bin/activate
pip install sysdweb

For Arch Linux users

Arch Linux users can install sysdweb from AUR.

Run

First take a look to sysdweb.conf file to configure sysdweb. Is self explanatory.

You can place sysdweb.conf in /etc for system, in user home ~/.config/sysdweb/sysdweb.conf or in same directory where you run sysdweb.

Once you have configured sysdweb, simply run.

sysdweb

By default sysdweb listen in 10080 port to 127.0.0.1, you can change listen port and address with -p and -l or via environment variables.

sysdweb -p 9080 -l 0.0.0.0

Current config environment variables are the following.

Variable Description
SYSDWEB_CONFIG Config file location
SYSDWEB_HOST Listen address
SYSDWEB_PORT Listen port
SYSDWEB_LOGLEVEL Log level, effective values are WARNING, INFO and DEBUG

API

You can control configured services via REST API, for example, with curl.

The API endpoint is /api/v1/<service>/<action>, always GET and response a json with following format.

{
  "<action>": "<result>"
}

The <service> tag is defined in config file and match with section label. For example, in following config, the service would be ngx.

[ngx]
title = Nginx
unit = nginx.service

The posible <actions> are.

  • start
  • stop
  • restart
  • reload
  • reloadorrestart
  • status
  • journal

All actions (except status and journal) return as result OK if can communicate with DBUS or Fail if any error occurs.

For status action, the posible responses are.

  • active (started unit)
  • reloading
  • inactive (stopped unit)
  • failed (stopped unit)
  • activating
  • deactivating
  • not-found (for inexistent unit)

By default /api/v1/<service>/journal returns 100 tail lines of journal file of <service> unit. You can specify the number of lines by this way.

/api/v1/<service>/journal/200

In the example defined above all valid enpoins are.

http://127.0.0.1:10080/api/v1/ngx/start
http://127.0.0.1:10080/api/v1/ngx/stop
http://127.0.0.1:10080/api/v1/ngx/restart
http://127.0.0.1:10080/api/v1/ngx/reload
http://127.0.0.1:10080/api/v1/ngx/reloadorrestart
http://127.0.0.1:10080/api/v1/ngx/status
http://127.0.0.1:10080/api/v1/ngx/journal
http://127.0.0.1:10080/api/v1/ngx/journal/<number>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].