Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lpil/systemd_status
https://github.com/lpil/systemd_status
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lpil/systemd_status
- Owner: lpil
- Created: 2024-02-28T16:25:04.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-02-29T10:01:32.000Z (10 months ago)
- Last Synced: 2024-10-13T22:54:56.794Z (about 2 months ago)
- Language: Gleam
- Size: 9.77 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-gleam - systemd_status - [📚](https://hexdocs.pm/systemd_status/) - Inspect the status of running systemd units (Packages / Logging and Monitoring)
README
# systemd_status
Inspect the status of running systemd units.
[![Package Version](https://img.shields.io/hexpm/v/systemd_status)](https://hex.pm/packages/systemd_status)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/systemd_status/)```sh
gleam add systemd_status
```
```gleam
import systemd_status// In this example we're also using the shellout package
import shelloutpub fn main() {
let #(command, arguments) = systemd_status.unit_property_list_command("my-service")
let assert Ok(output) = shellout.command(command, arguments, in: ".", opt: [])
let assert Ok(service) = systemd_status.parse_service(output)
service
// Service(
// id: "my-service.service",
// type_: SimpleService,
// load_state: Loaded,
// active_state: Active,
// sub_state: "running",
// result: "success",
// main_pid: Some(3_764_255),
// description: Some("Super cool important service"),
// state_change_timestamp: Some("Tue 2024-02-27 22:50:37 UTC"),
// active_enter_timestamp: Some("Tue 2024-02-27 22:50:37 UTC"),
// active_exit_timestamp: Some("Tue 2024-02-27 22:50:37 UTC"),
// inactive_enter_timestamp: Some("Tue 2024-02-27 22:50:37 UTC"),
// inactive_exit_timestamp: Some("Tue 2024-02-27 22:50:37 UTC"),
// )
}
```Further documentation can be found at .