apcupsd.conf.j2 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. ## apcupsd.conf v1.1 ##
  2. # {{ ansible_managed }}
  3. #
  4. # for apcupsd release 3.14.14 (31 May 2016) - redhat
  5. #
  6. # "apcupsd" POSIX config file
  7. #
  8. # Note that the apcupsd daemon must be restarted in order for changes to
  9. # this configuration file to become active.
  10. #
  11. #
  12. # ========= General configuration parameters ============
  13. #
  14. # UPSNAME xxx
  15. # Use this to give your UPS a name in log files and such. This
  16. # is particulary useful if you have multiple UPSes. This does not
  17. # set the EEPROM. It should be 8 characters or less.
  18. #UPSNAME
  19. # UPSCABLE <cable>
  20. # Defines the type of cable connecting the UPS to your computer.
  21. #
  22. # Possible generic choices for <cable> are:
  23. # simple, smart, ether, usb
  24. #
  25. # Or a specific cable model number may be used:
  26. # 940-0119A, 940-0127A, 940-0128A, 940-0020B,
  27. # 940-0020C, 940-0023A, 940-0024B, 940-0024C,
  28. # 940-1524C, 940-0024G, 940-0095A, 940-0095B,
  29. # 940-0095C, 940-0625A, M-04-02-2000
  30. #
  31. UPSCABLE usb
  32. # To get apcupsd to work, in addition to defining the cable
  33. # above, you must also define a UPSTYPE, which corresponds to
  34. # the type of UPS you have (see the Description for more details).
  35. # You must also specify a DEVICE, sometimes referred to as a port.
  36. # For USB UPSes, please leave the DEVICE directive blank. For
  37. # other UPS types, you must specify an appropriate port or address.
  38. #
  39. # UPSTYPE DEVICE Description
  40. # apcsmart /dev/tty** Newer serial character device, appropriate for
  41. # SmartUPS models using a serial cable (not USB).
  42. #
  43. # usb <BLANK> Most new UPSes are USB. A blank DEVICE
  44. # setting enables autodetection, which is
  45. # the best choice for most installations.
  46. #
  47. # net hostname:port Network link to a master apcupsd through apcupsd's
  48. # Network Information Server. This is used if the
  49. # UPS powering your computer is connected to a
  50. # different computer for monitoring.
  51. #
  52. # snmp hostname:port:vendor:community
  53. # SNMP network link to an SNMP-enabled UPS device.
  54. # Hostname is the ip address or hostname of the UPS
  55. # on the network. Vendor can be can be "APC" or
  56. # "APC_NOTRAP". "APC_NOTRAP" will disable SNMP trap
  57. # catching; you usually want "APC". Port is usually
  58. # 161. Community is usually "private".
  59. #
  60. # netsnmp hostname:port:vendor:community
  61. # OBSOLETE
  62. # Same as SNMP above but requires use of the
  63. # net-snmp library. Unless you have a specific need
  64. # for this old driver, you should use 'snmp' instead.
  65. #
  66. # dumb /dev/tty** Old serial character device for use with
  67. # simple-signaling UPSes.
  68. #
  69. # pcnet ipaddr:username:passphrase:port
  70. # PowerChute Network Shutdown protocol which can be
  71. # used as an alternative to SNMP with the AP9617
  72. # family of smart slot cards. ipaddr is the IP
  73. # address of the UPS management card. username and
  74. # passphrase are the credentials for which the card
  75. # has been configured. port is the port number on
  76. # which to listen for messages from the UPS, normally
  77. # 3052. If this parameter is empty or missing, the
  78. # default of 3052 will be used.
  79. #
  80. # modbus /dev/tty** Serial device for use with newest SmartUPS models
  81. # supporting the MODBUS protocol.
  82. # modbus <BLANK> Leave the DEVICE setting blank for MODBUS over USB
  83. # or set to the serial number of the UPS to ensure
  84. # that apcupsd binds to that particular unit
  85. # (helpful if you have more than one USB UPS).
  86. #
  87. {% if ups_primary == '' %}
  88. UPSTYPE usb
  89. DEVICE
  90. {% else %}
  91. UPSTYPE net
  92. DEVICE {{ ups_primary }}:3551
  93. {% endif %}
  94. # POLLTIME <int>
  95. # Interval (in seconds) at which apcupsd polls the UPS for status. This
  96. # setting applies both to directly-attached UPSes (UPSTYPE apcsmart, usb,
  97. # dumb) and networked UPSes (UPSTYPE net, snmp). Lowering this setting
  98. # will improve apcupsd's responsiveness to certain events at the cost of
  99. # higher CPU utilization. The default of 60 is appropriate for most
  100. # situations.
  101. POLLTIME {{ ups_polltime_seconds }}
  102. # LOCKFILE <path to lockfile>
  103. # Path for device lock file. This is the directory into which the lock file
  104. # will be written. The directory must already exist; apcupsd will not create
  105. # it. The actual name of the lock file is computed from DEVICE.
  106. # Not used on Win32.
  107. LOCKFILE /var/lock
  108. # SCRIPTDIR <path to script directory>
  109. # Directory in which apccontrol and event scripts are located.
  110. SCRIPTDIR /etc/apcupsd
  111. # PWRFAILDIR <path to powerfail directory>
  112. # Directory in which to write the powerfail flag file. This file
  113. # is created when apcupsd initiates a system shutdown and is
  114. # checked in the OS halt scripts to determine if a killpower
  115. # (turning off UPS output power) is required.
  116. PWRFAILDIR /etc/apcupsd
  117. # NOLOGINDIR <path to nologin directory>
  118. # Directory in which to write the nologin file. The existence
  119. # of this flag file tells the OS to disallow new logins.
  120. NOLOGINDIR /etc
  121. #
  122. # ======== Configuration parameters used during power failures ==========
  123. #
  124. # The ONBATTERYDELAY is the time in seconds from when a power failure
  125. # is detected until we react to it with an onbattery event.
  126. #
  127. # This means that, apccontrol will be called with the powerout argument
  128. # immediately when a power failure is detected. However, the
  129. # onbattery argument is passed to apccontrol only after the
  130. # ONBATTERYDELAY time. If you don't want to be annoyed by short
  131. # powerfailures, make sure that apccontrol powerout does nothing
  132. # i.e. comment out the wall.
  133. ONBATTERYDELAY {{ ups_on_battery_delay_seconds }}
  134. #
  135. # Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so
  136. # the first that occurs will cause the initation of a shutdown.
  137. #
  138. # If during a power failure, the remaining battery percentage
  139. # (as reported by the UPS) is below or equal to BATTERYLEVEL,
  140. # apcupsd will initiate a system shutdown.
  141. BATTERYLEVEL {{ ups_shutdown_on_battery_percent }}
  142. # If during a power failure, the remaining runtime in minutes
  143. # (as calculated internally by the UPS) is below or equal to MINUTES,
  144. # apcupsd, will initiate a system shutdown.
  145. MINUTES {{ ups_shutdown_on_remaining_minutes }}
  146. # If during a power failure, the UPS has run on batteries for TIMEOUT
  147. # many seconds or longer, apcupsd will initiate a system shutdown.
  148. # A value of 0 disables this timer.
  149. #
  150. # Note, if you have a Smart UPS, you will most likely want to disable
  151. # this timer by setting it to zero. That way, you UPS will continue
  152. # on batteries until either the % charge remaing drops to or below BATTERYLEVEL,
  153. # or the remaining battery runtime drops to or below MINUTES. Of course,
  154. # if you are testing, setting this to 60 causes a quick system shutdown
  155. # if you pull the power plug.
  156. # If you have an older dumb UPS, you will want to set this to less than
  157. # the time you know you can run on batteries.
  158. TIMEOUT {{ ups_shutdown_timeout_seconds }}
  159. # Time in seconds between annoying users to signoff prior to
  160. # system shutdown. 0 disables.
  161. ANNOY {{ ups_preshutdown_annoy_seconds }}
  162. # Initial delay after power failure before warning users to get
  163. # off the system.
  164. ANNOYDELAY {{ ups_annoy_delay_seconds }}
  165. # The condition which determines when users are prevented from
  166. # logging in during a power failure.
  167. # NOLOGON <string> [ disable | timeout | percent | minutes | always ]
  168. NOLOGON disable
  169. # If KILLDELAY is non-zero, apcupsd will continue running after a
  170. # shutdown has been requested, and after the specified time in
  171. # seconds attempt to kill the power. This is for use on systems
  172. # where apcupsd cannot regain control after a shutdown.
  173. # KILLDELAY <seconds> 0 disables
  174. KILLDELAY 0
  175. #
  176. # ==== Configuration statements for Network Information Server ====
  177. #
  178. # NETSERVER [ on | off ] on enables, off disables the network
  179. # information server. If netstatus is on, a network information
  180. # server process will be started for serving the STATUS and
  181. # EVENT data over the network (used by CGI programs).
  182. NETSERVER on
  183. # NISIP <dotted notation ip address>
  184. # IP address on which NIS server will listen for incoming connections.
  185. # This is useful if your server is multi-homed (has more than one
  186. # network interface and IP address). Default value is 0.0.0.0 which
  187. # means any incoming request will be serviced. Alternatively, you can
  188. # configure this setting to any specific IP address of your server and
  189. # NIS will listen for connections only on that interface. Use the
  190. # loopback address (127.0.0.1) to accept connections only from the
  191. # local machine.
  192. NISIP 0.0.0.0
  193. # NISPORT <port> default is 3551 as registered with the IANA
  194. # port to use for sending STATUS and EVENTS data over the network.
  195. # It is not used unless NETSERVER is on. If you change this port,
  196. # you will need to change the corresponding value in the cgi directory
  197. # and rebuild the cgi programs.
  198. NISPORT 3551
  199. # If you want the last few EVENTS to be available over the network
  200. # by the network information server, you must define an EVENTSFILE.
  201. EVENTSFILE /var/log/apcupsd.events
  202. # EVENTSFILEMAX <kilobytes>
  203. # By default, the size of the EVENTSFILE will be not be allowed to exceed
  204. # 10 kilobytes. When the file grows beyond this limit, older EVENTS will
  205. # be removed from the beginning of the file (first in first out). The
  206. # parameter EVENTSFILEMAX can be set to a different kilobyte value, or set
  207. # to zero to allow the EVENTSFILE to grow without limit.
  208. EVENTSFILEMAX 10
  209. #
  210. # ========== Configuration statements used if sharing =============
  211. # a UPS with more than one machine
  212. #
  213. # Remaining items are for ShareUPS (APC expansion card) ONLY
  214. #
  215. # UPSCLASS [ standalone | shareslave | sharemaster ]
  216. # Normally standalone unless you share an UPS using an APC ShareUPS
  217. # card.
  218. UPSCLASS standalone
  219. # UPSMODE [ disable | share ]
  220. # Normally disable unless you share an UPS using an APC ShareUPS card.
  221. UPSMODE disable
  222. #
  223. # ===== Configuration statements to control apcupsd system logging ========
  224. #
  225. # Time interval in seconds between writing the STATUS file; 0 disables
  226. STATTIME 0
  227. # Location of STATUS file (written to only if STATTIME is non-zero)
  228. STATFILE /var/log/apcupsd.status
  229. # LOGSTATS [ on | off ] on enables, off disables
  230. # Note! This generates a lot of output, so if
  231. # you turn this on, be sure that the
  232. # file defined in syslog.conf for LOG_NOTICE is a named pipe.
  233. # You probably do not want this on.
  234. LOGSTATS off
  235. # Time interval in seconds between writing the DATA records to
  236. # the log file. 0 disables.
  237. DATATIME 0
  238. # FACILITY defines the logging facility (class) for logging to syslog.
  239. # If not specified, it defaults to "daemon". This is useful
  240. # if you want to separate the data logged by apcupsd from other
  241. # programs.
  242. #FACILITY DAEMON
  243. #
  244. # ========== Configuration statements used in updating the UPS EPROM =========
  245. #
  246. #
  247. # These statements are used only by apctest when choosing "Set EEPROM with conf
  248. # file values" from the EEPROM menu. THESE STATEMENTS HAVE NO EFFECT ON APCUPSD.
  249. #
  250. # UPS name, max 8 characters
  251. #UPSNAME UPS_IDEN
  252. # Battery date - 8 characters
  253. #BATTDATE mm/dd/yy
  254. # Sensitivity to line voltage quality (H cause faster transfer to batteries)
  255. # SENSITIVITY H M L (default = H)
  256. #SENSITIVITY H
  257. # UPS delay after power return (seconds)
  258. # WAKEUP 000 060 180 300 (default = 0)
  259. #WAKEUP 60
  260. # UPS Grace period after request to power off (seconds)
  261. # SLEEP 020 180 300 600 (default = 20)
  262. #SLEEP 180
  263. # Low line voltage causing transfer to batteries
  264. # The permitted values depend on your model as defined by last letter
  265. # of FIRMWARE or APCMODEL. Some representative values are:
  266. # D 106 103 100 097
  267. # M 177 172 168 182
  268. # A 092 090 088 086
  269. # I 208 204 200 196 (default = 0 => not valid)
  270. #LOTRANSFER 208
  271. # High line voltage causing transfer to batteries
  272. # The permitted values depend on your model as defined by last letter
  273. # of FIRMWARE or APCMODEL. Some representative values are:
  274. # D 127 130 133 136
  275. # M 229 234 239 224
  276. # A 108 110 112 114
  277. # I 253 257 261 265 (default = 0 => not valid)
  278. #HITRANSFER 253
  279. # Battery charge needed to restore power
  280. # RETURNCHARGE 00 15 50 90 (default = 15)
  281. #RETURNCHARGE 15
  282. # Alarm delay
  283. # 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never
  284. # BEEPSTATE 0 T L N (default = 0)
  285. #BEEPSTATE T
  286. # Low battery warning delay in minutes
  287. # LOWBATT 02 05 07 10 (default = 02)
  288. #LOWBATT 2
  289. # UPS Output voltage when running on batteries
  290. # The permitted values depend on your model as defined by last letter
  291. # of FIRMWARE or APCMODEL. Some representative values are:
  292. # D 115
  293. # M 208
  294. # A 100
  295. # I 230 240 220 225 (default = 0 => not valid)
  296. #OUTPUTVOLTS 230
  297. # Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on
  298. # SELFTEST 336 168 ON OFF (default = 336)
  299. #SELFTEST 336