Skip to content

Commit

Permalink
Merge pull request networkupstools#58 from jimklimov/backport-1.4
Browse files Browse the repository at this point in the history
Backport FTY updates into 1.4 release
  • Loading branch information
aquette committed Aug 7, 2018
2 parents f69311c + b1ed14e commit 3047972
Show file tree
Hide file tree
Showing 9 changed files with 226 additions and 59 deletions.
79 changes: 70 additions & 9 deletions Jenkinsfile

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ default|default-alldrv|default-spellcheck|default-nodoc|default-withdoc|"default
echo "==="
if git status -s | egrep '\.dmf$' ; then
echo "FATAL: There are changes in DMF files listed above - tracked sources should be updated!" >&2
git diff -- '*.dmf'
exit 1
fi
if [ "$HAVE_CCACHE" = yes ]; then
Expand Down Expand Up @@ -229,6 +230,7 @@ default|default-alldrv|default-spellcheck|default-nodoc|default-withdoc|"default
echo "==="
if git status -s | egrep '\.dmf$' ; then
echo "FATAL: There are changes in DMF files listed above - tracked sources should be updated!" >&2
git diff -- '*.dmf'
exit 1
fi

Expand All @@ -250,6 +252,7 @@ default|default-alldrv|default-spellcheck|default-nodoc|default-withdoc|"default
echo "==="
if git status -s | egrep '\.dmf$' ; then
echo "FATAL: There are changes in DMF files listed above - tracked sources should be updated!" >&2
git diff -- '*.dmf'
exit 1
fi
)
Expand Down
2 changes: 1 addition & 1 deletion docs/nut-dmf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ in the root of NUT sources tree and generally can build NUT (the `pycparser`
tries to compile instrumented sources, and requires the toolchain as well as
the `config.h` file generated by `configure` script). Note that by default
the `configure` script would detect if it can use this toolchain to generate
DMF files, and if not - it wold fall back to using the files pre-generated
DMF files, and if not - it would fall back to using the files pre-generated
and stored in the NUT source code repository.

The generation toolkit is a mix of Python and shell scripts:
Expand Down
12 changes: 10 additions & 2 deletions docs/nut-names.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ input: Incoming line/power information
| input.current.low.critical | Low critical threshold (A) | 2
| input.current.high.warning | High warning threshold (A) | 10
| input.current.high.critical | High critical threshold (A) | 12
| input.feed.color | Color of the input feed
(opaque string) | 3831236
| input.feed.desc | Description of the input feed | Feed A
| input.frequency | Input line frequency (Hz) | 60.00
| input.frequency.nominal | Nominal input line
frequency (Hz) | 60
Expand All @@ -191,6 +194,8 @@ input: Incoming line/power information
of full) | 25
| input.realpower | Current sum value of all (ePDU)
phases real power (W) | 300
| input.realpower.nominal | Typical power capacity of the
ePDU input (W) | 2000
| input.power | Current sum value of all (ePDU)
phases apparent power (VA) | 500
| input.source | The current input power source | 1
Expand Down Expand Up @@ -552,8 +557,9 @@ outlet collection apply to outlet.group, especially for the indexing 'n'
and "outlet.group.count".

Most of the data published for outlets also apply to outlet.group,
including: id, name (similar as outlet "desc"), status, current and
voltage (including status, alarm and thresholds).
including: id, name (similar as outlet "desc"), color, status, current and
voltage (including status, alarm and thresholds). Other actions and settings
also apply ({delay,timer}.{shutdown,start})

Some specific data to outlet groups exists:

Expand All @@ -565,6 +571,8 @@ Some specific data to outlet groups exists:
| outlet.group.n.phase | Electrical phase to which the
physical outlet group (Gang) is
connected to | L1
| outlet.group.n.input | Input to which an outlet group
is connected | 1
|=================================================================================

Example:
Expand Down
6 changes: 3 additions & 3 deletions drivers/eaton-pdu-marlin-mib.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/* Eaton PDU-MIB - Marlin MIB
* ************************** */

#define EATON_MARLIN_MIB_VERSION "0.46"
#define EATON_MARLIN_MIB_VERSION "0.48"
#define EATON_MARLIN_SYSOID ".1.3.6.1.4.1.534.6.6.7"
#define EATON_MARLIN_OID_MODEL_NAME ".1.3.6.1.4.1.534.6.6.7.1.2.1.2.0"

Expand Down Expand Up @@ -579,10 +579,10 @@ static snmp_info_t eaton_marlin_mib[] = {
* NULL, SU_FLAG_STATIC | SU_FLAG_OK | SU_TYPE_DAISY_1, NULL, NULL },
*/
{ "input.feed.color", 0, 1, ".1.3.6.1.4.1.534.6.6.7.3.1.1.9.%i.1",
NULL, SU_FLAG_STATIC | SU_FLAG_OK | SU_TYPE_DAISY_1, NULL, NULL },
NULL, SU_FLAG_SEMI_STATIC | SU_FLAG_OK | SU_TYPE_DAISY_1, NULL, NULL },
/* inputPowerCapacity.0.1 = INTEGER: 2300 */
/* FIXME: RFC on key name is needed when backporting to NUT upstream */
{ "input.power.nominal", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.5.1.9.%i.1",
{ "input.realpower.nominal", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.5.1.9.%i.1",
NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL, NULL },

/* Ambient collection */
Expand Down
103 changes: 93 additions & 10 deletions drivers/powerware-mib.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "powerware-mib.h"

#define PW_MIB_VERSION "0.92"
#define PW_MIB_VERSION "0.93"

/* TODO: more sysOID and MIBs support:
*
Expand All @@ -35,7 +35,8 @@
* PXGX 1000 cards (PDU/RPP/RPM): Get pduNumPanels ".1.3.6.1.4.1.534.6.6.4.1.1.1.4.0"
*/

/* Powerware UPS (Ingrasys X-SLOT and BD-SLOT) */
/* Powerware UPS (Ingrasys X-SLOT and BD-SLOT)
* Eaton Gigabit Network Card (Genepi) */
#define POWERWARE_SYSOID ".1.3.6.1.4.1.534.1"
/* Powerware UPS newer PXGX UPS cards (BladeUPS, ...) */
#define EATON_PXGX_SYSOID ".1.3.6.1.4.1.534.2.12"
Expand Down Expand Up @@ -78,7 +79,6 @@
#define PW_OID_CONT_ONT_DEL "1.3.6.1.4.1.534.1.9.4" /* XUPS-MIB::xupsControlOutputOnTrapDelay */
#define PW_OID_CONT_LOAD_SHED_AND_RESTART "1.3.6.1.4.1.534.1.9.6" /* XUPS-MIB::xupsLoadShedSecsWithRestart */

#define PW_OID_CONF_OVOLTAGE "1.3.6.1.4.1.534.1.10.1.0" /* XUPS-MIB::xupsConfigOutputVoltage.0 */
#define PW_OID_CONF_IVOLTAGE "1.3.6.1.4.1.534.1.10.2.0" /* XUPS-MIB::xupsConfigInputVoltage.0 */
#define PW_OID_CONF_POWER "1.3.6.1.4.1.534.1.10.3.0" /* XUPS-MIB::xupsConfigOutputWatts.0 */
#define PW_OID_CONF_FREQ "1.3.6.1.4.1.534.1.10.4.0" /* XUPS-MIB::xupsConfigOutputFreq.0 */
Expand Down Expand Up @@ -135,6 +135,14 @@ static info_lkp_t pw_pwr_info[] = {
{ 0, NULL }
};

/* FIXME: mapped to ups.type, but should be output.source or ups.mode (need RFC)
* to complement the above ups.status
* along with having ups.type as described hereafter*/
/* FIXME: should be used by ups.mode or output.source (need RFC);
* Note: this define is not set via project options; code hidden with
* commit to "snmp-ups: support newer Genepi management cards"
*/
#ifdef USE_PW_MODE_INFO
static info_lkp_t pw_mode_info[] = {
{ 1, "" },
{ 2, "" },
Expand All @@ -146,7 +154,8 @@ static info_lkp_t pw_mode_info[] = {
{ 8, "parallel capacity" },
{ 9, "parallel redundancy" },
{ 10, "high efficiency" },
/* Extended status values */
/* Extended status values,
* FIXME: check for source and completion */
{ 240, "" /* battery (0xF0) */ },
{ 100, "" /* maintenanceBypass (0x64) */ },
{ 96, "" /* Bypass (0x60) */ },
Expand All @@ -156,6 +165,34 @@ static info_lkp_t pw_mode_info[] = {
{ 16, "" /* none (0x10) */ },
{ 0, NULL }
};
#endif /* USE_PW_MODE_INFO */

/* FIXME: may be standardized
* extracted from bcmxcp.c->BCMXCP_TOPOLOGY_*, Make some common definitions */
static info_lkp_t pw_topology_info[] = {
{ 0x0000, "" }, /* None; use the Table of Elements */
{ 0x0010, "Off-line switcher, Single Phase" },
{ 0x0020, "Line-Interactive UPS, Single Phase" },
{ 0x0021, "Line-Interactive UPS, Two Phase" },
{ 0x0022, "Line-Interactive UPS, Three Phase" },
{ 0x0030, "Dual AC Input, On-Line UPS, Single Phase" },
{ 0x0031, "Dual AC Input, On-Line UPS, Two Phase" },
{ 0x0032, "Dual AC Input, On-Line UPS, Three Phase" },
{ 0x0040, "On-Line UPS, Single Phase" },
{ 0x0041, "On-Line UPS, Two Phase" },
{ 0x0042, "On-Line UPS, Three Phase" },
{ 0x0050, "Parallel Redundant On-Line UPS, Single Phase" },
{ 0x0051, "Parallel Redundant On-Line UPS, Two Phase" },
{ 0x0052, "Parallel Redundant On-Line UPS, Three Phase" },
{ 0x0060, "Parallel for Capacity On-Line UPS, Single Phase" },
{ 0x0061, "Parallel for Capacity On-Line UPS, Two Phase" },
{ 0x0062, "Parallel for Capacity On-Line UPS, Three Phase" },
{ 0x0102, "System Bypass Module, Three Phase" },
{ 0x0122, "Hot-Tie Cabinet, Three Phase" },
{ 0x0200, "Outlet Controller, Single Phase" },
{ 0x0222, "Dual AC Input Static Switch Module, 3 Phase" },
{ 0, NULL }
};

/* Legacy implementation */
static info_lkp_t pw_battery_abm_status[] = {
Expand Down Expand Up @@ -198,7 +235,7 @@ static info_lkp_t pw_ambient_drycontacts_info[] = {
{ -1, "unknown" },
{ 1, "opened" },
{ 2, "closed" },
{ 3, "opened" }, /* openWithNotice */
{ 3, "opened" }, /* openWithNotice */
{ 4, "closed" }, /* closedWithNotice */
{ 0, NULL }
};
Expand All @@ -221,8 +258,14 @@ static snmp_info_t pw_mib[] = {
SU_FLAG_STATIC, NULL },
{ "ups.load", 0, 1.0, PW_OID_OUT_LOAD, "",
SU_OUTPUT_1, NULL },
/* FIXME: should be removed in favor of output.power */
{ "ups.power", 0, 1.0, PW_OID_OUT_POWER ".1", "",
0, NULL },
/* Duplicate of the above entry, but pointing at the first index */
/* xupsOutputWatts.1.0; Value (Integer): 300 */
{ "ups.power", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.4.1.0", "",
0, NULL },

{ "ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_POWER_STATUS, "OFF",
SU_STATUS_PWR, &pw_pwr_info[0] },
{ "ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_ALARM_OB, "",
Expand All @@ -231,10 +274,20 @@ static snmp_info_t pw_mib[] = {
SU_STATUS_BATT, &pw_alarm_lb[0] },
{ "ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_BATT_STATUS, "",
SU_STATUS_BATT, &pw_battery_abm_status[0] },
#ifdef USE_PW_MODE_INFO
/* FIXME: should be ups.mode or output.source (need RFC) */
/* Note: this define is not set via project options; code hidden with
* commit to "snmp-ups: support newer Genepi management cards" */
{ "ups.type", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_POWER_STATUS, "",
SU_FLAG_STATIC | SU_FLAG_OK, &pw_mode_info[0] },
#endif /* USE_PW_MODE_INFO */
/* xupsTopologyType.0; Value (Integer): 32 */
{ "ups.type", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.1.13.1.0", "",
SU_FLAG_STATIC | SU_FLAG_OK, &pw_topology_info[0] },
/* FIXME: should be removed in favor of their output. equivalent! */
{ "ups.realpower.nominal", 0, 1.0, PW_OID_CONF_POWER, "",
0, NULL },
/* FIXME: should be removed in favor of output.power.nominal */
{ "ups.power.nominal", 0, 1.0, IETF_OID_CONF_OUT_VA, "",
0, NULL },
/* XUPS-MIB::xupsEnvAmbientTemp.0 */
Expand Down Expand Up @@ -271,7 +324,10 @@ static snmp_info_t pw_mib[] = {
/* XUPS-MIB::xupsConfigOutputFreq.0 */
{ "output.frequency.nominal", 0, 0.1, "1.3.6.1.4.1.534.1.10.4.0", "", 0, NULL },
/* XUPS-MIB::xupsOutputVoltage.1 */
{ "output.voltage", 0, 1.0, ".1.3.6.1.4.1.534.1.4.4.1.2.1", "", SU_OUTPUT_1, NULL },
{ "output.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.2.1", "", SU_OUTPUT_1, NULL },
/* Duplicate of the above entry, but pointing at the first index */
/* xupsOutputVoltage.1.0; Value (Integer): 230 */
{ "output.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.2.1.0", "", SU_OUTPUT_1, NULL },
/* XUPS-MIB::xupsConfigOutputVoltage.0 */
{ "output.voltage.nominal", 0, 1.0, "1.3.6.1.4.1.534.1.10.1.0", "", 0, NULL },
/* XUPS-MIB::xupsConfigLowOutputVoltageLimit.0 */
Expand All @@ -280,8 +336,20 @@ static snmp_info_t pw_mib[] = {
{ "output.voltage.high", 0, 1.0, ".1.3.6.1.4.1.534.1.10.7.0", "", 0, NULL },
{ "output.current", 0, 1.0, PW_OID_OUT_CURRENT ".1", "",
SU_OUTPUT_1, NULL },
/* Duplicate of the above entry, but pointing at the first index */
/* xupsOutputCurrent.1.0; Value (Integer): 0 */
{ "output.current", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.3.1.0", "",
SU_OUTPUT_1, NULL },
{ "output.realpower", 0, 1.0, PW_OID_OUT_POWER ".1", "",
SU_OUTPUT_1, NULL },
/* Duplicate of the above entry, but pointing at the first index */
/* Name/OID: xupsOutputWatts.1.0; Value (Integer): 1200 */
{ "output.realpower", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.4.1.0", "",
0, NULL },
/* Duplicate of "ups.realpower.nominal"
* FIXME: map either ups or output, but not both (or have an auto-remap) */
{ "output.realpower.nominal", 0, 1.0, PW_OID_CONF_POWER, "",
0, NULL },
{ "output.L1-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".1", "",
SU_OUTPUT_3, NULL },
{ "output.L2-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".2", "",
Expand All @@ -307,8 +375,6 @@ static snmp_info_t pw_mib[] = {
SU_OUTPUT_3, NULL },
{ "output.L3.power.percent", 0, 1.0, IETF_OID_LOAD_LEVEL ".3", "",
SU_OUTPUT_3, NULL },
{ "output.voltage.nominal", 0, 1.0, PW_OID_CONF_OVOLTAGE, "",
0, NULL },

/* Input page */
{ "input.phases", 0, 1.0, PW_OID_IN_LINES, "",
Expand All @@ -317,6 +383,12 @@ static snmp_info_t pw_mib[] = {
0, NULL },
{ "input.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".0", "",
SU_INPUT_1, NULL },
/* Duplicate of the above entry, but pointing at the first index */
/* xupsInputVoltage.1.0; Value (Integer): 245 */
{ "input.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.3.4.1.2.1.0", "",
SU_INPUT_1, NULL },


/* XUPS-MIB::xupsConfigInputVoltage.0 */
{ "input.voltage.nominal", 0, 1.0, "1.3.6.1.4.1.534.1.10.2.0", "", 0, NULL },
{ "input.current", 0, 0.1, PW_OID_IN_CURRENT ".0", "",
Expand Down Expand Up @@ -347,6 +419,10 @@ static snmp_info_t pw_mib[] = {
{ "input.bypass.frequency", 0, 0.1, PW_OID_BY_FREQUENCY, "", 0, NULL },
{ "input.bypass.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".0", "",
SU_INPUT_1, NULL },
/* Duplicate of the above entry, but pointing at the first index */
/* xupsBypassVoltage.1.0; Value (Integer): 244 */
{ "input.bypass.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.5.3.1.2.1.0", "",
SU_INPUT_1, NULL },
{ "input.bypass.L1-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".1", "",
SU_INPUT_3, NULL },
{ "input.bypass.L2-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".2", "",
Expand All @@ -369,10 +445,17 @@ static snmp_info_t pw_mib[] = {
{ "ambient.humidity.high", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.12.0", "", 0, NULL },
/* XUPS-MIB::xupsContactState.1 */
{ "ambient.contacts.1.status", ST_FLAG_STRING, SU_INFOSIZE,
".1.3.6.1.4.1.534.1.6.8.1.3.1", "", 0, &pw_ambient_drycontacts_info[0] },
"1.3.6.1.4.1.534.1.6.8.1.3.1", "", 0, &pw_ambient_drycontacts_info[0] },
/* Duplicate of the above entry, but pointing at the first index */
/* FIXME: check snmp-ups->get_oid() for the walk/check on ".0" */
{ "ambient.contacts.1.status", ST_FLAG_STRING, SU_INFOSIZE,
"1.3.6.1.4.1.534.1.6.8.1.3.1.0", "", 0, &pw_ambient_drycontacts_info[0] },
/* XUPS-MIB::xupsContactState.2 */
{ "ambient.contacts.2.status", ST_FLAG_STRING, SU_INFOSIZE,
".1.3.6.1.4.1.534.1.6.8.1.3.2", "", 0, &pw_ambient_drycontacts_info[0] },
"1.3.6.1.4.1.534.1.6.8.1.3.2", "", 0, &pw_ambient_drycontacts_info[0] },
/* Duplicate of the above entry, but pointing at the first index */
{ "ambient.contacts.2.status", ST_FLAG_STRING, SU_INFOSIZE,
"1.3.6.1.4.1.534.1.6.8.1.3.2.0", "", 0, &pw_ambient_drycontacts_info[0] },

/* instant commands */
{ "test.battery.start.quick", 0, 1, PW_OID_BATTEST_START, "",
Expand Down
6 changes: 3 additions & 3 deletions scripts/DMF/dmfsnmp/eaton-pdu-marlin-mib.dmf
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@
<snmp_info flag_ok="yes" multiplier="1.0" name="input.L2.power" oid=".1.3.6.1.4.1.534.6.6.7.3.4.1.3.%i.1.2" positive="yes"/>
<snmp_info flag_ok="yes" multiplier="1.0" name="input.L3.power" oid=".1.3.6.1.4.1.534.6.6.7.3.4.1.3.%i.1.3" positive="yes"/>
<snmp_info flag_ok="yes" multiplier="128.0" name="input.feed.desc" oid=".1.3.6.1.4.1.534.6.6.7.3.1.1.10.%i.1" semistatic="yes" string="yes" type_daisy="1" writable="yes"/>
<snmp_info flag_ok="yes" multiplier="1.0" name="input.feed.color" oid=".1.3.6.1.4.1.534.6.6.7.3.1.1.9.%i.1" static="yes" type_daisy="1"/>
<snmp_info flag_ok="yes" multiplier="1.0" name="input.power.nominal" oid=".1.3.6.1.4.1.534.6.6.7.3.5.1.9.%i.1" positive="yes"/>
<snmp_info flag_ok="yes" multiplier="1.0" name="input.feed.color" oid=".1.3.6.1.4.1.534.6.6.7.3.1.1.9.%i.1" semistatic="yes" type_daisy="1"/>
<snmp_info flag_ok="yes" multiplier="1.0" name="input.realpower.nominal" oid=".1.3.6.1.4.1.534.6.6.7.3.5.1.9.%i.1" positive="yes"/>
<snmp_info flag_ok="yes" lookup="marlin_ambient_presence_info" multiplier="128.0" name="ambient.present" oid=".1.3.6.1.4.1.534.6.6.7.7.1.1.3.%i.1" string="yes"/>
<snmp_info flag_ok="yes" lookup="marlin_threshold_status_info" multiplier="128.0" name="ambient.temperature.status" oid=".1.3.6.1.4.1.534.6.6.7.7.1.1.5.%i.1" string="yes"/>
<snmp_info flag_ok="yes" lookup="marlin_threshold_temperature_alarms_info" multiplier="128.0" name="ups.alarm" oid=".1.3.6.1.4.1.534.6.6.7.7.1.1.5.%i.1" string="yes"/>
Expand Down Expand Up @@ -305,6 +305,6 @@
<snmp_info command="yes" multiplier="0.0" name="outlet.group.%i.load.on" oid=".1.3.6.1.4.1.534.6.6.7.5.6.1.4.%i.%i" outlet_group="yes" type_daisy="1"/>
<snmp_info command="yes" multiplier="0.0" name="outlet.group.%i.load.cycle" oid=".1.3.6.1.4.1.534.6.6.7.5.6.1.5.%i.%i" outlet_group="yes" type_daisy="1"/>
</snmp>
<mib2nut auto_check=".1.3.6.1.4.1.534.6.6.7.1.2.1.2.0" mib_name="eaton_epdu" name="eaton_marlin" oid=".1.3.6.1.4.1.534.6.6.7" snmp_info="eaton_marlin_mib" version="0.46"/>
<mib2nut auto_check=".1.3.6.1.4.1.534.6.6.7.1.2.1.2.0" mib_name="eaton_epdu" name="eaton_marlin" oid=".1.3.6.1.4.1.534.6.6.7" snmp_info="eaton_marlin_mib" version="0.48"/>
</nut>

Loading

0 comments on commit 3047972

Please sign in to comment.