add UPS monitoring over SNMP

This commit is contained in:
2026-04-30 16:16:12 +03:00
parent 05e57ef012
commit 2413661e19
19 changed files with 512 additions and 69 deletions

View File

@@ -5,7 +5,7 @@ set(MAJOR_VERSION "0")
set(MID_VERSION "0")
set(MINOR_VERSION "1")
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} SOURCES)
set(SOURCES cmdlnopts.c main.c mainweather.c sensors.c server.c)
set(VERSION "${MAJOR_VERSION}.${MID_VERSION}.${MINOR_VERSION}")
project(${PROJ} VERSION ${VERSION} LANGUAGES C)
@@ -19,6 +19,7 @@ option(HYDREON "Hydreon rain sensor plugin" ON)
option(BTAMETEO "BTA main meteostation plugin" ON)
option(REINHARDT "Old Reinhardt meteostation plugin" ON)
option(WXA100 "WXA100-06 meteostation plugin" ON)
option(SNMP "SNMP UPS monitoring module" ON)
# default flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -Wextra -fPIC")
@@ -55,8 +56,8 @@ pkg_check_modules(${PROJ} REQUIRED usefull_macros>=0.3.5)
#endif()
# static lib for sensors
set(LIBSRC "weathlib.c")
set(LIBHEADER "weathlib.h")
set(LIBSRC fd.c weathlib.c)
set(LIBHEADER weathlib.h)
add_library(${PROJLIB} STATIC ${LIBSRC})
set_target_properties(${PROJLIB} PROPERTIES VERSION ${VERSION})

View File

@@ -29,31 +29,33 @@
#include <sys/un.h> // unix socket
#include <usefull_macros.h>
#include "fd.h"
/**
* @brief openserial - try to open serial device
* @param path - path to device and speed, colon-separated (without given speed assume 9600)
* @return -1 if failed or opened FD
* WARNING!!! Memory leakage danger. Don't call this function too much times!
*/
static int openserial(char *path){
static int openserial(const char *path){
FNAME();
int speed = 9600; // default speed
char *colon = strchr(path, ':');
char *str = strdup(path);
char *colon = strchr(str, ':');
if(colon){
*colon++ = 0;
if(!sl_str2i(&speed, colon)){
WARNX("Wrong speed settings: '%s'", colon);
FREE(str);
return -1;
}
}
sl_tty_t *serial = sl_tty_new(path, speed, BUFSIZ);
sl_tty_t *serial = sl_tty_new(str, speed, BUFSIZ);
if(!serial || !sl_tty_open(serial, TRUE)){
WARN("Can't open %s @ speed %d", path, speed);
WARN("Can't open %s @ speed %d", str, speed);
FREE(str);
return -1;
}
DBG("Opened %s @ %d", path, speed);
DBG("Opened %s @ %d", str, speed);
FREE(str);
return serial->comfd;
}
@@ -77,13 +79,12 @@ static char *convunsname(const char *path){
* @param type - UNIX or INET
* @return -1 if failed or opened FD
*/
static int opensocket(char *path, sl_socktype_e type){
static int opensocket(const char *path, sl_socktype_e type){
FNAME();
DBG("path: '%s'", path);
int sock = -1;
struct addrinfo ai = {0}, *res = &ai;
struct sockaddr_un unaddr = {0};
char *node = path, *service = NULL;
ai.ai_socktype = 0; // try to get socket type from `getaddrinfo`
switch(type){
case SOCKT_UNIX:
@@ -102,16 +103,19 @@ static int opensocket(char *path, sl_socktype_e type){
case SOCKT_NET:
case SOCKT_NETLOCAL:
ai.ai_family = AF_INET;
char *delim = strchr(path, ':');
char *str = strdup(path);
char *delim = strchr(str, ':');
char *node = str, *service = NULL;
if(delim){
*delim = 0;
service = delim+1;
if(delim == path) node = NULL; // only port
if(delim == str) node = NULL; // only port
}
DBG("node: '%s', service: '%s'", node, service);
int e = getaddrinfo(node, service, &ai, &res);
if(e){
WARNX("getaddrinfo(): %s", gai_strerror(e));
FREE(str);
return -1;
}
for(struct addrinfo *p = res; p; p = p->ai_next){
@@ -123,6 +127,7 @@ static int opensocket(char *path, sl_socktype_e type){
} else break;
}
freeaddrinfo(res);
FREE(str);
break;
default: // never reached
WARNX("Unsupported socket type %d", type);
@@ -138,7 +143,7 @@ static int opensocket(char *path, sl_socktype_e type){
* WARNING!!! Contents of `path` would be modified in this function!
* @return opened file descriptor or -1 in case of error
*/
int getFD(char *path){
int getFD(const char *path){
if(!path || !*path || strlen(path) < 2) return -1;
char type = *path;
if(path[1] != ':') return -1; // after protocol letter should be delimeter

View File

@@ -1,21 +0,0 @@
/*
* This file is part of the weatherdaemon project.
* Copyright 2026 Edward V. Emelianov <edward.emelianoff@gmail.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
int getFD(char *path);

View File

@@ -507,7 +507,7 @@ void refresh_sensval(sensordata_t *s){
DBG("newlevel: %d, current: %d INCREASED", curlevel, collected_data[NCOMMWEATH].value.u);
LOGWARN("Station '%s', sensor '%s', increase weather level to %d", s->name, reason, curlevel);
collected_data[NCOMMWEATH].value.u = curlevel;
if(1 < snprintf(collected_data[NAHTUNGRSN].value.str, KEY_LEN+1, "%s", reason))
if(1 < snprintf(collected_data[NAHTUNGRSN].value.str, STRT_LEN+1, "%s", reason))
collected_data[NAHTUNGRSN].time = curtime;
}
if(curlevel){

View File

@@ -42,4 +42,20 @@ if(WXA100)
list(APPEND LIBS wxa100)
endif()
if(SNMP)
add_library(snmp SHARED snmp.c)
find_program(NETSNMP_CONFIG_BIN net-snmp-config)
if(NETSNMP_CONFIG_BIN)
# Capture linker libraries
execute_process(COMMAND ${NETSNMP_CONFIG_BIN} --libs
OUTPUT_VARIABLE NETSNMP_LIBS
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
message(FATAL_ERROR "net-snmp-config not found. Please install net-snmp package.")
endif()
message("SNMP: ${NETSNMP_LIBS}")
target_link_libraries(snmp PRIVATE ${NETSNMP_LIBS})
list(APPEND LIBS snmp)
endif()
install(TARGETS ${LIBS} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@@ -0,0 +1,149 @@
OBJECT_NAME,OBJECT_IDENTIFIER,OBJECT_DATA_TYPE,OBJECT_PREMISSIONS,OBJECT_CLASS,OBJECT_NODE_TYPE,OBJECT_DESCRIPTION
upsMIB,1.3.6.1.2.1.33,,,moduleidentity,,"The MIB module to describe Uninterruptible Power Supplies."
upsObjects,1.3.6.1.2.1.33.1,,,objectidentity,,""
upsIdent,1.3.6.1.2.1.33.1.1,,,objectidentity,,""
upsIdentManufacturer,1.3.6.1.2.1.33.1.1.1,displaystring,read-only,objecttype,scalar,"The name of the UPS manufacturer."
upsIdentModel,1.3.6.1.2.1.33.1.1.2,displaystring,read-only,objecttype,scalar,"The UPS Model designation."
upsIdentUPSSoftwareVersion,1.3.6.1.2.1.33.1.1.3,displaystring,read-only,objecttype,scalar,"The UPS firmware/software version(s). This variable may or may not have the same value as upsIdentAgentSoftwareVersion in some implementations."
upsIdentAgentSoftwareVersion,1.3.6.1.2.1.33.1.1.4,displaystring,read-only,objecttype,scalar,"The UPS agent software version. This variable may or may not have the same value as upsIdentUPSSoftwareVersion in some implementations."
upsIdentName,1.3.6.1.2.1.33.1.1.5,displaystring,read-write,objecttype,scalar,"A string identifying the UPS. This object should be set by the administrator."
upsIdentAttachedDevices,1.3.6.1.2.1.33.1.1.6,displaystring,read-write,objecttype,scalar,"A string identifying the devices attached to the output(s) of the UPS. This object should be set by the administrator."
upsBattery,1.3.6.1.2.1.33.1.2,,,objectidentity,,""
upsBatteryStatus,1.3.6.1.2.1.33.1.2.1,integer,read-only,objecttype,scalar,"The indication of the capacity remaining in the UPS system's batteries. A value of batteryNormal indicates that the remaining run-time is greater than upsConfigLowBattTime. A value of batteryLow indicates that the remaining battery run-time is less than or equal to upsConfigLowBattTime. A value of batteryDepleted indicates that the UPS will be unable to sustain the present load when and if the utility power is lost (including the possibility that the utility power is currently absent and the UPS is unable to sustain the output). Enumeration: 'unknown': 1, 'batteryNormal': 2, 'batteryDepleted': 4, 'batteryLow': 3."
upsSecondsOnBattery,1.3.6.1.2.1.33.1.2.2,nonnegativeinteger,read-only,objecttype,scalar,"If the unit is on battery power, the elapsed time since the UPS last switched to battery power, or the time since the network management subsystem was last restarted, whichever is less. Zero shall be returned if the unit is not on battery power."
upsEstimatedMinutesRemaining,1.3.6.1.2.1.33.1.2.3,positiveinteger,read-only,objecttype,scalar,"An estimate of the time to battery charge depletion under the present load conditions if the utility power is off and remains off, or if it were to be lost and remain off."
upsEstimatedChargeRemaining,1.3.6.1.2.1.33.1.2.4,integer,read-only,objecttype,scalar,"An estimate of the battery charge remaining expressed as a percent of full charge."
upsBatteryVoltage,1.3.6.1.2.1.33.1.2.5,nonnegativeinteger,read-only,objecttype,scalar,"The magnitude of the present battery voltage."
upsBatteryCurrent,1.3.6.1.2.1.33.1.2.6,integer32,read-only,objecttype,scalar,"The present battery current."
upsBatteryTemperature,1.3.6.1.2.1.33.1.2.7,integer32,read-only,objecttype,scalar,"The ambient temperature at or near the UPS Battery casing."
upsInput,1.3.6.1.2.1.33.1.3,,,objectidentity,,""
upsInputLineBads,1.3.6.1.2.1.33.1.3.1,counter32,read-only,objecttype,scalar,"A count of the number of times the input entered an out-of-tolerance condition as defined by the manufacturer. This count is incremented by one each time the input transitions from zero out-of-tolerance lines to one or more input lines out-of-tolerance."
upsInputNumLines,1.3.6.1.2.1.33.1.3.2,nonnegativeinteger,read-only,objecttype,scalar,"The number of input lines utilized in this device. This variable indicates the number of rows in the input table."
upsInputTable,1.3.6.1.2.1.33.1.3.3,,no-access,objecttype,table,"A list of input table entries. The number of entries is given by the value of upsInputNumLines."
upsInputEntry,1.3.6.1.2.1.33.1.3.3.1,,no-access,objecttype,row,"An entry containing information applicable to a particular input line."
upsInputLineIndex,1.3.6.1.2.1.33.1.3.3.1.1,positiveinteger,no-access,objecttype,column,"The input line identifier."
upsInputFrequency,1.3.6.1.2.1.33.1.3.3.1.2,nonnegativeinteger,read-only,objecttype,column,"The present input frequency."
upsInputVoltage,1.3.6.1.2.1.33.1.3.3.1.3,nonnegativeinteger,read-only,objecttype,column,"The magnitude of the present input voltage."
upsInputCurrent,1.3.6.1.2.1.33.1.3.3.1.4,nonnegativeinteger,read-only,objecttype,column,"The magnitude of the present input current."
upsInputTruePower,1.3.6.1.2.1.33.1.3.3.1.5,nonnegativeinteger,read-only,objecttype,column,"The magnitude of the present input true power."
upsOutput,1.3.6.1.2.1.33.1.4,,,objectidentity,,""
upsOutputSource,1.3.6.1.2.1.33.1.4.1,integer,read-only,objecttype,scalar,"The present source of output power. The enumeration none(2) indicates that there is no source of output power (and therefore no output power), for example, the system has opened the output breaker. Enumeration: 'none': 2, 'normal': 3, 'battery': 5, 'reducer': 7, 'other': 1, 'bypass': 4, 'booster': 6."
upsOutputFrequency,1.3.6.1.2.1.33.1.4.2,nonnegativeinteger,read-only,objecttype,scalar,"The present output frequency."
upsOutputNumLines,1.3.6.1.2.1.33.1.4.3,nonnegativeinteger,read-only,objecttype,scalar,"The number of output lines utilized in this device. This variable indicates the number of rows in the output table."
upsOutputTable,1.3.6.1.2.1.33.1.4.4,,no-access,objecttype,table,"A list of output table entries. The number of entries is given by the value of upsOutputNumLines."
upsOutputEntry,1.3.6.1.2.1.33.1.4.4.1,,no-access,objecttype,row,"An entry containing information applicable to a particular output line."
upsOutputLineIndex,1.3.6.1.2.1.33.1.4.4.1.1,positiveinteger,no-access,objecttype,column,"The output line identifier."
upsOutputVoltage,1.3.6.1.2.1.33.1.4.4.1.2,nonnegativeinteger,read-only,objecttype,column,"The present output voltage."
upsOutputCurrent,1.3.6.1.2.1.33.1.4.4.1.3,nonnegativeinteger,read-only,objecttype,column,"The present output current."
upsOutputPower,1.3.6.1.2.1.33.1.4.4.1.4,nonnegativeinteger,read-only,objecttype,column,"The present output true power."
upsOutputPercentLoad,1.3.6.1.2.1.33.1.4.4.1.5,integer,read-only,objecttype,column,"The percentage of the UPS power capacity presently being used on this output line, i.e., the greater of the percent load of true power capacity and the percent load of VA."
upsBypass,1.3.6.1.2.1.33.1.5,,,objectidentity,,""
upsBypassFrequency,1.3.6.1.2.1.33.1.5.1,nonnegativeinteger,read-only,objecttype,scalar,"The present bypass frequency."
upsBypassNumLines,1.3.6.1.2.1.33.1.5.2,nonnegativeinteger,read-only,objecttype,scalar,"The number of bypass lines utilized in this device. This entry indicates the number of rows in the bypass table."
upsBypassTable,1.3.6.1.2.1.33.1.5.3,,no-access,objecttype,table,"A list of bypass table entries. The number of entries is given by the value of upsBypassNumLines."
upsBypassEntry,1.3.6.1.2.1.33.1.5.3.1,,no-access,objecttype,row,"An entry containing information applicable to a particular bypass input."
upsBypassLineIndex,1.3.6.1.2.1.33.1.5.3.1.1,positiveinteger,no-access,objecttype,column,"The bypass line identifier."
upsBypassVoltage,1.3.6.1.2.1.33.1.5.3.1.2,nonnegativeinteger,read-only,objecttype,column,"The present bypass voltage."
upsBypassCurrent,1.3.6.1.2.1.33.1.5.3.1.3,nonnegativeinteger,read-only,objecttype,column,"The present bypass current."
upsBypassPower,1.3.6.1.2.1.33.1.5.3.1.4,nonnegativeinteger,read-only,objecttype,column,"The present true power conveyed by the bypass."
upsAlarm,1.3.6.1.2.1.33.1.6,,,objectidentity,,""
upsAlarmsPresent,1.3.6.1.2.1.33.1.6.1,gauge32,read-only,objecttype,scalar,"The present number of active alarm conditions."
upsAlarmTable,1.3.6.1.2.1.33.1.6.2,,no-access,objecttype,table,"A list of alarm table entries. The table contains zero, one, or many rows at any moment, depending upon the number of alarm conditions in effect. The table is initially empty at agent startup. The agent creates a row in the table each time a condition is detected and deletes that row when that condition no longer pertains. The agent creates the first row with upsAlarmId equal to 1, and increments the value of upsAlarmId each time a new row is created, wrapping to the first free value greater than or equal to 1 when the maximum value of upsAlarmId would otherwise be exceeded. Consequently, after multiple operations, the table may become sparse, e.g., containing entries for rows 95, 100, 101, and 203 and the entries should not be assumed to be in chronological order because upsAlarmId might have wrapped. Alarms are named by an AutonomousType (OBJECT IDENTIFIER), upsAlarmDescr, to allow a single table to reflect well known alarms plus alarms defined by a particular implementation, i.e., as documented in the private enterprise MIB definition for the device. No two rows will have the same value of upsAlarmDescr, since alarms define conditions. In order to meet this requirement, care should be taken in the definition of alarm conditions to insure that a system cannot enter the same condition multiple times simultaneously. The number of rows in the table at any given time is reflected by the value of upsAlarmsPresent."
upsAlarmEntry,1.3.6.1.2.1.33.1.6.2.1,,no-access,objecttype,row,"An entry containing information applicable to a particular alarm."
upsAlarmId,1.3.6.1.2.1.33.1.6.2.1.1,positiveinteger,no-access,objecttype,column,"A unique identifier for an alarm condition. This value must remain constant."
upsAlarmDescr,1.3.6.1.2.1.33.1.6.2.1.2,autonomoustype,read-only,objecttype,column,"A reference to an alarm description object. The object referenced should not be accessible, but rather be used to provide a unique description of the alarm condition."
upsAlarmTime,1.3.6.1.2.1.33.1.6.2.1.3,timestamp,read-only,objecttype,column,"The value of sysUpTime when the alarm condition was detected. If the alarm condition was detected at the time of agent startup and presumably existed before agent startup, the value of upsAlarmTime shall equal 0."
upsWellKnownAlarms,1.3.6.1.2.1.33.1.6.3,,,objectidentity,,""
upsAlarmBatteryBad,1.3.6.1.2.1.33.1.6.3.1,,,objectidentity,,"One or more batteries have been determined to require replacement."
upsAlarmOnBattery,1.3.6.1.2.1.33.1.6.3.2,,,objectidentity,,"The UPS is drawing power from the batteries."
upsAlarmLowBattery,1.3.6.1.2.1.33.1.6.3.3,,,objectidentity,,"The remaining battery run-time is less than or equal to upsConfigLowBattTime."
upsAlarmDepletedBattery,1.3.6.1.2.1.33.1.6.3.4,,,objectidentity,,"The UPS will be unable to sustain the present load when and if the utility power is lost."
upsAlarmTempBad,1.3.6.1.2.1.33.1.6.3.5,,,objectidentity,,"A temperature is out of tolerance."
upsAlarmInputBad,1.3.6.1.2.1.33.1.6.3.6,,,objectidentity,,"An input condition is out of tolerance."
upsAlarmOutputBad,1.3.6.1.2.1.33.1.6.3.7,,,objectidentity,,"An output condition (other than OutputOverload) is out of tolerance."
upsAlarmOutputOverload,1.3.6.1.2.1.33.1.6.3.8,,,objectidentity,,"The output load exceeds the UPS output capacity."
upsAlarmOnBypass,1.3.6.1.2.1.33.1.6.3.9,,,objectidentity,,"The Bypass is presently engaged on the UPS."
upsAlarmBypassBad,1.3.6.1.2.1.33.1.6.3.10,,,objectidentity,,"The Bypass is out of tolerance."
upsAlarmOutputOffAsRequested,1.3.6.1.2.1.33.1.6.3.11,,,objectidentity,,"The UPS has shutdown as requested, i.e., the output is off."
upsAlarmUpsOffAsRequested,1.3.6.1.2.1.33.1.6.3.12,,,objectidentity,,"The entire UPS has shutdown as commanded."
upsAlarmChargerFailed,1.3.6.1.2.1.33.1.6.3.13,,,objectidentity,,"An uncorrected problem has been detected within the UPS charger subsystem."
upsAlarmUpsOutputOff,1.3.6.1.2.1.33.1.6.3.14,,,objectidentity,,"The output of the UPS is in the off state."
upsAlarmUpsSystemOff,1.3.6.1.2.1.33.1.6.3.15,,,objectidentity,,"The UPS system is in the off state."
upsAlarmFanFailure,1.3.6.1.2.1.33.1.6.3.16,,,objectidentity,,"The failure of one or more fans in the UPS has been detected."
upsAlarmFuseFailure,1.3.6.1.2.1.33.1.6.3.17,,,objectidentity,,"The failure of one or more fuses has been detected."
upsAlarmGeneralFault,1.3.6.1.2.1.33.1.6.3.18,,,objectidentity,,"A general fault in the UPS has been detected."
upsAlarmDiagnosticTestFailed,1.3.6.1.2.1.33.1.6.3.19,,,objectidentity,,"The result of the last diagnostic test indicates a failure."
upsAlarmCommunicationsLost,1.3.6.1.2.1.33.1.6.3.20,,,objectidentity,,"A problem has been encountered in the communications between the agent and the UPS."
upsAlarmAwaitingPower,1.3.6.1.2.1.33.1.6.3.21,,,objectidentity,,"The UPS output is off and the UPS is awaiting the return of input power."
upsAlarmShutdownPending,1.3.6.1.2.1.33.1.6.3.22,,,objectidentity,,"A upsShutdownAfterDelay countdown is underway."
upsAlarmShutdownImminent,1.3.6.1.2.1.33.1.6.3.23,,,objectidentity,,"The UPS will turn off power to the load in less than 5 seconds; this may be either a timed shutdown or a low battery shutdown."
upsAlarmTestInProgress,1.3.6.1.2.1.33.1.6.3.24,,,objectidentity,,"A test is in progress, as initiated and indicated by the Test Group. Tests initiated via other implementation-specific mechanisms can indicate the presence of the testing in the alarm table, if desired, via a OBJECT-IDENTITY macro in the MIB document specific to that implementation and are outside the scope of this OBJECT-IDENTITY."
upsTest,1.3.6.1.2.1.33.1.7,,,objectidentity,,""
upsTestId,1.3.6.1.2.1.33.1.7.1,object identifier,read-write,objecttype,scalar,"The test is named by an OBJECT IDENTIFIER which allows a standard mechanism for the initiation of tests, including the well known tests identified in this document as well as those introduced by a particular implementation, i.e., as documented in the private enterprise MIB definition for the device. Setting this variable initiates the named test. Sets to this variable require the presence of upsTestSpinLock in the same SNMP message. The set request will be rejected with an appropriate error message if the requested test cannot be performed, including attempts to start a test when another test is already in progress. The status of the current or last test is maintained in upsTestResultsSummary. Tests in progress may be aborted by setting the upsTestId variable to upsTestAbortTestInProgress. Read operations return the value of the name of the test in progress if a test is in progress or the name of the last test performed if no test is in progress, unless no test has been run, in which case the well known value upsTestNoTestsInitiated is returned."
upsTestSpinLock,1.3.6.1.2.1.33.1.7.2,testandincr,read-write,objecttype,scalar,"A spin lock on the test subsystem. The spinlock is used as follows. Before starting a test, a manager-station should make sure that a test is not in progress as follows: try_again: get (upsTestSpinLock) while (upsTestResultsSummary == inProgress) { /* loop while a test is running for another manager */ short delay get (upsTestSpinLock) } lock_value = upsTestSpinLock /* no test in progress, start the test */ set (upsTestSpinLock = lock_value, upsTestId = requested_test) if (error_index == 1) { /* (upsTestSpinLock failed) */ /* if problem is not access control, then some other manager slipped in ahead of us */ goto try_again } if (error_index == 2) { /* (upsTestId) */ /* cannot perform the test */ give up } /* test started ok */ /* wait for test completion by polling upsTestResultsSummary */ get (upsTestSpinLock, upsTestResultsSummary, upsTestResultsDetail) while (upsTestResultsSummary == inProgress) { short delay get (upsTestSpinLock, upsTestResultsSummary, upsTestResultsDetail) } /* when test completes, retrieve any additional test results */ /* if upsTestSpinLock == lock_value + 1, then these are our test */ /* results (as opposed to another manager's */ The initial value of upsTestSpinLock at agent initialization shall be 1."
upsTestResultsSummary,1.3.6.1.2.1.33.1.7.3,integer,read-only,objecttype,scalar,"The results of the current or last UPS diagnostics test performed. The values for donePass(1), doneWarning(2), and doneError(3) indicate that the test completed either successfully, with a warning, or with an error, respectively. The value aborted(4) is returned for tests which are aborted by setting the value of upsTestId to upsTestAbortTestInProgress. Tests which have not yet concluded are indicated by inProgress(5). The value noTestsInitiated(6) indicates that no previous test results are available, such as is the case when no tests have been run since the last reinitialization of the network management subsystem and the system has no provision for non- volatile storage of test results. Enumeration: 'doneError': 3, 'noTestsInitiated': 6, 'donePass': 1, 'doneWarning': 2, 'aborted': 4, 'inProgress': 5."
upsTestResultsDetail,1.3.6.1.2.1.33.1.7.4,displaystring,read-only,objecttype,scalar,"Additional information about upsTestResultsSummary. If no additional information available, a zero length string is returned."
upsTestStartTime,1.3.6.1.2.1.33.1.7.5,timestamp,read-only,objecttype,scalar,"The value of sysUpTime at the time the test in progress was initiated, or, if no test is in progress, the time the previous test was initiated. If the value of upsTestResultsSummary is noTestsInitiated(6), upsTestStartTime has the value 0."
upsTestElapsedTime,1.3.6.1.2.1.33.1.7.6,timeinterval,read-only,objecttype,scalar,"The amount of time, in TimeTicks, since the test in progress was initiated, or, if no test is in progress, the previous test took to complete. If the value of upsTestResultsSummary is noTestsInitiated(6), upsTestElapsedTime has the value 0."
upsWellKnownTests,1.3.6.1.2.1.33.1.7.7,,,objectidentity,,""
upsTestNoTestsInitiated,1.3.6.1.2.1.33.1.7.7.1,,,objectidentity,,"No tests have been initiated and no test is in progress."
upsTestAbortTestInProgress,1.3.6.1.2.1.33.1.7.7.2,,,objectidentity,,"The test in progress is to be aborted / the test in progress was aborted."
upsTestGeneralSystemsTest,1.3.6.1.2.1.33.1.7.7.3,,,objectidentity,,"The manufacturer's standard test of UPS device systems."
upsTestQuickBatteryTest,1.3.6.1.2.1.33.1.7.7.4,,,objectidentity,,"A test that is sufficient to determine if the battery needs replacement."
upsTestDeepBatteryCalibration,1.3.6.1.2.1.33.1.7.7.5,,,objectidentity,,"The system is placed on battery to a discharge level, set by the manufacturer, sufficient to determine battery replacement and battery run-time with a high degree of confidence. WARNING: this test will leave the battery in a low charge state and will require time for recharging to a level sufficient to provide normal battery duration for the protected load."
upsControl,1.3.6.1.2.1.33.1.8,,,objectidentity,,""
upsShutdownType,1.3.6.1.2.1.33.1.8.1,integer,read-write,objecttype,scalar,"This object determines the nature of the action to be taken at the time when the countdown of the upsShutdownAfterDelay and upsRebootWithDuration objects reaches zero. Setting this object to output(1) indicates that shutdown requests should cause only the output of the UPS to turn off. Setting this object to system(2) indicates that shutdown requests will cause the entire UPS system to turn off. Enumeration: 'output': 1, 'system': 2."
upsShutdownAfterDelay,1.3.6.1.2.1.33.1.8.2,integer,read-write,objecttype,scalar,"Setting this object will shutdown (i.e., turn off) either the UPS output or the UPS system (as determined by the value of upsShutdownType at the time of shutdown) after the indicated number of seconds, or less if the UPS batteries become depleted. Setting this object to 0 will cause the shutdown to occur immediately. Setting this object to -1 will abort the countdown. If the system is already in the desired state at the time the countdown reaches 0, then nothing will happen. That is, there is no additional action at that time if upsShutdownType = system and the system is already off. Similarly, there is no additional action at that time if upsShutdownType = output and the output is already off. When read, upsShutdownAfterDelay will return the number of seconds remaining until shutdown, or -1 if no shutdown countdown is in effect. On some systems, if the agent is restarted while a shutdown countdown is in effect, the countdown may be aborted. Sets to this object override any upsShutdownAfterDelay already in effect."
upsStartupAfterDelay,1.3.6.1.2.1.33.1.8.3,integer,read-write,objecttype,scalar,"Setting this object will start the output after the indicated number of seconds, including starting the UPS, if necessary. Setting this object to 0 will cause the startup to occur immediately. Setting this object to -1 will abort the countdown. If the output is already on at the time the countdown reaches 0, then nothing will happen. Sets to this object override the effect of any upsStartupAfterDelay countdown or upsRebootWithDuration countdown in progress. When read, upsStartupAfterDelay will return the number of seconds until startup, or -1 if no startup countdown is in effect. If the countdown expires during a utility failure, the startup shall not occur until the utility power is restored. On some systems, if the agent is restarted while a startup countdown is in effect, the countdown is aborted."
upsRebootWithDuration,1.3.6.1.2.1.33.1.8.4,integer,read-write,objecttype,scalar,"Setting this object will immediately shutdown (i.e., turn off) either the UPS output or the UPS system (as determined by the value of upsShutdownType at the time of shutdown) for a period equal to the indicated number of seconds, after which time the output will be started, including starting the UPS, if necessary. If the number of seconds required to perform the request is greater than the requested duration, then the requested shutdown and startup cycle shall be performed in the minimum time possible, but in no case shall this require more than the requested duration plus 60 seconds. When read, upsRebootWithDuration shall return the number of seconds remaining in the countdown, or -1 if no countdown is in progress. If the startup should occur during a utility failure, the startup shall not occur until the utility power is restored."
upsAutoRestart,1.3.6.1.2.1.33.1.8.5,integer,read-write,objecttype,scalar,"Setting this object to 'on' will cause the UPS system to restart after a shutdown if the shutdown occurred during a power loss as a result of either a upsShutdownAfterDelay or an internal battery depleted condition. Setting this object to 'off' will prevent the UPS system from restarting after a shutdown until an operator manually or remotely explicitly restarts it. If the UPS is in a startup or reboot countdown, then the UPS will not restart until that delay has been satisfied. Enumeration: 'on': 1, 'off': 2."
upsConfig,1.3.6.1.2.1.33.1.9,,,objectidentity,,""
upsConfigInputVoltage,1.3.6.1.2.1.33.1.9.1,nonnegativeinteger,read-write,objecttype,scalar,"The magnitude of the nominal input voltage. On those systems which support read-write access to this object, if there is an attempt to set this variable to a value that is not supported, the request must be rejected and the agent shall respond with an appropriate error message, i.e., badValue for SNMPv1, or inconsistentValue for SNMPv2."
upsConfigInputFreq,1.3.6.1.2.1.33.1.9.2,nonnegativeinteger,read-write,objecttype,scalar,"The nominal input frequency. On those systems which support read-write access to this object, if there is an attempt to set this variable to a value that is not supported, the request must be rejected and the agent shall respond with an appropriate error message, i.e., badValue for SNMPv1, or inconsistentValue for SNMPv2."
upsConfigOutputVoltage,1.3.6.1.2.1.33.1.9.3,nonnegativeinteger,read-write,objecttype,scalar,"The magnitude of the nominal output voltage. On those systems which support read-write access to this object, if there is an attempt to set this variable to a value that is not supported, the request must be rejected and the agent shall respond with an appropriate error message, i.e., badValue for SNMPv1, or inconsistentValue for SNMPv2."
upsConfigOutputFreq,1.3.6.1.2.1.33.1.9.4,nonnegativeinteger,read-write,objecttype,scalar,"The nominal output frequency. On those systems which support read-write access to this object, if there is an attempt to set this variable to a value that is not supported, the request must be rejected and the agent shall respond with an appropriate error message, i.e., badValue for SNMPv1, or inconsistentValue for SNMPv2."
upsConfigOutputVA,1.3.6.1.2.1.33.1.9.5,nonnegativeinteger,read-only,objecttype,scalar,"The magnitude of the nominal Volt-Amp rating."
upsConfigOutputPower,1.3.6.1.2.1.33.1.9.6,nonnegativeinteger,read-only,objecttype,scalar,"The magnitude of the nominal true power rating."
upsConfigLowBattTime,1.3.6.1.2.1.33.1.9.7,nonnegativeinteger,read-write,objecttype,scalar,"The value of upsEstimatedMinutesRemaining at which a lowBattery condition is declared. For agents which support only discrete (discontinuous) values, then the agent shall round up to the next supported value. If the requested value is larger than the largest supported value, then the largest supported value shall be selected."
upsConfigAudibleStatus,1.3.6.1.2.1.33.1.9.8,integer,read-write,objecttype,scalar,"The requested state of the audible alarm. When in the disabled state, the audible alarm should never sound. The enabled state is self-describing. Setting this object to muted(3) when the audible alarm is sounding shall temporarily silence the alarm. It will remain muted until it would normally stop sounding and the value returned for read operations during this period shall equal muted(3). At the end of this period, the value shall revert to enabled(2). Writes of the value muted(3) when the audible alarm is not sounding shall be accepted but otherwise shall have no effect. Enumeration: 'disabled': 1, 'muted': 3, 'enabled': 2."
upsConfigLowVoltageTransferPoint,1.3.6.1.2.1.33.1.9.9,nonnegativeinteger,read-write,objecttype,scalar,"The minimum input line voltage allowed before the UPS system transfers to battery backup."
upsConfigHighVoltageTransferPoint,1.3.6.1.2.1.33.1.9.10,nonnegativeinteger,read-write,objecttype,scalar,"The maximum line voltage allowed before the UPS system transfers to battery backup."
upsTraps,1.3.6.1.2.1.33.2,,,objectidentity,,""
upsTrapOnBattery,1.3.6.1.2.1.33.2.1,,,notificationtype,,"The UPS is operating on battery power. This trap is persistent and is resent at one minute intervals until the UPS either turns off or is no longer running on battery."
upsTrapTestCompleted,1.3.6.1.2.1.33.2.2,,,notificationtype,,"This trap is sent upon completion of a UPS diagnostic test."
upsTrapAlarmEntryAdded,1.3.6.1.2.1.33.2.3,,,notificationtype,,"This trap is sent each time an alarm is inserted into to the alarm table. It is sent on the insertion of all alarms except for upsAlarmOnBattery and upsAlarmTestInProgress."
upsTrapAlarmEntryRemoved,1.3.6.1.2.1.33.2.4,,,notificationtype,,"This trap is sent each time an alarm is removed from the alarm table. It is sent on the removal of all alarms except for upsAlarmTestInProgress."
upsConformance,1.3.6.1.2.1.33.3,,,objectidentity,,""
upsCompliances,1.3.6.1.2.1.33.3.1,,,objectidentity,,""
upsSubsetCompliance,1.3.6.1.2.1.33.3.1.1,,,modulecompliance,,"The compliance statement for UPSs that only support the two-contact communication protocol."
upsBasicCompliance,1.3.6.1.2.1.33.3.1.2,,,modulecompliance,,"The compliance statement for UPSs that support full-featured functions, such as control."
upsFullCompliance,1.3.6.1.2.1.33.3.1.3,,,modulecompliance,,"The compliance statement for UPSs that support advanced full-featured functions."
upsGroups,1.3.6.1.2.1.33.3.2,,,objectidentity,,""
upsSubsetGroups,1.3.6.1.2.1.33.3.2.1,,,objectidentity,,""
upsSubsetIdentGroup,1.3.6.1.2.1.33.3.2.1.1,,,objectgroup,,"The upsSubsetIdentGroup defines objects which are common across all UPSs which meet subset compliance. Most devices which conform to the upsSubsetIdentGroup will provide access to these objects via a proxy agent. If the proxy agent is compatible with multiple UPS types, configuration of the proxy agent will require specifying some of these values, either individually, or as a group (perhaps through a table lookup mechanism based on the UPS model number)."
upsSubsetBatteryGroup,1.3.6.1.2.1.33.3.2.1.2,,,objectgroup,,"The upsSubsetBatteryGroup defines the objects that are common to battery groups of two-contact UPSs."
upsSubsetInputGroup,1.3.6.1.2.1.33.3.2.1.3,,,objectgroup,,"The upsSubsetInputGroup defines the objects that are common to the Input groups of two-contact UPSs."
upsSubsetOutputGroup,1.3.6.1.2.1.33.3.2.1.4,,,objectgroup,,"The upsSubsetOutputGroup defines the objects that are common to the Output groups of two-contact UPSs."
upsSubsetAlarmGroup,1.3.6.1.2.1.33.3.2.1.6,,,objectgroup,,"The upsSubsetAlarmGroup defines the objects that are common to the Alarm groups of two-contact UPSs."
upsSubsetControlGroup,1.3.6.1.2.1.33.3.2.1.8,,,objectgroup,,"The upsSubsetControlGroup defines the objects that are common to the Control groups of two-contact UPSs."
upsSubsetConfigGroup,1.3.6.1.2.1.33.3.2.1.9,,,objectgroup,,"The upsSubsetConfigGroup defines the objects that are common to the Config groups of two-contact UPSs."
upsBasicGroups,1.3.6.1.2.1.33.3.2.2,,,objectidentity,,""
upsBasicIdentGroup,1.3.6.1.2.1.33.3.2.2.1,,,objectgroup,,"The upsBasicIdentGroup defines objects which are common to the Ident group of compliant UPSs which support basic functions."
upsBasicBatteryGroup,1.3.6.1.2.1.33.3.2.2.2,,,objectgroup,,"The upsBasicBatteryGroup defines the objects that are common to the battery groups of compliant UPSs which support basic functions."
upsBasicInputGroup,1.3.6.1.2.1.33.3.2.2.3,,,objectgroup,,"The upsBasicInputGroup defines the objects that are common to the Input groups of compliant UPSs which support basic functions."
upsBasicOutputGroup,1.3.6.1.2.1.33.3.2.2.4,,,objectgroup,,"The upsBasicOutputGroup defines the objects that are common to the Output groups of compliant UPSs which support basic functions."
upsBasicBypassGroup,1.3.6.1.2.1.33.3.2.2.5,,,objectgroup,,"The upsBasicBypassGroup defines the objects that are common to the Bypass groups of compliant UPSs which support basic functions."
upsBasicAlarmGroup,1.3.6.1.2.1.33.3.2.2.6,,,objectgroup,,"The upsBasicAlarmGroup defines the objects that are common to the Alarm groups of compliant UPSs which support basic functions."
upsBasicTestGroup,1.3.6.1.2.1.33.3.2.2.7,,,objectgroup,,"The upsBasicTestGroup defines the objects that are common to the Test groups of compliant UPSs which support basic functions."
upsBasicControlGroup,1.3.6.1.2.1.33.3.2.2.8,,,objectgroup,,"The upsBasicControlGroup defines the objects that are common to the Control groups of compliant UPSs which support basic functions."
upsBasicConfigGroup,1.3.6.1.2.1.33.3.2.2.9,,,objectgroup,,"The upsBasicConfigGroup defines the objects that are common to the Config groups of UPSs which support basic functions."
upsFullGroups,1.3.6.1.2.1.33.3.2.3,,,objectidentity,,""
upsFullIdentGroup,1.3.6.1.2.1.33.3.2.3.1,,,objectgroup,,"The upsFullIdentGroup defines objects which are common to the Ident group of fully compliant UPSs."
upsFullBatteryGroup,1.3.6.1.2.1.33.3.2.3.2,,,objectgroup,,"The upsFullBatteryGroup defines the objects that are common to the battery groups of fully compliant UPSs."
upsFullInputGroup,1.3.6.1.2.1.33.3.2.3.3,,,objectgroup,,"The upsFullInputGroup defines the objects that are common to the Input groups of fully compliant UPSs."
upsFullOutputGroup,1.3.6.1.2.1.33.3.2.3.4,,,objectgroup,,"The upsFullOutputGroup defines the objects that are common to the Output groups of fully compliant UPSs."
upsFullBypassGroup,1.3.6.1.2.1.33.3.2.3.5,,,objectgroup,,"The upsFullBypassGroup defines the objects that are common to the Bypass groups of fully compliant UPSs."
upsFullAlarmGroup,1.3.6.1.2.1.33.3.2.3.6,,,objectgroup,,"The upsFullAlarmGroup defines the objects that are common to the Alarm groups of fully compliant UPSs."
upsFullTestGroup,1.3.6.1.2.1.33.3.2.3.7,,,objectgroup,,"The upsFullTestGroup defines the objects that are common to the Test groups of fully compliant UPSs."
upsFullControlGroup,1.3.6.1.2.1.33.3.2.3.8,,,objectgroup,,"The upsFullControlGroup defines the objects that are common to the Control groups of fully compliant UPSs."
upsFullConfigGroup,1.3.6.1.2.1.33.3.2.3.9,,,objectgroup,,"The upsFullConfigGroup defines the objects that are common to the Config groups of fully compliant UPSs."
1 OBJECT_NAME OBJECT_IDENTIFIER OBJECT_DATA_TYPE OBJECT_PREMISSIONS OBJECT_CLASS OBJECT_NODE_TYPE OBJECT_DESCRIPTION
2 upsMIB 1.3.6.1.2.1.33 moduleidentity The MIB module to describe Uninterruptible Power Supplies.
3 upsObjects 1.3.6.1.2.1.33.1 objectidentity
4 upsIdent 1.3.6.1.2.1.33.1.1 objectidentity
5 upsIdentManufacturer 1.3.6.1.2.1.33.1.1.1 displaystring read-only objecttype scalar The name of the UPS manufacturer.
6 upsIdentModel 1.3.6.1.2.1.33.1.1.2 displaystring read-only objecttype scalar The UPS Model designation.
7 upsIdentUPSSoftwareVersion 1.3.6.1.2.1.33.1.1.3 displaystring read-only objecttype scalar The UPS firmware/software version(s). This variable may or may not have the same value as upsIdentAgentSoftwareVersion in some implementations.
8 upsIdentAgentSoftwareVersion 1.3.6.1.2.1.33.1.1.4 displaystring read-only objecttype scalar The UPS agent software version. This variable may or may not have the same value as upsIdentUPSSoftwareVersion in some implementations.
9 upsIdentName 1.3.6.1.2.1.33.1.1.5 displaystring read-write objecttype scalar A string identifying the UPS. This object should be set by the administrator.
10 upsIdentAttachedDevices 1.3.6.1.2.1.33.1.1.6 displaystring read-write objecttype scalar A string identifying the devices attached to the output(s) of the UPS. This object should be set by the administrator.
11 upsBattery 1.3.6.1.2.1.33.1.2 objectidentity
12 upsBatteryStatus 1.3.6.1.2.1.33.1.2.1 integer read-only objecttype scalar The indication of the capacity remaining in the UPS system's batteries. A value of batteryNormal indicates that the remaining run-time is greater than upsConfigLowBattTime. A value of batteryLow indicates that the remaining battery run-time is less than or equal to upsConfigLowBattTime. A value of batteryDepleted indicates that the UPS will be unable to sustain the present load when and if the utility power is lost (including the possibility that the utility power is currently absent and the UPS is unable to sustain the output). Enumeration: 'unknown': 1, 'batteryNormal': 2, 'batteryDepleted': 4, 'batteryLow': 3.
13 upsSecondsOnBattery 1.3.6.1.2.1.33.1.2.2 nonnegativeinteger read-only objecttype scalar If the unit is on battery power, the elapsed time since the UPS last switched to battery power, or the time since the network management subsystem was last restarted, whichever is less. Zero shall be returned if the unit is not on battery power.
14 upsEstimatedMinutesRemaining 1.3.6.1.2.1.33.1.2.3 positiveinteger read-only objecttype scalar An estimate of the time to battery charge depletion under the present load conditions if the utility power is off and remains off, or if it were to be lost and remain off.
15 upsEstimatedChargeRemaining 1.3.6.1.2.1.33.1.2.4 integer read-only objecttype scalar An estimate of the battery charge remaining expressed as a percent of full charge.
16 upsBatteryVoltage 1.3.6.1.2.1.33.1.2.5 nonnegativeinteger read-only objecttype scalar The magnitude of the present battery voltage.
17 upsBatteryCurrent 1.3.6.1.2.1.33.1.2.6 integer32 read-only objecttype scalar The present battery current.
18 upsBatteryTemperature 1.3.6.1.2.1.33.1.2.7 integer32 read-only objecttype scalar The ambient temperature at or near the UPS Battery casing.
19 upsInput 1.3.6.1.2.1.33.1.3 objectidentity
20 upsInputLineBads 1.3.6.1.2.1.33.1.3.1 counter32 read-only objecttype scalar A count of the number of times the input entered an out-of-tolerance condition as defined by the manufacturer. This count is incremented by one each time the input transitions from zero out-of-tolerance lines to one or more input lines out-of-tolerance.
21 upsInputNumLines 1.3.6.1.2.1.33.1.3.2 nonnegativeinteger read-only objecttype scalar The number of input lines utilized in this device. This variable indicates the number of rows in the input table.
22 upsInputTable 1.3.6.1.2.1.33.1.3.3 no-access objecttype table A list of input table entries. The number of entries is given by the value of upsInputNumLines.
23 upsInputEntry 1.3.6.1.2.1.33.1.3.3.1 no-access objecttype row An entry containing information applicable to a particular input line.
24 upsInputLineIndex 1.3.6.1.2.1.33.1.3.3.1.1 positiveinteger no-access objecttype column The input line identifier.
25 upsInputFrequency 1.3.6.1.2.1.33.1.3.3.1.2 nonnegativeinteger read-only objecttype column The present input frequency.
26 upsInputVoltage 1.3.6.1.2.1.33.1.3.3.1.3 nonnegativeinteger read-only objecttype column The magnitude of the present input voltage.
27 upsInputCurrent 1.3.6.1.2.1.33.1.3.3.1.4 nonnegativeinteger read-only objecttype column The magnitude of the present input current.
28 upsInputTruePower 1.3.6.1.2.1.33.1.3.3.1.5 nonnegativeinteger read-only objecttype column The magnitude of the present input true power.
29 upsOutput 1.3.6.1.2.1.33.1.4 objectidentity
30 upsOutputSource 1.3.6.1.2.1.33.1.4.1 integer read-only objecttype scalar The present source of output power. The enumeration none(2) indicates that there is no source of output power (and therefore no output power), for example, the system has opened the output breaker. Enumeration: 'none': 2, 'normal': 3, 'battery': 5, 'reducer': 7, 'other': 1, 'bypass': 4, 'booster': 6.
31 upsOutputFrequency 1.3.6.1.2.1.33.1.4.2 nonnegativeinteger read-only objecttype scalar The present output frequency.
32 upsOutputNumLines 1.3.6.1.2.1.33.1.4.3 nonnegativeinteger read-only objecttype scalar The number of output lines utilized in this device. This variable indicates the number of rows in the output table.
33 upsOutputTable 1.3.6.1.2.1.33.1.4.4 no-access objecttype table A list of output table entries. The number of entries is given by the value of upsOutputNumLines.
34 upsOutputEntry 1.3.6.1.2.1.33.1.4.4.1 no-access objecttype row An entry containing information applicable to a particular output line.
35 upsOutputLineIndex 1.3.6.1.2.1.33.1.4.4.1.1 positiveinteger no-access objecttype column The output line identifier.
36 upsOutputVoltage 1.3.6.1.2.1.33.1.4.4.1.2 nonnegativeinteger read-only objecttype column The present output voltage.
37 upsOutputCurrent 1.3.6.1.2.1.33.1.4.4.1.3 nonnegativeinteger read-only objecttype column The present output current.
38 upsOutputPower 1.3.6.1.2.1.33.1.4.4.1.4 nonnegativeinteger read-only objecttype column The present output true power.
39 upsOutputPercentLoad 1.3.6.1.2.1.33.1.4.4.1.5 integer read-only objecttype column The percentage of the UPS power capacity presently being used on this output line, i.e., the greater of the percent load of true power capacity and the percent load of VA.
40 upsBypass 1.3.6.1.2.1.33.1.5 objectidentity
41 upsBypassFrequency 1.3.6.1.2.1.33.1.5.1 nonnegativeinteger read-only objecttype scalar The present bypass frequency.
42 upsBypassNumLines 1.3.6.1.2.1.33.1.5.2 nonnegativeinteger read-only objecttype scalar The number of bypass lines utilized in this device. This entry indicates the number of rows in the bypass table.
43 upsBypassTable 1.3.6.1.2.1.33.1.5.3 no-access objecttype table A list of bypass table entries. The number of entries is given by the value of upsBypassNumLines.
44 upsBypassEntry 1.3.6.1.2.1.33.1.5.3.1 no-access objecttype row An entry containing information applicable to a particular bypass input.
45 upsBypassLineIndex 1.3.6.1.2.1.33.1.5.3.1.1 positiveinteger no-access objecttype column The bypass line identifier.
46 upsBypassVoltage 1.3.6.1.2.1.33.1.5.3.1.2 nonnegativeinteger read-only objecttype column The present bypass voltage.
47 upsBypassCurrent 1.3.6.1.2.1.33.1.5.3.1.3 nonnegativeinteger read-only objecttype column The present bypass current.
48 upsBypassPower 1.3.6.1.2.1.33.1.5.3.1.4 nonnegativeinteger read-only objecttype column The present true power conveyed by the bypass.
49 upsAlarm 1.3.6.1.2.1.33.1.6 objectidentity
50 upsAlarmsPresent 1.3.6.1.2.1.33.1.6.1 gauge32 read-only objecttype scalar The present number of active alarm conditions.
51 upsAlarmTable 1.3.6.1.2.1.33.1.6.2 no-access objecttype table A list of alarm table entries. The table contains zero, one, or many rows at any moment, depending upon the number of alarm conditions in effect. The table is initially empty at agent startup. The agent creates a row in the table each time a condition is detected and deletes that row when that condition no longer pertains. The agent creates the first row with upsAlarmId equal to 1, and increments the value of upsAlarmId each time a new row is created, wrapping to the first free value greater than or equal to 1 when the maximum value of upsAlarmId would otherwise be exceeded. Consequently, after multiple operations, the table may become sparse, e.g., containing entries for rows 95, 100, 101, and 203 and the entries should not be assumed to be in chronological order because upsAlarmId might have wrapped. Alarms are named by an AutonomousType (OBJECT IDENTIFIER), upsAlarmDescr, to allow a single table to reflect well known alarms plus alarms defined by a particular implementation, i.e., as documented in the private enterprise MIB definition for the device. No two rows will have the same value of upsAlarmDescr, since alarms define conditions. In order to meet this requirement, care should be taken in the definition of alarm conditions to insure that a system cannot enter the same condition multiple times simultaneously. The number of rows in the table at any given time is reflected by the value of upsAlarmsPresent.
52 upsAlarmEntry 1.3.6.1.2.1.33.1.6.2.1 no-access objecttype row An entry containing information applicable to a particular alarm.
53 upsAlarmId 1.3.6.1.2.1.33.1.6.2.1.1 positiveinteger no-access objecttype column A unique identifier for an alarm condition. This value must remain constant.
54 upsAlarmDescr 1.3.6.1.2.1.33.1.6.2.1.2 autonomoustype read-only objecttype column A reference to an alarm description object. The object referenced should not be accessible, but rather be used to provide a unique description of the alarm condition.
55 upsAlarmTime 1.3.6.1.2.1.33.1.6.2.1.3 timestamp read-only objecttype column The value of sysUpTime when the alarm condition was detected. If the alarm condition was detected at the time of agent startup and presumably existed before agent startup, the value of upsAlarmTime shall equal 0.
56 upsWellKnownAlarms 1.3.6.1.2.1.33.1.6.3 objectidentity
57 upsAlarmBatteryBad 1.3.6.1.2.1.33.1.6.3.1 objectidentity One or more batteries have been determined to require replacement.
58 upsAlarmOnBattery 1.3.6.1.2.1.33.1.6.3.2 objectidentity The UPS is drawing power from the batteries.
59 upsAlarmLowBattery 1.3.6.1.2.1.33.1.6.3.3 objectidentity The remaining battery run-time is less than or equal to upsConfigLowBattTime.
60 upsAlarmDepletedBattery 1.3.6.1.2.1.33.1.6.3.4 objectidentity The UPS will be unable to sustain the present load when and if the utility power is lost.
61 upsAlarmTempBad 1.3.6.1.2.1.33.1.6.3.5 objectidentity A temperature is out of tolerance.
62 upsAlarmInputBad 1.3.6.1.2.1.33.1.6.3.6 objectidentity An input condition is out of tolerance.
63 upsAlarmOutputBad 1.3.6.1.2.1.33.1.6.3.7 objectidentity An output condition (other than OutputOverload) is out of tolerance.
64 upsAlarmOutputOverload 1.3.6.1.2.1.33.1.6.3.8 objectidentity The output load exceeds the UPS output capacity.
65 upsAlarmOnBypass 1.3.6.1.2.1.33.1.6.3.9 objectidentity The Bypass is presently engaged on the UPS.
66 upsAlarmBypassBad 1.3.6.1.2.1.33.1.6.3.10 objectidentity The Bypass is out of tolerance.
67 upsAlarmOutputOffAsRequested 1.3.6.1.2.1.33.1.6.3.11 objectidentity The UPS has shutdown as requested, i.e., the output is off.
68 upsAlarmUpsOffAsRequested 1.3.6.1.2.1.33.1.6.3.12 objectidentity The entire UPS has shutdown as commanded.
69 upsAlarmChargerFailed 1.3.6.1.2.1.33.1.6.3.13 objectidentity An uncorrected problem has been detected within the UPS charger subsystem.
70 upsAlarmUpsOutputOff 1.3.6.1.2.1.33.1.6.3.14 objectidentity The output of the UPS is in the off state.
71 upsAlarmUpsSystemOff 1.3.6.1.2.1.33.1.6.3.15 objectidentity The UPS system is in the off state.
72 upsAlarmFanFailure 1.3.6.1.2.1.33.1.6.3.16 objectidentity The failure of one or more fans in the UPS has been detected.
73 upsAlarmFuseFailure 1.3.6.1.2.1.33.1.6.3.17 objectidentity The failure of one or more fuses has been detected.
74 upsAlarmGeneralFault 1.3.6.1.2.1.33.1.6.3.18 objectidentity A general fault in the UPS has been detected.
75 upsAlarmDiagnosticTestFailed 1.3.6.1.2.1.33.1.6.3.19 objectidentity The result of the last diagnostic test indicates a failure.
76 upsAlarmCommunicationsLost 1.3.6.1.2.1.33.1.6.3.20 objectidentity A problem has been encountered in the communications between the agent and the UPS.
77 upsAlarmAwaitingPower 1.3.6.1.2.1.33.1.6.3.21 objectidentity The UPS output is off and the UPS is awaiting the return of input power.
78 upsAlarmShutdownPending 1.3.6.1.2.1.33.1.6.3.22 objectidentity A upsShutdownAfterDelay countdown is underway.
79 upsAlarmShutdownImminent 1.3.6.1.2.1.33.1.6.3.23 objectidentity The UPS will turn off power to the load in less than 5 seconds; this may be either a timed shutdown or a low battery shutdown.
80 upsAlarmTestInProgress 1.3.6.1.2.1.33.1.6.3.24 objectidentity A test is in progress, as initiated and indicated by the Test Group. Tests initiated via other implementation-specific mechanisms can indicate the presence of the testing in the alarm table, if desired, via a OBJECT-IDENTITY macro in the MIB document specific to that implementation and are outside the scope of this OBJECT-IDENTITY.
81 upsTest 1.3.6.1.2.1.33.1.7 objectidentity
82 upsTestId 1.3.6.1.2.1.33.1.7.1 object identifier read-write objecttype scalar The test is named by an OBJECT IDENTIFIER which allows a standard mechanism for the initiation of tests, including the well known tests identified in this document as well as those introduced by a particular implementation, i.e., as documented in the private enterprise MIB definition for the device. Setting this variable initiates the named test. Sets to this variable require the presence of upsTestSpinLock in the same SNMP message. The set request will be rejected with an appropriate error message if the requested test cannot be performed, including attempts to start a test when another test is already in progress. The status of the current or last test is maintained in upsTestResultsSummary. Tests in progress may be aborted by setting the upsTestId variable to upsTestAbortTestInProgress. Read operations return the value of the name of the test in progress if a test is in progress or the name of the last test performed if no test is in progress, unless no test has been run, in which case the well known value upsTestNoTestsInitiated is returned.
83 upsTestSpinLock 1.3.6.1.2.1.33.1.7.2 testandincr read-write objecttype scalar A spin lock on the test subsystem. The spinlock is used as follows. Before starting a test, a manager-station should make sure that a test is not in progress as follows: try_again: get (upsTestSpinLock) while (upsTestResultsSummary == inProgress) { /* loop while a test is running for another manager */ short delay get (upsTestSpinLock) } lock_value = upsTestSpinLock /* no test in progress, start the test */ set (upsTestSpinLock = lock_value, upsTestId = requested_test) if (error_index == 1) { /* (upsTestSpinLock failed) */ /* if problem is not access control, then some other manager slipped in ahead of us */ goto try_again } if (error_index == 2) { /* (upsTestId) */ /* cannot perform the test */ give up } /* test started ok */ /* wait for test completion by polling upsTestResultsSummary */ get (upsTestSpinLock, upsTestResultsSummary, upsTestResultsDetail) while (upsTestResultsSummary == inProgress) { short delay get (upsTestSpinLock, upsTestResultsSummary, upsTestResultsDetail) } /* when test completes, retrieve any additional test results */ /* if upsTestSpinLock == lock_value + 1, then these are our test */ /* results (as opposed to another manager's */ The initial value of upsTestSpinLock at agent initialization shall be 1.
84 upsTestResultsSummary 1.3.6.1.2.1.33.1.7.3 integer read-only objecttype scalar The results of the current or last UPS diagnostics test performed. The values for donePass(1), doneWarning(2), and doneError(3) indicate that the test completed either successfully, with a warning, or with an error, respectively. The value aborted(4) is returned for tests which are aborted by setting the value of upsTestId to upsTestAbortTestInProgress. Tests which have not yet concluded are indicated by inProgress(5). The value noTestsInitiated(6) indicates that no previous test results are available, such as is the case when no tests have been run since the last reinitialization of the network management subsystem and the system has no provision for non- volatile storage of test results. Enumeration: 'doneError': 3, 'noTestsInitiated': 6, 'donePass': 1, 'doneWarning': 2, 'aborted': 4, 'inProgress': 5.
85 upsTestResultsDetail 1.3.6.1.2.1.33.1.7.4 displaystring read-only objecttype scalar Additional information about upsTestResultsSummary. If no additional information available, a zero length string is returned.
86 upsTestStartTime 1.3.6.1.2.1.33.1.7.5 timestamp read-only objecttype scalar The value of sysUpTime at the time the test in progress was initiated, or, if no test is in progress, the time the previous test was initiated. If the value of upsTestResultsSummary is noTestsInitiated(6), upsTestStartTime has the value 0.
87 upsTestElapsedTime 1.3.6.1.2.1.33.1.7.6 timeinterval read-only objecttype scalar The amount of time, in TimeTicks, since the test in progress was initiated, or, if no test is in progress, the previous test took to complete. If the value of upsTestResultsSummary is noTestsInitiated(6), upsTestElapsedTime has the value 0.
88 upsWellKnownTests 1.3.6.1.2.1.33.1.7.7 objectidentity
89 upsTestNoTestsInitiated 1.3.6.1.2.1.33.1.7.7.1 objectidentity No tests have been initiated and no test is in progress.
90 upsTestAbortTestInProgress 1.3.6.1.2.1.33.1.7.7.2 objectidentity The test in progress is to be aborted / the test in progress was aborted.
91 upsTestGeneralSystemsTest 1.3.6.1.2.1.33.1.7.7.3 objectidentity The manufacturer's standard test of UPS device systems.
92 upsTestQuickBatteryTest 1.3.6.1.2.1.33.1.7.7.4 objectidentity A test that is sufficient to determine if the battery needs replacement.
93 upsTestDeepBatteryCalibration 1.3.6.1.2.1.33.1.7.7.5 objectidentity The system is placed on battery to a discharge level, set by the manufacturer, sufficient to determine battery replacement and battery run-time with a high degree of confidence. WARNING: this test will leave the battery in a low charge state and will require time for recharging to a level sufficient to provide normal battery duration for the protected load.
94 upsControl 1.3.6.1.2.1.33.1.8 objectidentity
95 upsShutdownType 1.3.6.1.2.1.33.1.8.1 integer read-write objecttype scalar This object determines the nature of the action to be taken at the time when the countdown of the upsShutdownAfterDelay and upsRebootWithDuration objects reaches zero. Setting this object to output(1) indicates that shutdown requests should cause only the output of the UPS to turn off. Setting this object to system(2) indicates that shutdown requests will cause the entire UPS system to turn off. Enumeration: 'output': 1, 'system': 2.
96 upsShutdownAfterDelay 1.3.6.1.2.1.33.1.8.2 integer read-write objecttype scalar Setting this object will shutdown (i.e., turn off) either the UPS output or the UPS system (as determined by the value of upsShutdownType at the time of shutdown) after the indicated number of seconds, or less if the UPS batteries become depleted. Setting this object to 0 will cause the shutdown to occur immediately. Setting this object to -1 will abort the countdown. If the system is already in the desired state at the time the countdown reaches 0, then nothing will happen. That is, there is no additional action at that time if upsShutdownType = system and the system is already off. Similarly, there is no additional action at that time if upsShutdownType = output and the output is already off. When read, upsShutdownAfterDelay will return the number of seconds remaining until shutdown, or -1 if no shutdown countdown is in effect. On some systems, if the agent is restarted while a shutdown countdown is in effect, the countdown may be aborted. Sets to this object override any upsShutdownAfterDelay already in effect.
97 upsStartupAfterDelay 1.3.6.1.2.1.33.1.8.3 integer read-write objecttype scalar Setting this object will start the output after the indicated number of seconds, including starting the UPS, if necessary. Setting this object to 0 will cause the startup to occur immediately. Setting this object to -1 will abort the countdown. If the output is already on at the time the countdown reaches 0, then nothing will happen. Sets to this object override the effect of any upsStartupAfterDelay countdown or upsRebootWithDuration countdown in progress. When read, upsStartupAfterDelay will return the number of seconds until startup, or -1 if no startup countdown is in effect. If the countdown expires during a utility failure, the startup shall not occur until the utility power is restored. On some systems, if the agent is restarted while a startup countdown is in effect, the countdown is aborted.
98 upsRebootWithDuration 1.3.6.1.2.1.33.1.8.4 integer read-write objecttype scalar Setting this object will immediately shutdown (i.e., turn off) either the UPS output or the UPS system (as determined by the value of upsShutdownType at the time of shutdown) for a period equal to the indicated number of seconds, after which time the output will be started, including starting the UPS, if necessary. If the number of seconds required to perform the request is greater than the requested duration, then the requested shutdown and startup cycle shall be performed in the minimum time possible, but in no case shall this require more than the requested duration plus 60 seconds. When read, upsRebootWithDuration shall return the number of seconds remaining in the countdown, or -1 if no countdown is in progress. If the startup should occur during a utility failure, the startup shall not occur until the utility power is restored.
99 upsAutoRestart 1.3.6.1.2.1.33.1.8.5 integer read-write objecttype scalar Setting this object to 'on' will cause the UPS system to restart after a shutdown if the shutdown occurred during a power loss as a result of either a upsShutdownAfterDelay or an internal battery depleted condition. Setting this object to 'off' will prevent the UPS system from restarting after a shutdown until an operator manually or remotely explicitly restarts it. If the UPS is in a startup or reboot countdown, then the UPS will not restart until that delay has been satisfied. Enumeration: 'on': 1, 'off': 2.
100 upsConfig 1.3.6.1.2.1.33.1.9 objectidentity
101 upsConfigInputVoltage 1.3.6.1.2.1.33.1.9.1 nonnegativeinteger read-write objecttype scalar The magnitude of the nominal input voltage. On those systems which support read-write access to this object, if there is an attempt to set this variable to a value that is not supported, the request must be rejected and the agent shall respond with an appropriate error message, i.e., badValue for SNMPv1, or inconsistentValue for SNMPv2.
102 upsConfigInputFreq 1.3.6.1.2.1.33.1.9.2 nonnegativeinteger read-write objecttype scalar The nominal input frequency. On those systems which support read-write access to this object, if there is an attempt to set this variable to a value that is not supported, the request must be rejected and the agent shall respond with an appropriate error message, i.e., badValue for SNMPv1, or inconsistentValue for SNMPv2.
103 upsConfigOutputVoltage 1.3.6.1.2.1.33.1.9.3 nonnegativeinteger read-write objecttype scalar The magnitude of the nominal output voltage. On those systems which support read-write access to this object, if there is an attempt to set this variable to a value that is not supported, the request must be rejected and the agent shall respond with an appropriate error message, i.e., badValue for SNMPv1, or inconsistentValue for SNMPv2.
104 upsConfigOutputFreq 1.3.6.1.2.1.33.1.9.4 nonnegativeinteger read-write objecttype scalar The nominal output frequency. On those systems which support read-write access to this object, if there is an attempt to set this variable to a value that is not supported, the request must be rejected and the agent shall respond with an appropriate error message, i.e., badValue for SNMPv1, or inconsistentValue for SNMPv2.
105 upsConfigOutputVA 1.3.6.1.2.1.33.1.9.5 nonnegativeinteger read-only objecttype scalar The magnitude of the nominal Volt-Amp rating.
106 upsConfigOutputPower 1.3.6.1.2.1.33.1.9.6 nonnegativeinteger read-only objecttype scalar The magnitude of the nominal true power rating.
107 upsConfigLowBattTime 1.3.6.1.2.1.33.1.9.7 nonnegativeinteger read-write objecttype scalar The value of upsEstimatedMinutesRemaining at which a lowBattery condition is declared. For agents which support only discrete (discontinuous) values, then the agent shall round up to the next supported value. If the requested value is larger than the largest supported value, then the largest supported value shall be selected.
108 upsConfigAudibleStatus 1.3.6.1.2.1.33.1.9.8 integer read-write objecttype scalar The requested state of the audible alarm. When in the disabled state, the audible alarm should never sound. The enabled state is self-describing. Setting this object to muted(3) when the audible alarm is sounding shall temporarily silence the alarm. It will remain muted until it would normally stop sounding and the value returned for read operations during this period shall equal muted(3). At the end of this period, the value shall revert to enabled(2). Writes of the value muted(3) when the audible alarm is not sounding shall be accepted but otherwise shall have no effect. Enumeration: 'disabled': 1, 'muted': 3, 'enabled': 2.
109 upsConfigLowVoltageTransferPoint 1.3.6.1.2.1.33.1.9.9 nonnegativeinteger read-write objecttype scalar The minimum input line voltage allowed before the UPS system transfers to battery backup.
110 upsConfigHighVoltageTransferPoint 1.3.6.1.2.1.33.1.9.10 nonnegativeinteger read-write objecttype scalar The maximum line voltage allowed before the UPS system transfers to battery backup.
111 upsTraps 1.3.6.1.2.1.33.2 objectidentity
112 upsTrapOnBattery 1.3.6.1.2.1.33.2.1 notificationtype The UPS is operating on battery power. This trap is persistent and is resent at one minute intervals until the UPS either turns off or is no longer running on battery.
113 upsTrapTestCompleted 1.3.6.1.2.1.33.2.2 notificationtype This trap is sent upon completion of a UPS diagnostic test.
114 upsTrapAlarmEntryAdded 1.3.6.1.2.1.33.2.3 notificationtype This trap is sent each time an alarm is inserted into to the alarm table. It is sent on the insertion of all alarms except for upsAlarmOnBattery and upsAlarmTestInProgress.
115 upsTrapAlarmEntryRemoved 1.3.6.1.2.1.33.2.4 notificationtype This trap is sent each time an alarm is removed from the alarm table. It is sent on the removal of all alarms except for upsAlarmTestInProgress.
116 upsConformance 1.3.6.1.2.1.33.3 objectidentity
117 upsCompliances 1.3.6.1.2.1.33.3.1 objectidentity
118 upsSubsetCompliance 1.3.6.1.2.1.33.3.1.1 modulecompliance The compliance statement for UPSs that only support the two-contact communication protocol.
119 upsBasicCompliance 1.3.6.1.2.1.33.3.1.2 modulecompliance The compliance statement for UPSs that support full-featured functions, such as control.
120 upsFullCompliance 1.3.6.1.2.1.33.3.1.3 modulecompliance The compliance statement for UPSs that support advanced full-featured functions.
121 upsGroups 1.3.6.1.2.1.33.3.2 objectidentity
122 upsSubsetGroups 1.3.6.1.2.1.33.3.2.1 objectidentity
123 upsSubsetIdentGroup 1.3.6.1.2.1.33.3.2.1.1 objectgroup The upsSubsetIdentGroup defines objects which are common across all UPSs which meet subset compliance. Most devices which conform to the upsSubsetIdentGroup will provide access to these objects via a proxy agent. If the proxy agent is compatible with multiple UPS types, configuration of the proxy agent will require specifying some of these values, either individually, or as a group (perhaps through a table lookup mechanism based on the UPS model number).
124 upsSubsetBatteryGroup 1.3.6.1.2.1.33.3.2.1.2 objectgroup The upsSubsetBatteryGroup defines the objects that are common to battery groups of two-contact UPSs.
125 upsSubsetInputGroup 1.3.6.1.2.1.33.3.2.1.3 objectgroup The upsSubsetInputGroup defines the objects that are common to the Input groups of two-contact UPSs.
126 upsSubsetOutputGroup 1.3.6.1.2.1.33.3.2.1.4 objectgroup The upsSubsetOutputGroup defines the objects that are common to the Output groups of two-contact UPSs.
127 upsSubsetAlarmGroup 1.3.6.1.2.1.33.3.2.1.6 objectgroup The upsSubsetAlarmGroup defines the objects that are common to the Alarm groups of two-contact UPSs.
128 upsSubsetControlGroup 1.3.6.1.2.1.33.3.2.1.8 objectgroup The upsSubsetControlGroup defines the objects that are common to the Control groups of two-contact UPSs.
129 upsSubsetConfigGroup 1.3.6.1.2.1.33.3.2.1.9 objectgroup The upsSubsetConfigGroup defines the objects that are common to the Config groups of two-contact UPSs.
130 upsBasicGroups 1.3.6.1.2.1.33.3.2.2 objectidentity
131 upsBasicIdentGroup 1.3.6.1.2.1.33.3.2.2.1 objectgroup The upsBasicIdentGroup defines objects which are common to the Ident group of compliant UPSs which support basic functions.
132 upsBasicBatteryGroup 1.3.6.1.2.1.33.3.2.2.2 objectgroup The upsBasicBatteryGroup defines the objects that are common to the battery groups of compliant UPSs which support basic functions.
133 upsBasicInputGroup 1.3.6.1.2.1.33.3.2.2.3 objectgroup The upsBasicInputGroup defines the objects that are common to the Input groups of compliant UPSs which support basic functions.
134 upsBasicOutputGroup 1.3.6.1.2.1.33.3.2.2.4 objectgroup The upsBasicOutputGroup defines the objects that are common to the Output groups of compliant UPSs which support basic functions.
135 upsBasicBypassGroup 1.3.6.1.2.1.33.3.2.2.5 objectgroup The upsBasicBypassGroup defines the objects that are common to the Bypass groups of compliant UPSs which support basic functions.
136 upsBasicAlarmGroup 1.3.6.1.2.1.33.3.2.2.6 objectgroup The upsBasicAlarmGroup defines the objects that are common to the Alarm groups of compliant UPSs which support basic functions.
137 upsBasicTestGroup 1.3.6.1.2.1.33.3.2.2.7 objectgroup The upsBasicTestGroup defines the objects that are common to the Test groups of compliant UPSs which support basic functions.
138 upsBasicControlGroup 1.3.6.1.2.1.33.3.2.2.8 objectgroup The upsBasicControlGroup defines the objects that are common to the Control groups of compliant UPSs which support basic functions.
139 upsBasicConfigGroup 1.3.6.1.2.1.33.3.2.2.9 objectgroup The upsBasicConfigGroup defines the objects that are common to the Config groups of UPSs which support basic functions.
140 upsFullGroups 1.3.6.1.2.1.33.3.2.3 objectidentity
141 upsFullIdentGroup 1.3.6.1.2.1.33.3.2.3.1 objectgroup The upsFullIdentGroup defines objects which are common to the Ident group of fully compliant UPSs.
142 upsFullBatteryGroup 1.3.6.1.2.1.33.3.2.3.2 objectgroup The upsFullBatteryGroup defines the objects that are common to the battery groups of fully compliant UPSs.
143 upsFullInputGroup 1.3.6.1.2.1.33.3.2.3.3 objectgroup The upsFullInputGroup defines the objects that are common to the Input groups of fully compliant UPSs.
144 upsFullOutputGroup 1.3.6.1.2.1.33.3.2.3.4 objectgroup The upsFullOutputGroup defines the objects that are common to the Output groups of fully compliant UPSs.
145 upsFullBypassGroup 1.3.6.1.2.1.33.3.2.3.5 objectgroup The upsFullBypassGroup defines the objects that are common to the Bypass groups of fully compliant UPSs.
146 upsFullAlarmGroup 1.3.6.1.2.1.33.3.2.3.6 objectgroup The upsFullAlarmGroup defines the objects that are common to the Alarm groups of fully compliant UPSs.
147 upsFullTestGroup 1.3.6.1.2.1.33.3.2.3.7 objectgroup The upsFullTestGroup defines the objects that are common to the Test groups of fully compliant UPSs.
148 upsFullControlGroup 1.3.6.1.2.1.33.3.2.3.8 objectgroup The upsFullControlGroup defines the objects that are common to the Control groups of fully compliant UPSs.
149 upsFullConfigGroup 1.3.6.1.2.1.33.3.2.3.9 objectgroup The upsFullConfigGroup defines the objects that are common to the Config groups of fully compliant UPSs.

View File

@@ -64,7 +64,7 @@ static void *mainthread(void *s){
return NULL;
}
sensordata_t *sensor_new(int N, time_t pollt, int _U_ fd){
sensordata_t *sensor_new(int N, time_t pollt, _U_ const char *descr){
FNAME();
sensordata_t *s = common_new();
if(!s) return NULL;
@@ -79,11 +79,6 @@ sensordata_t *sensor_new(int N, time_t pollt, int _U_ fd){
for(int i = 0; i < NAMOUNT; ++i) s->values[i] = values[i];
s->Nvalues = NAMOUNT;
strncpy(s->name, SENSOR_NAME, NAME_LEN);
/*if(!(s->ringbuffer = sl_RB_new(BUFSIZ))){
WARNX("Can't init ringbuffer!");
common_kill(s);
return -1;
}*/
if(pthread_create(&s->thread, NULL, mainthread, (void*)s)){
WARN("Can't create main thread");
s->kill(s);

View File

@@ -69,7 +69,7 @@ static void *mainthread(void *s){
return NULL;
}
sensordata_t *sensor_new(int N, time_t pollt, int _U_ fd){
sensordata_t *sensor_new(int N, time_t pollt, _U_ const char *descr){
FNAME();
sensordata_t *s = common_new();
if(!s) return NULL;

View File

@@ -120,15 +120,17 @@ static void *mainthread(void *s){
return NULL;
}
sensordata_t *sensor_new(int N, time_t pollt, int fd){
sensordata_t *sensor_new(int N, time_t pollt, const char *descr){
FNAME();
if(!descr || !*descr) return NULL;
int fd = getFD(descr);
if(fd < 0) return NULL;
sensordata_t *s = common_new();
if(!s) return NULL;
s->fdes = fd;
s->PluginNo = N;
if(pollt) s->tpoll = pollt;
strncpy(s->name, SENSOR_NAME, NAME_LEN);
snprintf(s->name, NAME_LEN, "%s @ %s", SENSOR_NAME, descr);
s->values = MALLOC(val_t, NS);
// don't use memcpy, as `values` could be aligned
for(int i = 0; i < NS; ++i) s->values[i] = values[i];

View File

@@ -194,12 +194,14 @@ static void *mainthread(void *s){
return NULL;
}
sensordata_t *sensor_new(int N, time_t pollt, int fd){
sensordata_t *sensor_new(int N, time_t pollt, const char *descr){
FNAME();
if(!descr || !*descr) return NULL;
int fd = getFD(descr);
if(fd < 0) return NULL;
sensordata_t *s = common_new();
if(!s) return NULL;
strncpy(s->name, SENSOR_NAME, NAME_LEN);
snprintf(s->name, NAME_LEN, "%s @ %s", SENSOR_NAME, descr);
s->fdes = fd;
s->PluginNo = N;
s->Nvalues = NAMOUNT;

View File

@@ -166,15 +166,17 @@ static void *mainthread(void *s){
}
sensordata_t *sensor_new(int N, time_t pollt, int fd){
sensordata_t *sensor_new(int N, time_t pollt, const char *descr){
FNAME();
if(!descr || !*descr) return NULL;
int fd = getFD(descr);
if(fd < 0) return NULL;
sensordata_t *s = common_new();
if(!s) return NULL;
s->Nvalues = NAMOUNT;
s->PluginNo = N;
s->fdes = fd;
strncpy(s->name, SENSOR_NAME, NAME_LEN);
snprintf(s->name, NAME_LEN, "%s @ %s", SENSOR_NAME, descr);
if(pollt) s->tpoll = pollt;
s->values = MALLOC(val_t, NAMOUNT);
for(int i = 0; i < NAMOUNT; ++i) s->values[i] = values[i];

View File

@@ -0,0 +1,220 @@
/*
* This file is part of the weatherdaemon project.
* Copyright 2026 Edward V. Emelianov <edward.emelianoff@gmail.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <string.h>
#include <stdlib.h>
// set flag FORCE_OFF only within FORCEOFF_PAUSE seconds after power loss
#define FORCEOFF_PAUSE 30
#include "weathlib.h"
#define SENSOR_NAME "SNMP UPS monitor"
// https://mibs.observium.org/mib/XUPS-MIB/
// gcc $(net-snmp-config --cflags --libs) snmp.c -o snmptest
enum{
NBATSTAT,
NTONBAT,
NTREMAIN,
NBATCAP,
NSOURCE,
NONBAT,
NAMOUNT
};
enum{
BATT_STAT_UNKN = 1,
BATT_STAT_NORMAL,
BATT_STAT_LOW,
BATT_STAT_DEPLETED,
BATT_STAT_AMOUNT
};
const char* batt_stat[BATT_STAT_AMOUNT]= {
"--",
[BATT_STAT_UNKN] = "Unknown",
[BATT_STAT_NORMAL] = "Normal",
[BATT_STAT_LOW] = "Low",
[BATT_STAT_DEPLETED] = "Depleted"
};
enum{
SOURCE_OTHER = 1,
SOURCE_NONE,
SOURCE_NORMAL,
SOURCE_BYPASS,
SOURCE_BATTERY,
SOURCE_BOOSTER,
SOURCE_REDUCER,
SOURCE_AMOUNT
};
const char *sources[SOURCE_AMOUNT] = {
"--",
[SOURCE_OTHER] = "Other",
[SOURCE_NONE] = "None",
[SOURCE_NORMAL] = "Normal",
[SOURCE_BYPASS] = "Bypass",
[SOURCE_BATTERY] = "Battery",
[SOURCE_BOOSTER] = "Booster",
[SOURCE_REDUCER] = "Reducer"
};
enum{
OID_BATT_STATUS, // batt status: 1 - unkn, 2 - normal, 3 - low, 4 - depleted
OID_BATT_SECONDS_ONBAT, // seconds from ONBAT starts
OID_BATT_EST_MINUTES, // estimated minutes of work
OID_BATT_CAPACITY, // capacity of battery
OID_OUTPUT_SOURCE, // input source: 1 - other, 2 - none, 3 - normal, 4 - bypass, 5 - battery, 6 - booster, 7 - reducer
OID_AMOUNT
};
static netsnmp_session *snmp_session;
static oid anOID[OID_AMOUNT][MAX_OID_LEN];
static size_t anOID_len[OID_AMOUNT];
static int running = 1;
const char *oids[OID_AMOUNT] = {
[OID_BATT_STATUS] = ".1.3.6.1.2.1.33.1.2.1.0",
[OID_BATT_SECONDS_ONBAT] = ".1.3.6.1.2.1.33.1.2.2.0",
[OID_BATT_EST_MINUTES] = ".1.3.6.1.2.1.33.1.2.3.0",
[OID_BATT_CAPACITY] = ".1.3.6.1.2.1.33.1.2.4.0",
[OID_OUTPUT_SOURCE] = ".1.3.6.1.2.1.33.1.4.1.0",
};
static const val_t values[NAMOUNT] = {
[NBATSTAT] = {.sense = VAL_RECOMMENDED, .type = VALT_STRING, .meaning = IS_OTHER, .name = "UPSBTST", .comment = "UPS battery status"},
[NTONBAT] = {.sense = VAL_RECOMMENDED, .type = VALT_UINT, .meaning = IS_OTHER, .name = "UPSTONBT", .comment = "UPS worked on battery time (s)"},
[NTREMAIN] = {.sense = VAL_RECOMMENDED, .type = VALT_UINT, .meaning = IS_OTHER, .name = "UPSTREM", .comment = "UPS estimated time on battery (s)"},
[NBATCAP] = {.sense = VAL_RECOMMENDED, .type = VALT_UINT, .meaning = IS_OTHER, .name = "UPSBATCP", .comment = "UPS battery capacity, percents"},
[NSOURCE] = {.sense = VAL_RECOMMENDED, .type = VALT_STRING, .meaning = IS_OTHER, .name = "UPSSRC", .comment = "UPS power source"},
[NONBAT] = {.sense = VAL_FORCEDSHTDN, .type = VALT_UINT, .meaning = IS_FORCEDSHTDN, .name = "UPSONBAT", .comment = "AC power lost, works on battery"},
};
static void *mainthread(void *s){
double t0 = sl_dtime();
sensordata_t *sensor = (sensordata_t *)s;
netsnmp_pdu *pdu, *response;
while(running){
//DBG("run");
pdu = snmp_pdu_create(SNMP_MSG_GET);
for(int i = 0; i < OID_AMOUNT; ++i)
snmp_add_null_var(pdu, anOID[i], anOID_len[i]);
int status = snmp_synch_response(snmp_session, pdu, &response);
//DBG("status = %d", status);
if(status == STAT_SUCCESS && response->errstat == SNMP_ERR_NOERROR){
time_t curt = time(NULL);
netsnmp_variable_list *vars = response->variables;
pthread_mutex_lock(&sensor->valmutex);
int ival = *vars->val.integer;
if(ival > 0 && ival < BATT_STAT_AMOUNT)
snprintf(sensor->values[NBATSTAT].value.str, STRT_LEN+1, "%s", batt_stat[ival]);
vars = vars->next_variable;
uint32_t tonbat = (uint32_t) *vars->val.integer;
sensor->values[NTONBAT].value.u = tonbat;
vars = vars->next_variable;
sensor->values[NTREMAIN].value.u = 60 * (uint32_t) *vars->val.integer;
vars = vars->next_variable;
sensor->values[NBATCAP].value.u = (uint32_t) *vars->val.integer;
vars = vars->next_variable;
ival = *vars->val.integer;
if(ival > 0 && ival < SOURCE_AMOUNT)
snprintf(sensor->values[NSOURCE].value.str, STRT_LEN+1, "%s", sources[ival]);
if(ival == SOURCE_BATTERY && tonbat > FORCEOFF_PAUSE){
sensor->values[NONBAT].value.u = 1;
}else sensor->values[NONBAT].value.u = 0;
for(int i = 0; i < NAMOUNT; ++i)
sensor->values[i].time = curt;
pthread_mutex_unlock(&sensor->valmutex);
if(sensor->freshdatahandler) sensor->freshdatahandler(sensor);
}else DBG("Error in packet");
if(response) snmp_free_pdu(response);
//DBG("sleep");
while(sl_dtime() - t0 < sensor->tpoll) usleep(500);
t0 = sl_dtime();
}
return NULL;
}
static void snmp_kill(sensordata_t *s){
running = 0;
pthread_join(s->thread, NULL);
snmp_close(snmp_session);
common_kill(s);
}
sensordata_t *sensor_new(int N, time_t pollt, const char *descr){
FNAME();
if(!descr || !*descr) return NULL;
netsnmp_session session;
init_snmp("snmpapp");
snmp_sess_init(&session);
session.version = SNMP_VERSION_1;
session.community = (u_char *)"public";
session.community_len = strlen((const char *)session.community);
const char *colon = strchr(descr, ':');
if(colon) descr = colon + 1; // omit "N:" in field "N:host"
session.peername = strdup(descr);
snmp_session = snmp_open(&session);
if(!snmp_session){
snmp_sess_perror("snmp_open", &session);
FREE(session.peername);
return NULL;
}
sensordata_t *s = common_new();
if(!s){
snmp_close(snmp_session);
return NULL;
}
s->kill = snmp_kill;
snprintf(s->name, NAME_LEN, "%s @ %s", SENSOR_NAME, descr);
s->PluginNo = N;
s->fdes = -1;
s->Nvalues = NAMOUNT;
if(pollt) s->tpoll = pollt;
s->values = MALLOC(val_t, NAMOUNT);
for(int i = 0; i < NAMOUNT; ++i) s->values[i] = values[i];
DBG("init OIDs");
for(int i = 0; i < OID_AMOUNT; ++i){
anOID_len[i] = MAX_OID_LEN;
if(!read_objid(oids[i], anOID[i], &anOID_len[i])){
snmp_perror(oids[i]);
continue;
}
DBG("Got OID %s", oids[i]);
//snmp_add_null_var(snmp_pdu, anOID, anOID_len);
}
DBG("Start main thread");
if(!(s->ringbuffer = sl_RB_new(BUFSIZ)) ||
pthread_create(&s->thread, NULL, mainthread, (void*)s)){
s->kill(s);
return NULL;
}
return s;
}

View File

@@ -194,12 +194,14 @@ static void *mainthread(void *s){
return NULL;
}
sensordata_t *sensor_new(int N, time_t pollt, int fd){
sensordata_t *sensor_new(int N, time_t pollt, const char *descr){
FNAME();
if(!descr || !*descr) return NULL;
int fd = getFD(descr);
if(fd < 0) return NULL;
sensordata_t *s = common_new();
if(!s) return NULL;
strncpy(s->name, SENSOR_NAME, NAME_LEN);
snprintf(s->name, NAME_LEN, "%s @ %s", SENSOR_NAME, descr);
s->PluginNo = N;
s->fdes = fd;
s->Nvalues = NAMOUNT;

View File

@@ -20,7 +20,6 @@
#include <string.h>
#include <usefull_macros.h>
#include "fd.h"
#include "mainweather.h"
#include "sensors.h"
#include "weathlib.h"
@@ -86,7 +85,7 @@ void *open_plugin(const char *name){
*/
static void dumpsensors(struct sensordata_t* station){
//FNAME();
if(!station || !station->get_value || station->Nvalues < 1) return;
if(!station || !station->get_value || station->Nvalues < 1 || station->IsMuted) return;
refresh_sensval(station);
#if 0
DBG("New values...");
@@ -139,9 +138,7 @@ int openplugins(char **paths, int N){
DBG("OPENED");
sensor_new_t sensnew = (sensor_new_t) dlsym(dlh, "sensor_new");
if(sensnew){
int fd = -1;
if(colon) fd = getFD(colon);
sensordata_t *S = sensnew(nplugins, poll_interval, fd); // here nplugins is index in array
sensordata_t *S = sensnew(nplugins, poll_interval, colon); // here nplugins is index in array
if(!S) WARNXL("Can't init plugin %s", paths[i]);
else{
if(!S->onrefresh || !S->onrefresh(S, dumpsensors)) WARNXL("Can't init refresh funtion");
@@ -301,6 +298,7 @@ int change_val_sense(sensordata_t *s, int idx, valsense_t sense){
return TRUE;
}
// convert val_t into double
double val2d(const val_t *value){
double curvalue;
switch(value->type){
@@ -311,3 +309,19 @@ double val2d(const val_t *value){
}
return curvalue;
}
// pause and continue sensors refresh
int station_mute(sensordata_t *s){
if(!s) return FALSE;
s->IsMuted = TRUE;
return TRUE;
}
int station_unmute(sensordata_t *s){
if(!s) return FALSE;
s->IsMuted = FALSE;
return TRUE;
}
int station_is_muted(sensordata_t *s){
if(s && s->IsMuted) return TRUE;
return FALSE;
}

View File

@@ -27,12 +27,21 @@ int openplugins(char **paths, int N);
void closeplugins();
sensordata_t *get_plugin(int N);
int get_nplugins();
int find_val_by_name(sensordata_t *s, const char *name);
int format_senssense(const val_t *v, char *buf, int buflen, int Np);
int format_sensval(const val_t *v, char *buf, int buflen, int Np);
int format_msrmttm(time_t t, char *buf, int buflen, int Np);
int change_val_sense(sensordata_t *s, int idx, valsense_t sense);
int set_pollT(time_t t);
time_t get_pollT();
double val2d(const val_t *v);
void get_fieldname(const val_t *v, char buf[KEY_LEN+1]);
time_t get_pollT();
int station_mute(sensordata_t *s);
int station_unmute(sensordata_t *s);
int station_is_muted(sensordata_t *s);

View File

@@ -281,6 +281,40 @@ static sl_sock_hresult_e wlevhandler(sl_sock_t *client, sl_sock_hitem_t *item, c
return RESULT_SILENCE;
}
static sensordata_t *get_sd_by_num(const char *req, int *Num){
int N;
if(!req || !sl_str2i(&N, req) || N < 0) return NULL;
if(Num) *Num = N;
return get_plugin(N);
}
static sl_sock_hresult_e mutehandler(sl_sock_t *client, _U_ sl_sock_hitem_t *item, const char *req){
if(!client) return RESULT_FAIL;
sensordata_t *sd = get_sd_by_num(req, NULL);
if(!sd) return RESULT_BADVAL;
if(!station_mute(sd)) return RESULT_FAIL;
return RESULT_OK;
}
static sl_sock_hresult_e unmutehandler(sl_sock_t *client, _U_ sl_sock_hitem_t *item, const char *req){
if(!client) return RESULT_FAIL;
sensordata_t *sd = get_sd_by_num(req, NULL);
if(!sd) return RESULT_BADVAL;
if(!station_unmute(sd)) return RESULT_FAIL;
return RESULT_OK;
}
static sl_sock_hresult_e ismutedhandler(sl_sock_t *client, sl_sock_hitem_t *item, const char *req){
if(!client) return RESULT_FAIL;
int N;
sensordata_t *sd = get_sd_by_num(req, &N);
if(!sd) return RESULT_BADVAL;
char buf[256];
snprintf(buf, 256, "%s[%d] = %d\n", item->key, N, station_is_muted(sd));
sl_sock_sendstrmessage(client, buf);
return RESULT_SILENCE;
}
// graceful closing socket: let client know that he's told to fuck off
static void toomuch(int fd){
const char *m = "Try later: too much clients connected\n";
@@ -334,6 +368,9 @@ static sl_sock_hitem_t localhandlers[] = { // local - full amount of setters/get
{forceoffhandler, "forceoff", "get/set/clear FORCE SHUTDOWN flag", NULL},
{setlvlhandler, "setlevel", "set 'sense level' (0..3) for given plugin parameters, e.g. setlevel=1:WIND=3,HUMIDITY=3 - disable fields for station 1", NULL},
{wlevhandler, "weathlevel", "set/get current weather level (0..3): goog/bad/terrible/prohibited", NULL},
{ismutedhandler, "ismuted", "==1 if station is muted", NULL},
{mutehandler, "mute", "pause station's data capture", NULL},
{unmutehandler, "unmute", "continue station's data capture", NULL},
COMMONHANDLERS
{NULL, NULL, NULL, NULL}
};
@@ -348,11 +385,13 @@ int start_servers(const char *netnode, const char *sockpath){
LOGERR("start_servers(): can't run network socket");
return FALSE;
}
DBG("Network server started");
localsocket = sl_sock_run_server(SOCKT_UNIX, sockpath, BUFSIZ, localhandlers);
if(!localsocket){
LOGERR("start_servers(): can't run local socket");
return FALSE;
}
DBG("Local server started");
sl_sock_changemaxclients(netsocket, MAX_CLIENTS);
sl_sock_changemaxclients(localsocket, 1);
sl_sock_maxclhandler(netsocket, toomuch);

View File

@@ -2,7 +2,6 @@ CMakeLists.txt
cmdlnopts.c
cmdlnopts.h
fd.c
fd.h
main.c
mainweather.c
mainweather.h
@@ -13,6 +12,7 @@ plugins/dummy.c
plugins/fdexample.c
plugins/hydreon.c
plugins/reinhardt.c
plugins/snmp.c
plugins/wxa100.c
sensors.c
sensors.h

View File

@@ -23,9 +23,9 @@
#include "weathlib.h"
// private functions (for plugins usage only)
static int common_onrefresh(sensordata_t*, void (*handler)(sensordata_t*));
static void common_kill(sensordata_t *);
static int common_getval(sensordata_t*, val_t*, int);
//static int common_onrefresh(sensordata_t*, void (*handler)(sensordata_t*));
//static void common_kill(sensordata_t *);
//static int common_getval(sensordata_t*, val_t*, int);
//static int common_init(sensordata_t*, int, time_t, int);
/**

View File

@@ -27,6 +27,8 @@
// length (in symbols) of key, value and comment
#define KEY_LEN (8)
// length of STR type (without terminal zero)
#define STRT_LEN (11)
#define VAL_LEN (31)
#define COMMENT_LEN (63)
// maximal full length of "KEY=val / comment" (as for sfitsio)
@@ -70,7 +72,7 @@ typedef union{
uint32_t u;
int32_t i;
float f;
char str[KEY_LEN+1];// up to 8 symbols (with terminating zero)
char str[STRT_LEN+1];// up to 8 symbols (with terminating zero)
} num_t;
// type of value
@@ -98,6 +100,7 @@ typedef struct sensordata_t{
char name[NAME_LEN+1]; // max 31 symbol of sensor's name (e.g. "rain sensor")
int Nvalues; // amount of values
int PluginNo; // plugin number in array (if several)
int IsMuted; // ==1 for "muted" station (don't refresh sensors' data)
int (*onrefresh)(struct sensordata_t*, void (*handler)(struct sensordata_t*)); // handler of new data; return TRUE if OK
int (*get_value)(struct sensordata_t*, val_t*, int); // getter of Nth value
void (*kill)(struct sensordata_t*); // close everything and remove sensor
@@ -115,11 +118,16 @@ typedef struct sensordata_t{
} sensordata_t;
// type for function extraction
typedef sensordata_t* (*sensor_new_t)(int, time_t, int);
typedef sensordata_t* (*sensor_new_t)(int, time_t, const char*);
// init meteostation with given PluginNo, poll_interval and fd
sensordata_t *sensor_new(int PluginNo, time_t poll_interval, int fd); // external initial function for any plugin
// init meteostation with given PluginNo, poll_interval and descriptor
sensordata_t *sensor_new(int PluginNo, time_t poll_interval, const char *descr); // external initial function for any plugin
int sensor_alive(sensordata_t *s);
// private function (for plugins usage only)
sensordata_t *common_new();
void common_kill(sensordata_t *s);
int common_onrefresh(sensordata_t *s, void (*handler)(sensordata_t *));
int common_getval(struct sensordata_t *s, val_t *o, int N);
int getFD(const char *path);