Forge Home

apcupsd

Configure apcupsd software for APC UPS devices

18,027 downloads

5,394 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 2.0.0 (latest)
  • 1.1.1
  • 1.1.0
  • 1.0.1
  • 0.2.1
  • 0.2.0
  • 0.1.2
  • 0.1.1
  • 0.1.0
released Feb 19th 2020
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x
  • Puppet >= 5.5.10 < 7.0.0
  • , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'jgazeley-apcupsd', '2.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add jgazeley-apcupsd
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install jgazeley-apcupsd --version 2.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

jgazeley/apcupsd — version 2.0.0 Feb 19th 2020

apcupsd

Table of Contents

  1. Overview
  2. Usage - Configuration options and additional functionality
  3. Limitations - OS compatibility, etc.
  4. Development - Guide for contributing to the module

Overview

This module installs and configures the apcupsd UPS monitor for APC UPS units.

Usage

This module has only one class, and takes the following parameters:

upsname

Give your UPS a name in log files and such. It should be 8 characters or less.

upscable

Defines the type of cable connecting the UPS to your computer. Choose from: simple, smart, ether, usb. Default: usb.

upstype

Define the type of UPS you have. Choose from apcsmart, usb, net, snmp, dumb, pcnet. Default: usb.

device

For USB UPSes, leave $device blank. For other UPS types, you must specify an appropriate port or address. Consult the table for example values for $device. Default: ''.

$upstype $device
apcsmart /dev/ttyS0
usb <BLANK>
net hostname:port
snmp hostname:port:vendor:community
dumb /dev/ttyS0
pcnet ipaddr:username:passphrase:port

onbatterydelay

Time in seconds from when a power failure is detected until we react to it with an onbattery event. Default: 6.

batterylevel

If during a power failure, the remaining battery percentage (as reported by the UPS) is below or equal to $batterylevel, apcupsd will initiate a system shutdown. Default: 5.

minutes

If during a power failure, the remaining runtime in minutes (as calculated internally by the UPS) is below or equal to $minutes, apcupsd will initiate a system shutdown. Default: 3.

netserver

Enables the network information server (NIS). If netstatus is on, a network information server process will be started for serving the STATUS and EVENT data over the network (used by CGI programs). Choose from: on, off. Default: on.

nisip

IP address on which NIS server will listen for incoming connections. Default: 0.0.0.0.

nisport

Port on which NIS server will listen for incoming connectionss. Default: 3551.

Limitations

This module was written for use with CentOS, although it should work on other distributions too.

Currently this module only supports configuring a single UPS attached to the local system. Future versions may support multiple UPSes on a single system or network communication between systems sharing the same UPS, to co-ordinate shutdown.

Development

If you can contribute to improve this module, please send a pull request.

Release Notes

2.0.0

Refactor to use data in the module pattern

1.1.1

Bugfix for data typing in 1.1.0

1.1.0

Added support to enable/disable service. Thanks @upaternostro

0.1.0

Initial release, with support for a single UPS on a single system.

0.2.0

Added support for setting mail destination address for events scripts.

0.2.1

Add defaults file for Debian, as service fails to run without ISCONFIGURED=yes in this file (thanks @legooolas)

1.0.0

  • Add parameters to configure nis server (thanks @XnS)
  • Add modern puppet support (thanks @vchepkov)

1.0.1

  • Fix metadata so it builds