1
0
HTTP service that returns a list of process' names with boolean values that respectively telling us if process is running or not. For UNIX-like OS only.
Go to file
2022-10-10 00:03:40 +04:00
contrib [httpprocwatchd.service] Shorten Description. Fixed extension of config file. 2022-01-03 01:04:49 +04:00
.gitignore Added executable to .gitignore. 2022-10-10 00:03:40 +04:00
configuration.go [configuration.go] append a list instead, in case there are multiple processes options. 2022-01-06 03:13:52 +04:00
errors.go Code was restructurised again. Moved out back to root dir. 2022-01-02 21:30:56 +04:00
go.mod Initial commit. 2021-03-13 03:17:30 +04:00
LICENSE License is switched to MIT+NIGGER. :) 2022-01-02 05:13:20 +04:00
main.go [main.go] listWatchedProcesses -> print... . Moving it and version to bottom. 2022-01-06 03:24:57 +04:00
Makefile [Makefile] Update. 2022-01-02 23:05:39 +04:00
processlist.go [processlist.go] Removed NewProcessList and AddProcess funcs. 2022-01-06 03:15:28 +04:00
README.md [README.md] Added Instalation section. 2022-01-03 02:22:41 +04:00
server.go [server.go] Use switch statement by Accept header. 2022-01-06 03:17:26 +04:00
util.go [util.go] Optimisation by comparing high part of byte to 3 (numbers in ASCII are going from 0x30 to 0x39). And convert the whole number only if it is PID we are looking for. 2022-01-06 03:22:38 +04:00

httpprocwatchd Ver 1.3.2

License: MIT+NIGGER.

This utility provides a HTTP /processes GET endpoint that returns a list of processes, and if they are currently running or not.

There are currently three output formats available: JSON, XML, plain text.

JSON is a default format if Accept header didn't provided, or did do with value application/json. Its form is {"process":true|false, ...}.

XML is provided if Accept: application/xml header was given. Its form is <ProcessList><Process name="process">true|false</Process>...</ProcessList>.

Plain text is provided if Accept: text/plain header was given. Its form is a comma separated list of ONLY running process' names.

Configuration file is a simple key = value storage consisting of listen_address string field in form "[<ip|host>]:<port>". indented_output bool in form true|false, to enable indentation of JSON and XML output. And processes is a space separated array of process names.

Installation

Manually

Run these commands one after the other.

$ make
$ make install
$ make install-service

In order to uninstall run these commands:

# systemctl stop httpprocwatchd
# systemctl disable httpprocwatchd
$ make uninstall-service
$ make uninstall
# systemctl daemon-reload

For ArchLinux

You can take a PKGBUILD file and in a directory with it run makepkg -i.