how to enable performance graph on a custom service

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
lpereira
Posts: 143
Joined: Thu Jul 27, 2017 4:23 pm

how to enable performance graph on a custom service

Post by lpereira »

Hello All:
First to all, i want to apologize in advance, since English is not my native languaje :).

here is mi issue... i'm using nagios XI 5.4.7 and i suceeded in adding a custom service for disk check space. the script alerts when the space is below 10gb or 5gb (it not uses % for alerting).

The thing is... i want to have a performance graph for this new service i have added. I've tried looking around, but i did not see any solution for this.

Is there anyone who can assist on this?

I appreciate in advance any help you guys can provide

have a great day.

Luciano.
kyang

Re: how to enable performance graph on a custom service

Post by kyang »

Hi @Ipereira,

If you go to Service Detail (on the left) --> find and click on your custom service for disk space --> next to the overview tab there should be a small graph icon --> once clicked, it should show performance graphing.

You might have to change the graph time frame if your service is relatively new and not showing any information.

Does this answer your question? Let me know!
You do not have the required permissions to view the files attached to this post.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: how to enable performance graph on a custom service

Post by mcapra »

Can you share the output of your custom script executed from the CLI of your Nagios XI machine? Nagios plugins have certain criteria for reporting performance data, and It'd be useful to be sure your plugin is following that criteria:
https://nagios-plugins.org/doc/guidelines.html#AEN200
Former Nagios employee
https://www.mcapra.com/
lpereira
Posts: 143
Joined: Thu Jul 27, 2017 4:23 pm

Re: how to enable performance graph on a custom service

Post by lpereira »

kyang wrote:Hi @Ipereira,

If you go to Service Detail (on the left) --> find and click on your custom service for disk space --> next to the overview tab there should be a small graph icon --> once clicked, it should show performance graphing.

You might have to change the graph time frame if your service is relatively new and not showing any information.

Does this answer your question? Let me know!

Thanks for your quick response. please check the screenshots below... there are no graphics available for "Drive E: Disk Usage Space" and "Drive C: Disk Usage Space", those are the custom ones...
You do not have the required permissions to view the files attached to this post.
lpereira
Posts: 143
Joined: Thu Jul 27, 2017 4:23 pm

Re: how to enable performance graph on a custom service

Post by lpereira »

mcapra wrote:Can you share the output of your custom script executed from the CLI of your Nagios XI machine? Nagios plugins have certain criteria for reporting performance data, and It'd be useful to be sure your plugin is following that criteria:
https://nagios-plugins.org/doc/guidelines.html#AEN200
hi, this is the content of the .sh file
#!/bin/bash
#:set fileformat=unix

FREESPACE=`/usr/local/nagios/libexec/check_nt -H $2 -p 12489 \
-v USEDDISKSPACE -l $4 | awk -F"- " '{ print $4 }' | awk -F "|" '{ print $1 }'`

SIZE=`echo $FREESPACE | awk '{ print $2 }'`
UNIT=`echo $FREESPACE | awk '{ print $3 }'`

if [ $UNIT == "Gb" ]; then
SIZE=`echo $SIZE \* 1024 | bc`
fi

if [ `echo "$SIZE >= $6" | bc` -eq 1 ]; then
echo "$4:\ Drive Space OK - $FREESPACE"
exit 0
elif [ `echo "$SIZE < $6" | bc` -eq 1 -a `echo "$SIZE > $8" | bc` -eq 1 ]; then
echo "$4:\ Drive Space WARNING - $FREESPACE"
exit 1
elif [ `echo "$SIZE <= $8" | bc` -eq 1 ]; then
echo "$4:\ Drive Space CRITICAL - $FREESPACE"
ex
thanks for the reply
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: how to enable performance graph on a custom service

Post by scottwilkerson »

your code is missing some code, but I'll give you a snippet that might fill in the blank and give you basic perf graphing

Code: Select all

echo "$4:\ Drive Space OK - $FREESPACE|free=$SIZE"
exit 0
elif [ `echo "$SIZE < $6" | bc` -eq 1 -a `echo "$SIZE > $8" | bc` -eq 1 ]; then
echo "$4:\ Drive Space WARNING - $FREESPACE|free=$SIZE"
exit 1
elif [ `echo "$SIZE <= $8" | bc` -eq 1 ]; then
echo "$4:\ Drive Space CRITICAL - $FREESPACE|free=$SIZE"
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
lpereira
Posts: 143
Joined: Thu Jul 27, 2017 4:23 pm

Re: how to enable performance graph on a custom service

Post by lpereira »

scottwilkerson wrote:your code is missing some code, but I'll give you a snippet that might fill in the blank and give you basic perf graphing

Code: Select all

echo "$4:\ Drive Space OK - $FREESPACE|free=$SIZE"
exit 0
elif [ `echo "$SIZE < $6" | bc` -eq 1 -a `echo "$SIZE > $8" | bc` -eq 1 ]; then
echo "$4:\ Drive Space WARNING - $FREESPACE|free=$SIZE"
exit 1
elif [ `echo "$SIZE <= $8" | bc` -eq 1 ]; then
echo "$4:\ Drive Space CRITICAL - $FREESPACE|free=$SIZE"
Thanks!! i have modified the script but now i have differences on the outputs

the old one:
[root@Nagios libexec]# ./check_disk_by_size.sh -H xxx.xxx.xxx.xxx -l e -w 24000000 -c 23000000
e:\ Drive Space CRITICAL - free 234.84 Gb (7%)
the modify one:
[root@Nagios testin]# ./check_disk_by_size.sh -H Xxxx.xxx.xxx.xxx -l e -w 24000000 -c 23000000
e:\ Drive Space OK - free 234.80 Gb (7%) |free=240435.20
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: how to enable performance graph on a custom service

Post by scottwilkerson »

This new output should automatically create the graphs in Nagios XI on the performance graph tab.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
lpereira
Posts: 143
Joined: Thu Jul 27, 2017 4:23 pm

Re: how to enable performance graph on a custom service

Post by lpereira »

yes but one output says "drive OK" and the other one "Drive Critical". i have 2 different responses from the same query
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: how to enable performance graph on a custom service

Post by scottwilkerson »

lpereira wrote:yes but one output says "drive OK" and the other one "Drive Critical". i have 2 different responses from the same query
What I added didn't change anything on the script that would change that logic.

Can you post the whole file so we can see the logic in the file?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked