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"
|
2016-07-18 00:11:41 +00:00
|
|
|
| "maxretry"
|
|
|
|
| "retrydelay"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "pollinterval"
|
2016-07-18 00:11:41 +00:00
|
|
|
| "synchronous"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "user"
|
|
|
|
|
|
|
|
let ups_fields = "driver"
|
|
|
|
| "port"
|
|
|
|
| "sdorder"
|
|
|
|
| "desc"
|
|
|
|
| "nolock"
|
2016-07-18 00:11:41 +00:00
|
|
|
| "ignorelb"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "maxstartdelay"
|
2016-07-18 00:11:41 +00:00
|
|
|
| "synchronous"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "BYPASS"
|
|
|
|
| "CHRG_addr"
|
|
|
|
| "CHRG_noro"
|
|
|
|
| "CHRG_regtype"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "CP"
|
|
|
|
| "CS"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "Could not addvar(%s)"
|
|
|
|
| "DISCHRG_addr"
|
|
|
|
| "DISCHRG_noro"
|
|
|
|
| "DISCHRG_regtype"
|
|
|
|
| "FSD_addr"
|
|
|
|
| "FSD_noro"
|
|
|
|
| "FSD_pulse_duration"
|
|
|
|
| "FSD_regtype"
|
|
|
|
| "HB_addr"
|
|
|
|
| "HB_noro"
|
|
|
|
| "HB_regtype"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "ID"
|
|
|
|
| "LB"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "LB_addr"
|
|
|
|
| "LB_noro"
|
|
|
|
| "LB_regtype"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "LowBatt"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "OB_addr"
|
|
|
|
| "OB_noro"
|
|
|
|
| "OB_regtype"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "OL"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "OL_addr"
|
|
|
|
| "OL_noro"
|
|
|
|
| "OL_regtype"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "OffDelay"
|
|
|
|
| "OnDelay"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "RB"
|
|
|
|
| "RB_addr"
|
|
|
|
| "RB_noro"
|
|
|
|
| "RB_regtype"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "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"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "cshdelay"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "daysoff"
|
|
|
|
| "daysweek"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "dev_slave_id"
|
|
|
|
| "device"
|
|
|
|
| "device_mfr"
|
|
|
|
| "device_model"
|
|
|
|
| "do_convert_deci"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "dumbterm"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "eco_mode"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "explore"
|
|
|
|
| "fake_lowbatt"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "fault_1"
|
|
|
|
| "fault_2"
|
|
|
|
| "fault_3"
|
|
|
|
| "fault_4"
|
|
|
|
| "fault_5"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "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"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "i2c_address"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "idleload"
|
2015-04-30 13:53:36 +00:00
|
|
|
| "ignoresab"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "input_fault_voltage"
|
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"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "max_polls_without_data"
|
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"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "mod_byte_to_s"
|
|
|
|
| "mod_byte_to_us"
|
|
|
|
| "mod_resp_to_s"
|
|
|
|
| "mod_resp_to_us"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "model"
|
|
|
|
| "modelname"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "nobt"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "nohang"
|
|
|
|
| "nombattvolt"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "nominal_cell_voltage"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "norating"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "noscanlangid"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "notification"
|
|
|
|
| "notransferoids"
|
|
|
|
| "novendor"
|
|
|
|
| "nowarn_noimp"
|
|
|
|
| "numOfBytesFromUPS"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "number_of_battery_cells"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "offdelay"
|
|
|
|
| "oldmac"
|
|
|
|
| "ondelay"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "onlinedischarge"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "output_pace"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "output_phase_angle"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "output_voltages"
|
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"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "recharge_time"
|
2013-11-24 15:00:12 +00:00
|
|
|
| "reset_to_default"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "rio_slave_id"
|
|
|
|
| "runtime_full"
|
|
|
|
| "runtime_half"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "runtimecal"
|
|
|
|
| "sdtime"
|
|
|
|
| "sdtype"
|
|
|
|
| "secLevel"
|
|
|
|
| "secName"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "semistaticfreq"
|
|
|
|
| "ser_baud_rate"
|
|
|
|
| "ser_data_bit"
|
|
|
|
| "ser_parity"
|
|
|
|
| "ser_stop_bit"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "serial"
|
|
|
|
| "serialnumber"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "series"
|
2011-01-26 09:35:08 +00:00
|
|
|
| "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"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "slave_address"
|
2016-07-18 00:11:41 +00:00
|
|
|
| "snmp_retries"
|
|
|
|
| "snmp_timeout"
|
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"
|
2022-06-29 10:37:36 +00:00
|
|
|
| "symmetrathreephase"
|
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
|