Custom script producing NaN

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
mangledspine
Posts: 9
Joined: Fri Nov 11, 2005 1:43 pm

Custom script producing NaN

Post by mangledspine »

I have MySQL 3.23.58, cacti 0.8.6f running cactid 0.8.6e as a poller, on Redhat as an operating system at work.

I have a custom PERL script that produces MySQL statistics output such as this:

Questions:211618 Slow_queries:4 Bytes_received:49871619 Bytes_sent:1580618 Threads_cached:1 Threads_created:3 Threads_connected:2 Threads_running:2

Of course that is all on one line with a newline character at the end.

I have a graph that displays Bytes_sent vs Bytes_received . All my other graphs (for example, number of Questions/Queries) display fine. With Bytes Sent/Recv I get NaN errors. I'm not sure if I'm doing something incorrectly or if in fact it is a bug with the poller or graphing software in general. I have double and triple checked my data sources, poller cache, script output and logfile for the correct output.

I use this PERL script on my home for cacti 0.8.6g/cmd.php as a poller/FreeBSD 5.4 and everything works great.

What can I check/fix to make sure this graph works properly?

Thanks
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Yikes, thats one old version of MySQL...

When you turn the polling level to debug for a cycle, do you see your script being run and returning anything?

You're running cactid at work and cmd.php at home, thats another possible reason why you've got problems. Try cactid 0.8.6f-1 and see if that fixes it.
mangledspine
Posts: 9
Joined: Fri Nov 11, 2005 1:43 pm

Post by mangledspine »

BSOD:

Yes, it is returning information in both the command line and the cacti log file.

What seems peculiar is that all the other MySQL graphs are producing output.

I cannot upgrade this installation of Cacti just yet, although that is on my plate for a few weeks down the line. I am just in the process of reviewing any of the graphs we have installed here and putting in new ones before we think about upgrading Cacti as a whole.

Can you offer any other advice? Things I should check, workarounds I can apply?

Thanks.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Make sure you test the script as the user running the poller. There is probably some path or permission issue you are not seeing as the users you are logged in as.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
mangledspine
Posts: 9
Joined: Fri Nov 11, 2005 1:43 pm

Post by mangledspine »

Well, you know how sudo goes. I don't know the password (yet) for the user who owns all the files. :)

At any rate, I ran the poll in debug just in case a second time, and I see that the script is outputting everything I've requested of it AND the insert statement is inserting that entire line into the RRD file.
mangledspine
Posts: 9
Joined: Fri Nov 11, 2005 1:43 pm

Post by mangledspine »

FWIW, I am running the MYSQL MONITORING PERL script that is out and about on thse forums, with a little enhancement: Instead of just contacting one server with the script, I have modified it to accept command line parameters based on variables like <hostname> and <user> and <password> (those two I'v defined myself).

Would this have any effect on having multiple graphs that use the same mysql script, but just display different values (mysql threads, cache variables, number of queries)?
mangledspine
Posts: 9
Joined: Fri Nov 11, 2005 1:43 pm

Post by mangledspine »

An update:

When I use the rrdtool dump function on the rrd file that is tracking this particular graph, I do see values in the correct places (and I've verified those numbers against the PERL script output). I don't know what else to check, but would anyone have any ideas?
mangledspine
Posts: 9
Joined: Fri Nov 11, 2005 1:43 pm

Post by mangledspine »

After some hairpulling, I think I have fixed this issue. thanks to the debugging links on the
graph in question, I was able to see that the graph was using the wrong rrd file. I guess it does get confusing when the rrd files are named relatively the same and they are all using the same script.

Thanks everyone for your help.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests