NVIDIA GPU loadable plugin
Source
p.metrics[devRegErrors].handler = handlers.WithJSONResponse(handler.GetRegisterErrors)
/*
** Zabbix
** Copyright (C) 2001-2025 Zabbix SIA
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**/
package plugin
import (
"golang.zabbix.com/plugin/nvidia/internal/plugin/handlers"
"golang.zabbix.com/plugin/nvidia/internal/plugin/params"
"golang.zabbix.com/sdk/errs"
"golang.zabbix.com/sdk/metric"
"golang.zabbix.com/sdk/plugin"
)
const (
version = "nvml.version"
driverVersion = "nvml.system.driver.version"
devGet = "nvml.device.get"
devCount = "nvml.device.count"
devTemp = "nvml.device.temperature"
devSerial = "nvml.device.serial"
devfanSpeedAVG = "nvml.device.fan.speed.avg"
devPerfState = "nvml.device.performance.state"
devEneConsumption = "nvml.device.energy.consumption"
devPowerLimit = "nvml.device.power.limit"
devPowerUsage = "nvml.device.power.usage"
devMemBar1 = "nvml.device.memory.bar1.get"
devMemFBGet = "nvml.device.memory.fb.get"
devMemErrors = "nvml.device.errors.memory"
devRegErrors = "nvml.device.errors.register"
devPciUtil = "nvml.device.pci.utilization"
devEncStats = "nvml.device.encoder.stats.get"
devVidFreq = "nvml.device.video.frequency"
devGraphFreq = "nvml.device.graphics.frequency"
devSMFreq = "nvml.device.sm.frequency"
devMemFreq = "nvml.device.memory.frequency"
devEncoderUtil = "nvml.device.encoder.utilization"
devDecoderUtil = "nvml.device.decoder.utilization"
devUtil = "nvml.device.utilization"
devEccMode = "nvml.device.ecc.mode"
)
func (p *nvmlPlugin) registerMetrics() error {
p.metrics = map[string]*nvmlMetric{
version: {
metric: metric.New(
"Returns local NVML version.",
nil,
false,
),