Absolute graphs?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
kadu
Posts: 2
Joined: Tue Dec 14, 2010 12:06 pm

Absolute graphs?

Post by kadu »

Hi All,

I'm new to developing nagios plugins, have recently created my first one (http://exchange.nagios.org/directory/Pl ... rs/details) and now I'm trying to add graph functionality to it.

After adding perf data to my script output and creating an entry on the nagiosgraph map file I now have a graph, my problem is this is not absolute (not sure that's the correct term), I'll try to clarify it.

The plugin collects the number of current listeners on a shoutcast server, so it will return a "whole number" (1, 5, 9, etc...) but for some reason the graphs are been built with decimal values inside it. I'm new to RRD as well but I'm there's some setting on the rrd file that can change this.

I've attached a screenshoot where you can see the values are decimals, you can see the CUR value is 2.78 how can I have 2.78 listeners?

All I want is for the graph to show "whole numbers" ONLY.

Let me know if you need to see any more details on this, any help is much appreciated.

Regards
Kadu
Attachments
Listeners graph
Listeners graph
gkrellShoot_2010-12-14_172439.jpg (27.84 KiB) Viewed 2074 times
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Absolute graphs?

Post by mguthrie »

I'm not a pro with PNP, but my guess would be that if you need whole numbers (integers) on your graph, make sure all of your units of measurement in the performance data are using integers. In strongly typed programming languages you have you change integers to floating (decimal) numbers in order to use them together. I think PNP makes mention of number/data types on their developer guidelines, I would check their website for more detailed documentation.

Cool plugin idea by the way ; )
kadu
Posts: 2
Joined: Tue Dec 14, 2010 12:06 pm

Re: Absolute graphs?

Post by kadu »

Thanks for your response,

Unfortunately not entirely sure what you mean here. What does PNP stands for?

As far as my plugin goes it always return a whole number in the perf data

SHOUTCAST OK - 5 out of 100 listeners on port 8128 | Listeners=5;100

Kadu
Locked