# NUTUPSDRV(8)

## NAME

nutupsdrv - Generic manual for unified NUT drivers

## SYNOPSIS

nutupsdrv -h

nutupsdrv [OPTIONS]

## DESCRIPTION

nutupsdrv is not actually a driver. This is a combined man page for the shared code that is the core of many drivers within the Network UPS Tools package.

For information on the specific drivers, see their individual man pages.

UPS drivers provide a communication channel between the physical UPS hardware and the upsd(8) server. The driver is responsible for translating the native protocol of the UPS to the common format used by the rest of this package.

The core has three modes of operation which are determined by the command line switches. In the normal mode, the driver will periodically poll the UPS for its state and parameters, as per the pollinterval parameter in ups.conf(5). The results of this command are presented to upsd. The driver will also handle setting variables and instant commands if available.

In the second mode, using -k, the driver can instruct the UPS to shut down the load, possibly after some delay. This mode of operation is intended for cases when it is known that the UPS is running out of battery power and the systems attached must be turned off to ensure a proper reboot when power returns.

In the third mode, using -d, the driver will exit after some update loops, dumping the data tree (in upsc(8)-like format) to `stdout`. This can be useful to complement the nut-scanner(8) to discover devices, along with in-depth data.

Note | You probably don’t want to use any of these options directly. You should use upsdrvctl(8) (or upsdrvsvcctl(8) on systems with a service management framework like systemd or SMF) to control your drivers, and ups.conf(5) to configure them. The rest of this manual describes options and parameters that generally are not needed by normal users.

## OPTIONS

-h

  Display a help message without doing anything else. This will also list possible values for -x in that driver, and other help text that the driver’s author may have provided.

-a id

  Autoconfigure this driver using the id section of ups.conf(5). This argument is mandatory when calling the driver directly.

-s id

  Configure this driver only with command line arguments instead of reading ups.conf(5). To be used instead of -a option when need to run a driver not present in driver configuration file. Instead, driver configuration have to be set with -x options directly in the command line. As such driver instance cannot be controlled by upsdrvctl(8) or upsdrvsvcctl(8), this option should be used for specific needs only.

-D

  Raise the debugging level. Use this multiple times to see more details. Running a driver in debug mode will (by default) prevent it from backgrounding after startup. It will keep on logging information to the console until it receives a SIGINT (usually Ctrl-C) or SIGTERM signal.

  The level of debugging needed depends both on the driver and the problem you’re trying to diagnose. Therefore, first explain the problem you have with a driver to a developer/maintainer, before sending them debugging output. More often than not, if you just pick a level, the output may be either too limited or too verbose to be of any use.

-d update_count

  Dump the data tree (in upsc(8)-like format) to `stdout` after running the driver update loop for the specified update_count times and exit.

  By default this prevents the driver process from backgrounding after startup. Note that the driver banner will be printed too, so when using this option in scripts, don’t forget to trim the first line, or use the `NUT_QUIET_INIT_BANNER` environment variable.

-q

  Raise log level threshold. Use this multiple times to log more details.

  The debugging comment above also applies here.

-c command

  Send command to the background process as a signal. Valid commands are:

  reload

    reread configuration files, ignoring modified settings which can not be applied "on the fly"

  reload-or-error

    reread configuration files, ignoring but counting changed values which require a driver restart (can not be changed on the fly), and return a success/fail code based on that count, so the caller can decide the fate of the currently running driver instance

  reload-or-exit

    reread configuration files, exiting the old driver process if it encounters modified settings which can not be applied "on the fly" (so caller like systemd can launch another copy of the driver)

exit

  tell the currently running driver instance to just exit (so an external caller like the new driver instance, or the systemd or SMF frameworks would start another copy)

With recent NUT v2.8.x releases, such commands can be sent using the Unix socket for driver-server interaction. As a fallback, like older releases, signals can be sent to the old driver instance’s PID (where possible).

-P pid

  Send the command signal above using specified PID number, rather than consulting the PID file. This can help define service units which start each NUT driver as a foreground process so it does not create a PID file. See also `-FF` option as an alternative.

-F

  Enforce running the driver as a foreground process, regardless of debugging or data-dumping settings. Specify twice (`-FF` or `-F -F`) to save the PID file even in this mode.

-B

  Enforce running the driver as a background process, regardless of debugging or data-dumping settings.

-i interval

  Set the poll interval for the device. The default value is 2 (in seconds).

-V

  Print only version information, then exit.

-L

  Print a parsable list of driver variables. Mostly useful for configuration wizard programs.

-k

  ("Kill" power) Forced shutdown mode. The UPS will power off the attached load, if possible.

  You should use `upsdrvctl shutdown` whenever possible instead of calling this directly. Note that the constrained operating system context for shutdown typically rules out use of `upsdrvsvcctl shutdown`.

-r directory

  The driver will chroot(2) to directory during initialization. This can be useful when securing systems.

  In addition to the state path, many systems will require `/dev/null` to exist within directory for this to work. The serial ports are opened before the `chroot` call, so you do not need to create them inside the jail. In fact, it is somewhat safer if you do not (but reconnection to devices may be no longer possible and could require a full restart of the driver).

-u username

  Override the unprivileged username that the driver may use after startup. If started as root, after opening configuration files (and optionally calling chroot(2), as described in the previous option), the driver will look up username in the `passwd` database, then change to the user and group identities associated with username. (If started with a nonzero UID or effective UID, the driver will silently ignore this option.)

  When compiling NUT from source, the default username is typically `nobody`, and this may cause permission errors when the driver opens the UPS device node. You can use this option to temporarily override the defaults. For testing purposes, you can set this option to `root` to bypass permission errors, especially with USB-based drivers. However, you will want to remove this option later in order to avoid permission conflicts between the driver and the unprivileged copy of upsd(8).

-g groupname

  Override the unprivileged group name that the driver may use after startup to set permissions for the filesystem socket so `upsd` may still access it if the run-time `user` of the driver normally would deny that access.

-x var=val

  Define a variable called var with the value of var in the driver. This varies from driver to driver — see their specific man pages for more information.

  This is like setting var=val in ups.conf(5), but -x on command line overrides any settings from that file.

  Note that for fallback values of NUT variables poorly supported by a specific device and/or its NUT driver, you can specify `default.var.name=val` to set a default value (may be replaced at run-time by a reading from the device, if one does arrive), or `override.var.name=val` to hard-code a value and ignore its readings from the device even if they are served. For example, this is often used with `override.battery.voltage.nominal` when the device reports a single cell in 2V range, and you are interested in a standard battery package in 12V range, for PbAc.

## DIAGNOSTICS

Information about the startup process is printed to `stdout` and/or `stderr`. Additional messages after that point are only available in the syslog, unless the driver remains in foreground (e.g. due to raised debugging verbosity).

After upsd(8) starts, the UPS clients such as upsc(8) can be used to query the status of an UPS.

## PROGRAM CONTROL

You should always use upsdrvctl(8) (or upsdrvsvcctl(8) on systems with a service management framework like systemd or SMF) to control the drivers. While drivers can be started by hand for testing purposes, it is not recommended for production use.

## FILES

ups.conf

  Required configuration file. This contains all details on which drivers to start and where the hardware is attached.

## ENVIRONMENT VARIABLES

NUT_DEBUG_LEVEL sets default debug verbosity if no -D arguments were provided on command line, but does not request that the daemon runs in foreground mode.

NUT_CONFPATH is the path name of the directory that contains `ups.conf` and other configuration files. If this variable is not set, drivers use a built-in default, which is often `/usr/local/ups/etc`.

NUT_STATEPATH is the path name of the directory in which upsd and drivers keep shared state information. If this variable is not set, upsd and drivers use a built-in default, which is often `/var/state/ups`. The STATEPATH directive in upsd.conf(5) overrides this variable.

NUT_ALTPIDPATH is the path name of the directory in which upsd and drivers store .pid files. If this variable is not set, upsd and drivers use either NUT_STATEPATH if set, or ALTPIDPATH if set, or otherwise the built-in default STATEPATH.

NUT_QUIET_INIT_UPSNOTIFY=true can be used to prevent daemons which can notify service management frameworks (such as systemd) about passing their lifecycle milestones from emitting such notifications (including those about lack of system support for such modern features, once per run).

NUT_QUIET_INIT_BANNER=true can be used to suppress NUT tool name and version banner. NOT recommended for services due to adverse troubleshooting impact, but may be helpful in shell profiles or scripts which process NUT tool outputs.

## BUGS

Some of the drivers may have bugs. See their manuals for more information.

## SEE ALSO

### Configuration:

- ups.conf(5)

- nut.conf(5)

### Server:

- upsd(8)

### Clients:

- upsc(8)

- upscmd(8)

- upsrw(8)

- upslog(8)

- upsmon(8)

### CGI programs:

- upsset.cgi(8)

- upsstats.cgi(8)

- upsimage.cgi(8)

### Driver control:

- upsdrvctl(8)

### Drivers:

- al175(8)

- apcsmart(8)

- apcsmart-old(8)

- bcmxcp(8)

- belkin(8)

- belkinunv(8)

- bestfortress(8)

- bestuferrups(8)

- bestups(8)

- bestfcom(8)

- bicker_ser(8)

- blazer-common(8)

- blazer_ser(8)

- clone(8)

- clone-outlet(8)

- dummy-ups(8)

- failover(8)

- etapro(8)

- everups(8)

- gamatronic(8)

- genericups(8)

- isbmex(8)

- ivtscd(8)

- liebert(8)

- liebert-gxe(8)

- liebert-esp2(8)

- masterguard(8)

- metasys(8)

- mge-shut(8)

- mge-utalk(8)

- nhs_ser(8)

- oneac(8)

- microdowell(8)

- microsol-apc(8)

- nutdrv_hashx(8)

- nutdrv_siemens_sitop(8)

- optiups(8)

- powercom(8)

- powerpanel(8)

- powervar_cx_ser(8)

- rhino(8)

- riello_ser(8)

- sms_ser(8)

- safenet(8)

- solis(8)

- tripplite(8)

- tripplitesu(8)

- upscode2(8)

- ve-direct(8)

- victronups(8)

- apcupsd-ups(8)

- nutdrv_qx(8)

### Internet resources:

The NUT (Network UPS Tools) home page: https://www.networkupstools.org/historic/v2.8.4/