Skip to content

upsdrvctl would benefit from CLI options to list known devices, and their current health #2567

@jimklimov

Description

@jimklimov

Note that the related upsdrvsvcctl script (for systemd/SMF unit management) already has such options as:

usage: ./scripts/upsdrvsvcctl/upsdrvsvcctl [OPTIONS] list [<ups>]
  list                  call /usr/local/ups/libexec/nut-driver-enumerator.sh
                        to list the mapping of service instances to device sections
  list <ups>            (optionally return the service instance name for one device)

usage: ./scripts/upsdrvsvcctl/upsdrvsvcctl [OPTIONS] show-config [<ups>]
  show-config <ups>     output config section from ups.conf for device <ups>
  show-config           ...or all devices if no <ups> argument was passed

which can also be used to probe a device name (is one defined?) without changing the system state.

NOTE: It can be helpful to also add an option (to both) to check if the driver is running, perhaps test that it is alive (e.g. request a data dump via socket protocol, see #1918 #1922 and others).

A loosely related precedent can be seen in scripts/installer/common/ipp-status.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpackagingservice/daemon start/stopGeneral subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions