https://github.com/lpil/systemd_status
  
  
     
    https://github.com/lpil/systemd_status
  
        Last synced: 8 months ago 
        JSON representation
    
- Host: GitHub
 - URL: https://github.com/lpil/systemd_status
 - Owner: lpil
 - Created: 2024-02-28T16:25:04.000Z (over 1 year ago)
 - Default Branch: main
 - Last Pushed: 2024-02-29T10:01:32.000Z (over 1 year ago)
 - Last Synced: 2025-01-22T05:41:55.067Z (10 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.
[](https://hex.pm/packages/systemd_status)
[](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 shellout
pub 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 .