Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linux plugin for nvidia-smi based checks #758

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading