Nagios won't create performace-data for plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
johnburr
Posts: 1
Joined: Thu Feb 06, 2025 3:39 am

Nagios won't create performace-data for plugin

Post by johnburr »

Hello,
I made a bash script for Nagios to test with Nagiosgraph. Rrd files are however not being created for this script. Default plugins that come with Nagios work well with Nagiosgraph and rrd files of those plugins are also present.

Here is the script:

Code: Select all

#!/bin/bash

checkgpu=$( nvidia-smi --format=csv --query-gpu=utilization.gpu | awk '/[[:digit:]]+[[:space:]]%/ { tot+=$1;cnt++ } END { print tot/cnt }' | cut -d$

output="Load Average: $checkgpu"

if [ $checkgpu -ge 0 ]
then
    echo "OK- $output"
    exit 0
elif [ $checkgpu -eq 101 ]
then
    echo "WARNING- $output"
    exit 1
elif [ $checkgpu -eq 102 ]
then
    echo "CRITICAL- $output"
    exit 2
else
echo "UNKNOWN- $output"
exit 3
fi
What should i do to make this script work with Nagiosgraph/Performance data ?
Thanks in advance!
Last edited by steal a brainrot a week ago
DoubleDoubleA
Posts: 286
Joined: Thu Feb 09, 2017 5:07 pm

Re: Nagios won't create performace-data for plugin

Post by DoubleDoubleA »

Hi @johnburr,

Your plugin is not as yet written to pass performance data. Please see the docs on plugin output here https://nagios-plugins.org/doc/guidelin ... PLUGOUTPUT .

Aaron
Post Reply