2011-01-26 09:35:08 +00:00
|
|
|
(*
|
|
|
|
Module: NutUpsConf
|
|
|
|
Parses @CONFPATH@/ups.conf
|
|
|
|
|
|
|
|
Author: Raphael Pinson <raphink@gmail.com>
|
|
|
|
Frederic Bohe <fredericbohe@eaton.com>
|
|
|
|
Arnaud Quette <arnaud.quette@gmail.com>
|
|
|
|
|
|
|
|
About: License
|
|
|
|
This file is licensed under the GPL.
|
|
|
|
|
|
|
|
About: Lens Usage
|
|
|
|
Sample usage of this lens in augtool
|
|
|
|
|
|
|
|
* Print all drivers used
|
|
|
|
> print /files/@CONFPATH@/ups.conf/*/driver
|
|
|
|
|
|
|
|
About: Configuration files
|
|
|
|
This lens applies to @CONFPATH@/ups.conf. See <filter>.
|
|
|
|
*)
|
|
|
|
|
|
|
|
module NutUpsConf =
|
|
|
|
autoload ups_xfm
|
|
|
|
|
|
|
|
(************************************************************************
|
|
|
|
* Group: UPS.CONF
|
|
|
|
*************************************************************************)
|
|
|
|
|
|
|
|
let ups_comment = IniFile.comment IniFile.comment_re IniFile.comment_default
|
|
|
|
|
|
|
|
let ups_sep = IniFile.sep IniFile.sep_re IniFile.sep_default
|
|
|
|
|
|
|
|
let ups_global = "chroot"
|
|
|
|
| "driverpath"
|
|
|
|
| "maxstartdelay"
|
|
|
|
| "pollinterval"
|
|
|
|
| "user"
|
|
|
|
|
|
|
|
let ups_fields = "driver"
|
|
|
|
| "port"
|
|
|
|
| "sdorder"
|
|
|
|
| "desc"
|
|
|
|
| "nolock"
|
|
|
|
| "maxstartdelay"
|
|
|
|
| "CP"
|
|
|
|
| "CS"
|
|
|
|
| "ID"
|
|
|
|
| "LB"
|
|
|
|
| "LowBatt"
|
|
|
|
| "OL"
|
|
|
|
| "OffDelay"
|
|
|
|
| "OnDelay"
|
|
|
|
| "SD"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "advanced_eco_mode"
|
2011-06-01 20:31:49 +00:00
|
|
|
| "advorder"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "alarm_control"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "authPassword"
|
|
|
|
| "authProtocol"
|
2011-09-29 18:14:46 +00:00
|
|
|
| "authtype"
|
|
|
|
| "awd"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "batteryPercentage"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "battery_alarm"
|
2015-04-30 13:53:36 +00:00
|
|
|
| "battery_max"
|
|
|
|
| "battery_min"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "battery_number"
|
|
|
|
| "battery_open_status_check"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "battext"
|
2012-06-01 13:55:19 +00:00
|
|
|
| "battvoltmult"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "baud_rate"
|
|
|
|
| "baudrate"
|
|
|
|
| "bus"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "bypass_alarm"
|
|
|
|
| "bypass_forbidding"
|
|
|
|
| "bypass_when_off"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "cable"
|
|
|
|
| "cablepower"
|
|
|
|
| "chargetime"
|
|
|
|
| "community"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "constant_phase_angle"
|
|
|
|
| "converter_mode"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "daysoff"
|
|
|
|
| "daysweek"
|
|
|
|
| "dumbterm"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "eco_mode"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "explore"
|
|
|
|
| "fake_lowbatt"
|
|
|
|
| "flash"
|
|
|
|
| "frequency"
|
2011-09-29 18:14:46 +00:00
|
|
|
| "fruid"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "full_update"
|
2015-04-30 13:53:36 +00:00
|
|
|
| "hb"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "houroff"
|
|
|
|
| "houron"
|
|
|
|
| "idleload"
|
2015-04-30 13:53:36 +00:00
|
|
|
| "ignoresab"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "input_timeout"
|
2015-04-30 13:53:36 +00:00
|
|
|
| "interruptonly"
|
|
|
|
| "interruptsize"
|
2012-01-24 10:22:33 +00:00
|
|
|
| "langid_fix"
|
2015-04-30 13:53:36 +00:00
|
|
|
| "lb"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "limited_runtime_on_battery"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "linevoltage"
|
|
|
|
| "load.off"
|
|
|
|
| "load.on"
|
|
|
|
| "load.status"
|
|
|
|
| "loadPercentage"
|
|
|
|
| "login"
|
|
|
|
| "lowbatt"
|
|
|
|
| "manufacturer"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "max_bypass_freq"
|
|
|
|
| "max_bypass_volt"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "max_load"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "maxreport"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "methodOfFlowControl"
|
|
|
|
| "mfr"
|
|
|
|
| "mibs"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "min_bypass_freq"
|
|
|
|
| "min_bypass_volt"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "mincharge"
|
|
|
|
| "minruntime"
|
|
|
|
| "model"
|
|
|
|
| "modelname"
|
|
|
|
| "nohang"
|
|
|
|
| "nombattvolt"
|
|
|
|
| "norating"
|
|
|
|
| "notification"
|
|
|
|
| "notransferoids"
|
|
|
|
| "novendor"
|
|
|
|
| "nowarn_noimp"
|
|
|
|
| "numOfBytesFromUPS"
|
|
|
|
| "offdelay"
|
|
|
|
| "oldmac"
|
|
|
|
| "ondelay"
|
|
|
|
| "output_pace"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "output_phase_angle"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "password"
|
2015-04-30 13:53:36 +00:00
|
|
|
| "pins_shutdown_mode"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "pollfreq"
|
|
|
|
| "pollonly"
|
|
|
|
| "powerup"
|
|
|
|
| "prefix"
|
|
|
|
| "prgshut"
|
|
|
|
| "privPassword"
|
|
|
|
| "privProtocol"
|
|
|
|
| "product"
|
|
|
|
| "productid"
|
|
|
|
| "protocol"
|
|
|
|
| "rebootdelay"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "reset_to_default"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "runtimecal"
|
|
|
|
| "sdtime"
|
|
|
|
| "sdtype"
|
|
|
|
| "secLevel"
|
|
|
|
| "secName"
|
|
|
|
| "serial"
|
|
|
|
| "serialnumber"
|
|
|
|
| "shutdownArguments"
|
|
|
|
| "shutdown_delay"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "shutdown_duration"
|
|
|
|
| "shutdown_timer"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "silent"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "site_fault_detection"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "snmp_version"
|
|
|
|
| "startdelay"
|
|
|
|
| "status_only"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "stayoff"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "subdriver"
|
|
|
|
| "subscribe"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "testing"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "testtime"
|
|
|
|
| "timeout"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "ttymode"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "type"
|
|
|
|
| "ups.delay.shutdown"
|
|
|
|
| "ups.delay.start"
|
|
|
|
| "upstype"
|
2015-04-30 13:53:36 +00:00
|
|
|
| "usb_set_altinterface"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "usd"
|
|
|
|
| "use_crlf"
|
|
|
|
| "use_pre_lf"
|
2011-09-29 18:14:46 +00:00
|
|
|
| "username"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "validationSequence"
|
|
|
|
| "vendor"
|
|
|
|
| "vendorid"
|
|
|
|
| "voltage"
|
|
|
|
| "wait"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "work_range_type"
|
2011-06-01 20:31:49 +00:00
|
|
|
| "wugrace"
|
2011-01-26 09:35:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
let ups_entry = IniFile.indented_entry (ups_global|ups_fields) ups_sep ups_comment
|
|
|
|
|
|
|
|
let ups_title = IniFile.indented_title IniFile.record_re
|
|
|
|
|
|
|
|
let ups_record = IniFile.record ups_title ups_entry
|
|
|
|
|
|
|
|
let ups_lns = IniFile.lns ups_record ups_comment
|
|
|
|
|
|
|
|
let ups_filter = (incl "@CONFPATH@/ups.conf")
|
|
|
|
. Util.stdexcl
|
|
|
|
|
|
|
|
let ups_xfm = transform ups_lns ups_filter
|