Page 1 of 1

Nagios won't create performace-data for plugin

Posted: Thu Feb 06, 2025 3:41 am
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!

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

Posted: Thu Feb 06, 2025 10:25 am
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