160 lines
4.5 KiB
Text
160 lines
4.5 KiB
Text
|
(*
|
||
|
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"
|
||
|
| "authPassword"
|
||
|
| "authProtocol"
|
||
|
| "batteryPercentage"
|
||
|
| "battext"
|
||
|
| "baud_rate"
|
||
|
| "baudrate"
|
||
|
| "bus"
|
||
|
| "cable"
|
||
|
| "cablepower"
|
||
|
| "chargetime"
|
||
|
| "community"
|
||
|
| "daysoff"
|
||
|
| "daysweek"
|
||
|
| "dumbterm"
|
||
|
| "explore"
|
||
|
| "fake_lowbatt"
|
||
|
| "flash"
|
||
|
| "frequency"
|
||
|
| "full_update"
|
||
|
| "houroff"
|
||
|
| "houron"
|
||
|
| "idleload"
|
||
|
| "input_timeout"
|
||
|
| "linevoltage"
|
||
|
| "load.off"
|
||
|
| "load.on"
|
||
|
| "load.status"
|
||
|
| "loadPercentage"
|
||
|
| "login"
|
||
|
| "lowbatt"
|
||
|
| "manufacturer"
|
||
|
| "max_load"
|
||
|
| "methodOfFlowControl"
|
||
|
| "mfr"
|
||
|
| "mibs"
|
||
|
| "mincharge"
|
||
|
| "minruntime"
|
||
|
| "model"
|
||
|
| "modelname"
|
||
|
| "nohang"
|
||
|
| "nombattvolt"
|
||
|
| "norating"
|
||
|
| "notification"
|
||
|
| "notransferoids"
|
||
|
| "novendor"
|
||
|
| "nowarn_noimp"
|
||
|
| "numOfBytesFromUPS"
|
||
|
| "offdelay"
|
||
|
| "oldmac"
|
||
|
| "ondelay"
|
||
|
| "output_pace"
|
||
|
| "password"
|
||
|
| "pollfreq"
|
||
|
| "pollonly"
|
||
|
| "powerup"
|
||
|
| "prefix"
|
||
|
| "prgshut"
|
||
|
| "privPassword"
|
||
|
| "privProtocol"
|
||
|
| "product"
|
||
|
| "productid"
|
||
|
| "protocol"
|
||
|
| "rebootdelay"
|
||
|
| "runtimecal"
|
||
|
| "sdtime"
|
||
|
| "sdtype"
|
||
|
| "secLevel"
|
||
|
| "secName"
|
||
|
| "serial"
|
||
|
| "serialnumber"
|
||
|
| "shutdownArguments"
|
||
|
| "shutdown_delay"
|
||
|
| "silent"
|
||
|
| "snmp_version"
|
||
|
| "startdelay"
|
||
|
| "status_only"
|
||
|
| "subdriver"
|
||
|
| "subscribe"
|
||
|
| "testtime"
|
||
|
| "timeout"
|
||
|
| "type"
|
||
|
| "ups.delay.shutdown"
|
||
|
| "ups.delay.start"
|
||
|
| "upstype"
|
||
|
| "usd"
|
||
|
| "use_crlf"
|
||
|
| "use_pre_lf"
|
||
|
| "validationSequence"
|
||
|
| "vendor"
|
||
|
| "vendorid"
|
||
|
| "voltage"
|
||
|
| "wait"
|
||
|
|
||
|
|
||
|
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
|