Skip to content

Commit 3b0f97a

Browse files
committed
integrated environmental monitoring
1 parent 67a964e commit 3b0f97a

5 files changed

Lines changed: 235 additions & 193 deletions

File tree

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### New
11+
- Added **UPS Environment** service for THS environmental sensor monitoring:
12+
- Temperature monitoring (thsOneTempData - .1.3.6.1.4.1.44782.1.2.1.1.1.0)
13+
- Humidity monitoring (thsOneHumiData - .1.3.6.1.4.1.44782.1.2.1.1.2.0)
14+
- Configurable thresholds for both upper and lower limits
15+
- Service auto-discovered only when THS sensor is connected
16+
- Added graphing metrics for environmental data (env_temperature, env_humidity)
17+
- Added environment-specific graphs (temperature, humidity, combined)
1118

1219
### Changed
1320

README.md

Lines changed: 67 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -1,223 +1,99 @@
11
# CheckMK Wiseways UPS SNMP Plugin
22

3-
A comprehensive CheckMK SNMP plugin for monitoring Wiseways UPS devices (6000VA, 10kVA and compatible models).
4-
5-
## Overview
6-
7-
This plugin provides complete monitoring of Wiseways UPS systems via SNMP with 18 specialized services covering every aspect of UPS operation:
8-
9-
- **System Information**: Model, serial number, firmware versions, maintenance schedules
10-
- **Battery Monitoring**: Individual services for charge, runtime, status, and alarms
11-
- **Power Monitoring**: Separate services for input/output/bypass/battery voltages
12-
- **Load Management**: Output load percentage, power consumption, and current monitoring
13-
- **Frequency Stability**: Individual monitoring for input/output/bypass frequencies
14-
- **Alarm System**: Comprehensive alarm detection and status reporting
3+
A CheckMK SNMP plugin for monitoring Wiseways UPS devices (6000VA, 10kVA and compatible models).
154

165
## Features
176

18-
- **18 Specialized Services**: Each monitoring aspect has its own dedicated service for granular control
19-
- **Automatic Data Normalization**: Converts SNMP values to standard units (decivolts→volts, minutes→seconds)
20-
- **Maintenance Monitoring**: Automatic warnings for expired maintenance and battery service schedules
21-
- **Smart Graph Organization**: Unit-based grouping for combined overview graphs
22-
- **Dynamic Thresholds**: Uses device configuration values as defaults when available
23-
- **Enterprise & Standard MIB Support**: Works with both RFC 1628 standard UPS MIB and Wiseways enterprise OIDs (44782)
7+
- 19 specialized services for granular monitoring and alerting
8+
- Automatic unit conversion (decivolts→volts, minutes→seconds)
9+
- Dynamic thresholds from device configuration when available
10+
- Maintenance expiration warnings
11+
- Support for RFC 1628 UPS MIB and Wiseways enterprise OIDs (44782)
12+
- THS environmental sensor support (temperature/humidity)
2413

2514
## Installation
2615

27-
### Standard Installation (Recommended)
28-
29-
1. Download the latest MKP package from [GitHub Releases](https://github.com/oposs/cmk-oposs_wiseways_ups/releases)
30-
31-
2. Install the MKP in CheckMK:
32-
```bash
33-
cmk -P install oposs_wiseways_ups-<version>.mkp
34-
```
35-
36-
3. Run service discovery on your UPS hosts:
37-
```bash
38-
cmk -II <hostname>
39-
```
16+
### From MKP Package (Recommended)
4017

41-
### Manual Installation (Developers)
18+
```bash
19+
# Download from https://github.com/oposs/cmk-oposs_wiseways_ups/releases
20+
cmk -P install oposs_wiseways_ups-<version>.mkp
21+
cmk -II <hostname>
22+
```
4223

43-
For development or manual installation:
24+
### Manual Installation
4425

45-
1. Copy the plugin files to your CheckMK site:
46-
```bash
47-
cp -r local/* ~/local/
48-
```
26+
```bash
27+
cp -r local/* ~/local/
28+
cmk -R
29+
cmk -II <hostname>
30+
```
4931

50-
2. Reload CheckMK to recognize the new plugin:
51-
```bash
52-
cmk -R
53-
```
54-
55-
3. Run service discovery on your UPS hosts:
56-
```bash
57-
cmk -II <hostname>
58-
```
59-
60-
## Configuration
61-
62-
### SNMP Setup
63-
64-
Ensure your Wiseways UPS is accessible via SNMP:
32+
## SNMP Setup
6533

6634
1. Configure SNMP community string on the UPS
6735
2. Add the UPS as a host in CheckMK with SNMP monitoring enabled
6836
3. Set the appropriate SNMP community in CheckMK host properties
6937

70-
### Service Discovery
71-
72-
The plugin will automatically discover up to 18 services per UPS:
73-
74-
#### Information Services
75-
- **UPS System Info**: Model, serial, firmware, maintenance dates
76-
- **UPS Battery Status**: Battery state and alarms (without charge/runtime)
77-
- **UPS Power Status**: Power source, operational mode, line failures
78-
- **UPS Alarm Status**: System-wide alarm monitoring
79-
80-
#### Battery Monitoring Services
81-
- **UPS Battery Charge**: Battery charge percentage
82-
- **UPS Battery Runtime**: Remaining runtime in seconds
83-
- **UPS Battery Voltage**: DC battery voltage
84-
- **UPS Battery Current**: Charging/discharging current
85-
- **UPS Battery Temperature**: Battery temperature monitoring
86-
87-
#### Voltage Monitoring Services
88-
- **UPS Input Voltage**: AC input voltage
89-
- **UPS Output Voltage**: AC output voltage
90-
- **UPS Bypass Voltage**: Bypass line voltage (when available)
91-
92-
#### Frequency Monitoring Services
93-
- **UPS Input Frequency**: Input frequency stability
94-
- **UPS Output Frequency**: Output frequency stability
95-
- **UPS Bypass Frequency**: Bypass frequency (when available)
96-
97-
#### Load and Power Services
98-
- **UPS Output Load**: Load percentage monitoring
99-
- **UPS Output Power**: Power consumption in watts
100-
- **UPS Output Current**: Output current monitoring
101-
102-
### Threshold Configuration
103-
104-
Configure monitoring thresholds in CheckMK under "Setup" > "Services" > "Service monitoring rules" > "OPOSS Wiseways UPS":
105-
106-
All thresholds can be configured through a single unified ruleset that applies to all relevant services:
107-
108-
#### Battery Thresholds
109-
- **Battery Charge** (`battery_charge_lower`): Warning at 20%, Critical at 10%
110-
- **Battery Runtime** (`battery_runtime_lower`): Warning at 10 minutes, Critical at 5 minutes
111-
- **Battery Voltage** (`battery_voltage_lower`): Warning at 180V, Critical at 170V
112-
- **Battery Temperature** (`temp_upper/temp_lower`): Warning at 40°C/10°C, Critical at 45°C/5°C
113-
114-
#### Voltage Thresholds
115-
- **Input Voltage** (`input_voltage_upper/lower`): Warning at 250V/210V, Critical at 260V/200V
116-
- **Output Voltage** (`output_voltage_upper/lower`): Warning at 250V/210V, Critical at 260V/200V
117-
- **Bypass Voltage** (`bypass_voltage_upper/lower`): Warning at 250V/210V, Critical at 260V/200V
118-
119-
#### Frequency Thresholds
120-
- **All Frequencies** (`frequency_upper/lower`): Warning at 51Hz/49Hz, Critical at 52Hz/48Hz
121-
122-
#### Load and Power Thresholds
123-
- **Output Load** (`load_upper`): Warning at 80%, Critical at 90%
124-
- **Output Current** (`output_current_upper`): Configurable, no default
125-
- **Output Power** (`power_upper`): Configurable, no default
126-
127-
Note: The plugin uses device-reported configuration values as dynamic defaults when available (e.g., input voltage limits from the UPS configuration).
128-
129-
## Metrics and Graphs
130-
131-
### Graph Organization
132-
133-
The plugin provides two types of graphs:
134-
135-
#### Service-Specific Graphs
136-
Each service displays its own dedicated graph with relevant metrics and thresholds.
137-
138-
#### Combined Overview Graphs (Host Level)
139-
These graphs combine metrics from multiple services for comparative analysis:
140-
141-
1. **UPS All Voltages**: All voltages (input, output, bypass, battery) on one graph
142-
2. **UPS AC Voltages**: AC voltages only (input, output, bypass)
143-
3. **UPS Frequencies**: All frequencies (input, output, bypass) together
144-
4. **UPS Currents**: Output and battery currents combined
145-
5. **UPS Battery Time**: Runtime and time-on-battery metrics
146-
147-
### Metric Units
148-
149-
All metrics use base SI units for consistency:
150-
- **Time**: seconds (converted from minutes in SNMP)
151-
- **Voltage**: volts (converted from decivolts or string format)
152-
- **Frequency**: hertz (converted from centihertz or string format)
153-
- **Temperature**: degrees Celsius
154-
- **Power**: watts
155-
- **Current**: amperes
156-
- **Charge**: percentage
157-
- **Load**: percentage
158-
159-
## Supported OIDs
160-
161-
The plugin monitors both standard RFC 1628 UPS MIB OIDs and Wiseways enterprise-specific OIDs:
162-
163-
### Standard MIB (.1.3.6.1.2.1.33)
164-
- UPS identification and status
165-
- Battery metrics
166-
- Input/output electrical parameters
167-
- Bypass parameters
168-
169-
### Enterprise OIDs
170-
- `.1.3.6.1.4.1.935` - Enhanced battery metrics
171-
- `.1.3.6.1.4.1.44782` - Wiseways-specific high-precision values
38+
## Services and Thresholds
39+
40+
Configure thresholds under "Setup" > "Services" > "Service monitoring rules" > "OPOSS Wiseways UPS".
41+
42+
| Service | Description | Default Thresholds (Warn/Crit) |
43+
|---------|-------------|-------------------------------|
44+
| **UPS System Info** | Model, serial, firmware, maintenance dates | Warns on expired maintenance |
45+
| **UPS Battery Status** | Battery state and alarms ||
46+
| **UPS Power Status** | Power source, mode, line failures ||
47+
| **UPS Alarm Status** | System-wide alarm monitoring ||
48+
| **UPS Battery Charge** | Battery charge % | Lower: 20%/10% |
49+
| **UPS Battery Runtime** | Remaining runtime | Lower: 10min/5min |
50+
| **UPS Battery Voltage** | DC battery voltage | Lower: 180V/170V |
51+
| **UPS Battery Current** | Charging/discharging current ||
52+
| **UPS Battery Temperature** | Battery temperature | Upper: 40°C/45°C, Lower: 10°C/5°C |
53+
| **UPS Input Voltage** | AC input voltage | Upper: 250V/260V, Lower: 210V/200V |
54+
| **UPS Output Voltage** | AC output voltage | Upper: 250V/260V, Lower: 210V/200V |
55+
| **UPS Bypass Voltage** | Bypass line voltage | Upper: 250V/260V, Lower: 210V/200V |
56+
| **UPS Input Frequency** | Input frequency | Upper: 51Hz/52Hz, Lower: 49Hz/48Hz |
57+
| **UPS Output Frequency** | Output frequency | Upper: 51Hz/52Hz, Lower: 49Hz/48Hz |
58+
| **UPS Bypass Frequency** | Bypass frequency | Upper: 51Hz/52Hz, Lower: 49Hz/48Hz |
59+
| **UPS Output Load** | Load percentage | Upper: 80%/90% |
60+
| **UPS Output Power** | Power consumption (W) ||
61+
| **UPS Output Current** | Output current (A) ||
62+
| **UPS Environment** | THS sensor temp/humidity | Temp: 35°C/40°C (upper), 10°C/5°C (lower); Humidity: 70%/80% (upper), 20%/10% (lower) |
63+
64+
Services marked "—" have no default thresholds but can be configured. Bypass and Environment services only appear when hardware is present.
65+
66+
## Graphs
67+
68+
Each service has its own graph. Additional combined graphs at host level:
69+
70+
- **UPS All Voltages** / **UPS AC Voltages**: Compare voltage sources
71+
- **UPS Frequencies**: All frequencies together
72+
- **UPS Currents**: Output and battery currents
73+
- **UPS Battery Time**: Runtime and time-on-battery
74+
- **UPS Environment**: Temperature and humidity
17275

17376
## Requirements
17477

17578
- CheckMK 2.3 or later
17679
- SNMP v1/v2c access to the UPS
177-
- Wiseways UPS with SNMP support (tested with 6000VA model)
80+
- Wiseways UPS with SNMP support
17881

17982
## Troubleshooting
18083

181-
### No Services Discovered
182-
183-
1. Verify SNMP connectivity:
184-
```bash
185-
snmpwalk -v2c -c <community> <ups_ip> .1.3.6.1.2.1.33.1.1.5.0
186-
```
187-
This should return a string containing "Wiseway3" for compatible devices.
188-
189-
2. Check SNMP configuration in CheckMK host settings
190-
191-
3. Ensure the UPS supports standard UPS MIB and/or Wiseways enterprise OIDs
192-
193-
4. Run manual discovery:
194-
```bash
195-
cmk -vvI --detect-plugins=oposs_wiseways_ups <hostname>
196-
```
84+
**No services discovered:**
85+
```bash
86+
# Verify SNMP connectivity (should return string containing "Wiseway3")
87+
snmpwalk -v2c -c <community> <ups_ip> .1.3.6.1.2.1.33.1.1.5.0
19788

198-
### Fewer Than 18 Services
89+
# Debug discovery
90+
cmk -vvI --detect-plugins=oposs_wiseways_ups <hostname>
91+
```
19992

200-
Not all services may be discovered depending on UPS capabilities:
201-
- Bypass services only appear if bypass voltage/frequency data is available
202-
- Battery current may not be available on all models
203-
- Some older models may not report all metrics
93+
**Fewer than 19 services:** Normal - bypass, environment, and some battery metrics only appear when supported by hardware.
20494

205-
### Incorrect Values
206-
207-
- The plugin automatically converts enterprise string format values (e.g., "231.9") to floats
208-
- Minutes are converted to seconds for all time-based metrics
209-
- Special value -99998 indicates unavailable data and is handled gracefully
210-
211-
### Missing Graphs
212-
213-
- Individual service graphs appear with their respective services
214-
- Combined overview graphs appear at the host level (not under specific services)
215-
- This is the intended behavior for cross-service visualization
95+
**Incorrect values:** The plugin handles enterprise string formats and special value -99998 (unavailable data) automatically.
21696

21797
## License
21898

21999
This plugin is provided as-is for monitoring Wiseways UPS devices in CheckMK environments.
220-
221-
## Support
222-
223-
For issues or feature requests, please refer to the project documentation or contact your system administrator.

local/lib/python3/cmk_addons/plugins/oposs_wiseways_ups/agent_based/oposs_wiseways_ups.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,12 @@ class OIDDefinition:
251251
"output_load_up_config", converter=identity_float),
252252
OIDDefinition("battery_volt_low_config", "4.1.44782.1.1.3.7.0", "upsBatteryVoltLowConfig",
253253
"battery_volt_low_config", converter=identity_float),
254+
255+
# Environmental sensor data (THS One)
256+
OIDDefinition("env_temperature", "4.1.44782.1.2.1.1.1.0", "thsOneTempData",
257+
"env_temperature", converter=identity_float),
258+
OIDDefinition("env_humidity", "4.1.44782.1.2.1.1.2.0", "thsOneHumiData",
259+
"env_humidity", converter=identity_float),
254260
]
255261

256262

@@ -1198,4 +1204,68 @@ def check_oposs_wiseways_ups_system_info(section: Dict[str, Any]) -> CheckResult
11981204
sections=["oposs_wiseways_ups"],
11991205
discovery_function=discover_oposs_wiseways_ups_system_info,
12001206
check_function=check_oposs_wiseways_ups_system_info,
1207+
)
1208+
1209+
1210+
# Check plugin for UPS Environment (THS sensor)
1211+
def discover_oposs_wiseways_ups_environment(section: Dict[str, Any]) -> DiscoveryResult:
1212+
# Discover only if environmental sensor data is present
1213+
env_temp = section.get("env_temperature", 0)
1214+
env_humi = section.get("env_humidity", 0)
1215+
if section and (env_temp > 0 or env_humi > 0):
1216+
yield Service()
1217+
1218+
1219+
def check_oposs_wiseways_ups_environment(
1220+
params: Mapping[str, Any], section: Dict[str, Any]
1221+
) -> CheckResult:
1222+
if not section:
1223+
yield Result(state=State.UNKNOWN, summary="No data")
1224+
return
1225+
1226+
env_temp = section.get("env_temperature", 0)
1227+
env_humi = section.get("env_humidity", 0)
1228+
1229+
# Check if sensor data is available
1230+
if env_temp <= 0 and env_humi <= 0:
1231+
yield Result(state=State.UNKNOWN, summary="No environmental sensor data")
1232+
return
1233+
1234+
# Temperature check
1235+
if env_temp > 0:
1236+
yield from check_levels(
1237+
env_temp,
1238+
levels_upper=params.get("env_temp_upper", ("fixed", (35.0, 40.0))),
1239+
levels_lower=params.get("env_temp_lower", ("fixed", (10.0, 5.0))),
1240+
metric_name="env_temperature",
1241+
label="Temperature",
1242+
render_func=lambda v: f"{v:.1f}°C",
1243+
)
1244+
1245+
# Humidity check
1246+
if env_humi > 0:
1247+
yield from check_levels(
1248+
env_humi,
1249+
levels_upper=params.get("env_humidity_upper", ("fixed", (70.0, 80.0))),
1250+
levels_lower=params.get("env_humidity_lower", ("fixed", (20.0, 10.0))),
1251+
metric_name="env_humidity",
1252+
label="Humidity",
1253+
render_func=lambda v: f"{v:.0f}%",
1254+
boundaries=(0, 100),
1255+
)
1256+
1257+
1258+
check_plugin_oposs_wiseways_ups_environment = CheckPlugin(
1259+
name="oposs_wiseways_ups_environment",
1260+
service_name="UPS Environment",
1261+
sections=["oposs_wiseways_ups"],
1262+
discovery_function=discover_oposs_wiseways_ups_environment,
1263+
check_function=check_oposs_wiseways_ups_environment,
1264+
check_ruleset_name="oposs_wiseways_ups",
1265+
check_default_parameters={
1266+
"env_temp_upper": ("fixed", (35.0, 40.0)),
1267+
"env_temp_lower": ("fixed", (10.0, 5.0)),
1268+
"env_humidity_upper": ("fixed", (70.0, 80.0)),
1269+
"env_humidity_lower": ("fixed", (20.0, 10.0)),
1270+
},
12011271
)

0 commit comments

Comments
 (0)