No performance graphs were found for this service.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
EOCulubong
Posts: 10
Joined: Fri Nov 13, 2015 9:49 am

No performance graphs were found for this service.

Post by EOCulubong »

Hi Guys,

Good evening. I am just starting to learn nagios and here is what I am having problems now. Hope someone could help me.

I am having problems with this script that I am using. I am trying to use rawNumbers.php on nagvis, but nagvis gives me an Error state.

I tried to read and search for answers, but it is true that in order for rawNumbers.php to work is to have the service collecting perfdata? Or is there any other way I can be able to display the output properly in nagvis.

Below is the scrip that I am using:

Code: Select all

#!/bin/bash

# Return codes:
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3

# Arguments:
WARNLEVEL=$1
CRITLEVEL=$2

STATS=$(/opt/ardome/bin/derivemgr stats | awk "END{print;exit}" | awk '{ print substr( $2, 0 ) }')


if [ $STATS -lt $WARNLEVEL ]
then
  echo "OK: Derived Stats - $STATS"
  exitstatus=$STATE_OK
  exit $exitstatus
elif [ $STATS -lt $CRITLEVEL -a $STATS -gt $WARNLEVEL ]
then
  echo "WARNING: Derived Stats - $STATS"
  exitstatus=$STATE_WARNING
  exit $exitstatus
elif [ $STATS -gt $CRITLEVEL ]
then
  echo "CRITICAL: Derived Stats $STATS"
  exitstatus=$STATE_CRITICAL
  exit $exitstatus
fi
The code works, below is the sample output of the command:

OK: Derived Stats - 307


I just want to have the result of the script "307" in this example to be displayed on nagvis.

Thanks and Regards,
Del
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: No performance graphs were found for this service.

Post by mcapra »

If all you need is for the script to provide performance data, the nagios plugin development guidelines have a section dedicated to performance data.

Essentially you'd need to modify your plugin's output to look something like this:

Code: Select all

OK: Derived Stats - 307 | stats=307
Former Nagios employee
https://www.mcapra.com/
kyang

Re: No performance graphs were found for this service.

Post by kyang »

Thanks @mcapra!

@EOculubong, take a look at the links. What mcapra said, is what you'd need to have in order to make perf graphs show for that service.
EOCulubong
Posts: 10
Joined: Fri Nov 13, 2015 9:49 am

Re: No performance graphs were found for this service.

Post by EOCulubong »

Hi Guys,

Thanks for the info, will definitely check the links.

Regards,
Del
EOCulubong
Posts: 10
Joined: Fri Nov 13, 2015 9:49 am

Re: No performance graphs were found for this service.

Post by EOCulubong »

Hi @mcapra and @kyang,

It works, I just changed my script to this:

Code: Select all

STATS=$(/opt/ardome/bin/derivemgr stats | awk "END{print;exit}" | awk '{ print substr( $2, 0 ) }')


if [ $STATS -lt $WARNLEVEL ]
then
  echo "OK: Derived Stats - $STATS | stats=$STATS"
  exitstatus=$STATE_OK
  exit $exitstatus
elif [ $STATS -lt $CRITLEVEL -a $STATS -gt $WARNLEVEL ]
then
  echo "WARNING: Derived Stats - $STATS | stats=$STATS"
  exitstatus=$STATE_WARNING
  exit $exitstatus
elif [ $STATS -gt $CRITLEVEL ]
then
  echo "CRITICAL: Derived Stats $STATS | stats=$STATS"
  exitstatus=$STATE_CRITICAL
  exit $exitstatus
fi
Thanks and Regards,
Del
kyang

Re: No performance graphs were found for this service.

Post by kyang »

Great to hear! Do you have any more questions?

Or are we okay to close this topic?
EOCulubong
Posts: 10
Joined: Fri Nov 13, 2015 9:49 am

Re: No performance graphs were found for this service.

Post by EOCulubong »

Hi @kyang none so far.

We can close this topic now.

Thanks again. :D
kyang

Re: No performance graphs were found for this service.

Post by kyang »

Sounds great! I'll be closing this topic as resolved!

If you have any more questions, feel free to create another thread!

Thank you for using the Nagios Support Forum!
Locked