Weather Data
Many collected metrics depend on the weather: the power drawn by heating and cooling follows the outdoor temperature, solar generation follows irradiance, and cooling load in a data center rises on hot, humid days.
The weather subagent (weather.nsm) brings weather into NetXMS as ordinary DCI values, collected next to the metrics that depend on it.
Their history can then be analysed against its cause: shown on the same graph or dashboard, combined in a script DCI, or read by external analytics for trend prediction.
Besides current conditions, the subagent collects hourly forecasts (up to 16 days with Open-Meteo), so the expected weather is known in advance — for example, to estimate tomorrow’s heating demand or solar output.
The data comes from public weather services for configured locations. The agent that loads the subagent only needs outbound HTTPS access to the service; the locations do not have to be anywhere near the agent.
Providers
The subagent supports three weather services. The provider is selected per location, because they differ in coverage and in which variables they report.
| Name | Service | Notes |
|---|---|---|
|
Default. Global coverage, the only provider with direct radiation and ensemble forecasts. The free tier needs no key but is for non-commercial use only; set |
|
|
Global coverage, best for Nordic locations. No key, but requires an identifying |
|
|
DWD open data: observations mainly from Germany, forecasts worldwide but from far fewer stations outside Germany. Only stations within 50 km of the location are used, so a location with none in range gets no data. No key. Reports global (shortwave) radiation but no direct radiation and no ensemble forecasts. |
Open-Meteo and MET Norway serve model data, not measurements. Open-Meteo current values come from its 15-minute current-conditions data; MET Norway current values are the hourly forecast entry at or before the current time. The subagent re-selects that entry from the cached forecast on every polling round, so the current values keep moving between forecast downloads, which for MET Norway arrive hourly in the Nordic area and about every 6 hours elsewhere. Open-Meteo current-conditions data is used as long as it is not older than that entry. Bright Sky fills past hours with station measurements once DWD publishes them, where an observing station is in range; otherwise, and for the most recent hour, its values are forecasts.
Coordinates are sent with four decimal places. Open-Meteo and MET Norway map them to a cell of their model grid, so nearby locations can return identical data; Bright Sky uses forecast and observing stations within 50 km.
Data from MET Norway and from DWD (through Bright Sky) is licensed under CC BY 4.0; publishing data derived from it requires attribution to the Norwegian Meteorological Institute or Deutscher Wetterdienst respectively.
Configuration
Example
SubAgent = weather.nsm
[Weather]
Provider = openmeteo
UserAgent = AcmeMonitoring/1.0 [email protected]
Location = datacenter-hel: 60.1699, 24.9384
Location = datacenter-ams: 52.3676, 4.9041
PollInterval = 900
ForecastDays = 2
[Weather/Location/datacenter-osl]
Latitude = 59.9139
Longitude = 10.7522
Provider = metno
[Weather/Location/datacenter-fra]
Latitude = 50.1109
Longitude = 8.6821
Provider = brightsky
[Weather] Section
| Parameter | Default | Description |
|---|---|---|
|
|
Default provider: used for |
|
empty |
Open-Meteo commercial subscription key. When set, Open-Meteo requests go to the commercial hosts ( |
|
|
HTTP |
|
— |
A location in the form |
|
|
Seconds between polling rounds over all locations. Minimum 60. |
|
|
Forecast horizon in days, 1 to 16. |
|
|
Timeout for one HTTP request, in seconds. |
|
|
Also fetch ensemble forecasts for Open-Meteo locations (one extra request per location per round). Required for |
|
|
Open-Meteo ensemble model. |
[Weather/Location/NAME] Sections
Each section defines one location named NAME.
Use this form to select a provider for an individual location.
| Parameter | Description |
|---|---|
|
Latitude in decimal degrees (-90 to 90). Required. |
|
Longitude in decimal degrees (-180 to 180). Required. |
|
Provider for this location. Defaults to the |
Location entries and location sections can be mixed.
Location names are case-insensitive; sections are read after the Location entries, so a section replaces a Location entry with the same name.
Locations as Metric Instances
Every metric takes a location as its instance, in one of two forms:
-
a configured location name, for example
Weather.Temperature(datacenter-hel) -
a raw
latitude,longitudepair, for exampleWeather.Temperature(50.1109,8.6821)
A raw pair needs no configuration and uses the default provider.
The subagent starts polling it on the first request, so values become available after the next polling round, up to PollInterval seconds later.
A configured name and a raw pair with the same coordinates (to four decimal places) and the same provider share one polled entry.
The subagent polls in the background and answers metric requests from the last successful poll.
Until a location has been polled, its weather metrics (all except Weather.Provider) return an error, and a variable that the provider does not report is an error rather than 0: for example, Weather.ShortwaveRadiation on a metno location always fails.
An unknown location name is reported as no such instance.
Metrics
| Metric | Type | Description |
|---|---|---|
|
Float |
Air temperature at 2 m, °C |
|
Float |
Total cloud cover, % |
|
Float |
Global horizontal (shortwave) irradiance, W/m². Open-Meteo and Bright Sky only |
|
Float |
Direct radiation, W/m². Open-Meteo only |
|
Float |
Wind speed at 10 m, km/h |
|
Float |
Relative humidity at 2 m, %. Bright Sky forecast values carry no humidity, so on a |
|
Float |
Precipitation, mm: over the preceding 15 minutes (Open-Meteo), the next hour (MET Norway) or the previous hour (Bright Sky) |
|
Integer (64-bit) |
Seconds since the time of the current values |
|
String |
Provider serving the location |
Values are converted to the units above whatever the provider reports (MET Norway wind speed in m/s, Bright Sky solar energy in kWh/m² per hour).
List
| Metric | Description |
|---|---|
|
Names of the configured locations. Raw coordinate instances are not included. |
Tables
Weather.Forecast(location) is the forecast curve over ForecastDays days, hourly except for MET Norway’s coarser steps after about two days.
Open-Meteo and Bright Sky return whole days from 00:00 UTC, so the curve also contains the earlier hours of the current day.
| Column | Type | Description |
|---|---|---|
|
Integer (64-bit) |
Target time, UNIX timestamp (UTC) |
|
Float |
Temperature, °C |
|
Float |
Cloud cover, % |
|
Float |
Shortwave radiation, W/m² |
|
Float |
Direct radiation, W/m² |
|
Float |
Wind speed, km/h |
|
Float |
Relative humidity, % |
|
Float |
Precipitation, mm |
Cells for variables that the provider does not report are empty.
On a brightsky location, HUMIDITY is filled only for past (observed) hours.
Weather.ForecastEnsemble(location) is the hourly spread across the ensemble members of the model set in EnsembleModel.
It needs EnableEnsemble = yes and an Open-Meteo location; otherwise it returns an error.
| Column | Type | Description |
|---|---|---|
|
Integer (64-bit) |
Target time, UNIX timestamp (UTC) |
|
Float |
Shortwave radiation minimum, W/m² |
|
Float |
Shortwave radiation mean, W/m² |
|
Float |
Shortwave radiation maximum, W/m² |
|
Float |
Temperature minimum, °C |
|
Float |
Temperature mean, °C |
|
Float |
Temperature maximum, °C |
Collecting Weather Data
Collect weather data for the place where the dependent load is, at the same or a coarser polling interval as the DCIs it will be compared with. On the node whose agent loads the subagent:
-
Create a DCI with origin Agent and a metric such as
Weather.Temperature(datacenter-hel). -
To cover all configured locations at once, create the DCI with metric
Weather.Temperature({instance})and, on its instance discovery page, select method Agent List with listWeather.Locations. See Configuring Instance Discovery. -
For the forecast curve, create a table DCI with metric
Weather.Forecast(datacenter-hel).
The subagent refreshes its data every PollInterval seconds, so a DCI polling interval shorter than that only returns the same value again.
To detect that weather data has stopped updating, add a threshold on Weather.DataAge(location).
In normal operation the value stays within one hour plus PollInterval, so with the default PollInterval greater than 7200 (two hours) is a reasonable starting point.
Current values keep moving along the cached forecast while downloads fail, so the value starts to grow only when the cached forecast runs out, up to ForecastDays days after the last successful download.
Request Caching
The subagent stores the Expires and Last-Modified headers of each response.
A location whose response has not yet expired is not requested again, and a later request is conditional (If-Modified-Since), so an unchanged forecast costs a short "not modified" response.
MET Norway’s terms of service require this behaviour.
Bright Sky sends neither header, so every polling round requests each brightsky location in full.
Troubleshooting
The subagent logs with debug tag weather.
-
All weather values for a location fail (only
Weather.Providerworks) — the location has not been polled successfully yet. Check that the agent can reach the provider over HTTPS, and forbrightskythat a DWD station is within 50 km of the coordinates. For a raw coordinate instance, wait for the next polling round. -
MET Norway requests fail — set
UserAgentto an identifying value with contact information. -
One metric fails, the others work — the provider does not report that variable; see the provider table.
-
A configured location is missing from
Weather.Locations— its entry was skipped at startup (malformedLocationvalue, missing or invalidLatitude/Longitude, or unknownProvider); the agent log has a warning naming it.