Skip to content

Commit

Permalink
Add linux plugin for nvidia-smi based checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mayrstefan committed Oct 25, 2024
1 parent 541b4a9 commit f05ecb1
Show file tree
Hide file tree
Showing 7 changed files with 504 additions and 5 deletions.
27 changes: 27 additions & 0 deletions agents/plugins/nvidia_smi
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
# Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.

# Reason for this no-op: shellcheck disable=... before the first command disables the error for the
# entire script.
:

# Disable unused variable error (needed to keep track of version)
# shellcheck disable=SC2034
CMK_VERSION="2.4.0b1"

# Function to replace "if type [somecmd]" idiom
# 'command -v' tends to be more robust vs 'which' and 'type' based tests
inpath() {
command -v "${1:?No command to test}" >/dev/null 2>&1
}

main() {
if inpath nvidia-smi; then
echo '<<<nvidia_smi:sep(9)>>>'
nvidia-smi -q -x
fi
}

[ -z "${MK_SOURCE_ONLY}" ] && main
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
title: NVIDIA Graphics Card: En-/Decoder utilization
agents: windows
agents: linux, windows
catalog: os/hardware
license: GPLv2
distribution: check_mk
Expand Down
2 changes: 1 addition & 1 deletion cmk/plugins/collection/checkman/nvidia_smi_gpu_util
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
title: NVIDIA Graphics Card: GPU utilization
agents: windows
agents: linux, windows
catalog: os/hardware
license: GPLv2
distribution: check_mk
Expand Down
2 changes: 1 addition & 1 deletion cmk/plugins/collection/checkman/nvidia_smi_memory_util
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
title: NVIDIA Graphics Card: Memory utilization
agents: windows
agents: linux, windows
catalog: os/hardware
license: GPLv2
distribution: check_mk
Expand Down
2 changes: 1 addition & 1 deletion cmk/plugins/collection/checkman/nvidia_smi_power
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
title: NVIDIA Graphics Card: Power usage
agents: windows
agents: linux, windows
catalog: os/hardware
license: GPLv2
distribution: check_mk
Expand Down
2 changes: 1 addition & 1 deletion cmk/plugins/collection/checkman/nvidia_smi_temperature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
title: NVIDIA Graphics Card: Temperature
agents: windows
agents: linux, windows
catalog: os/hardware
license: GPLv2
distribution: check_mk
Expand Down
Loading

0 comments on commit f05ecb1

Please sign in to comment.