Values not beeing populated

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

Moderators: Developers, Moderators

Post Reply
Abraxasnew
Posts: 4
Joined: Thu Jun 19, 2014 10:02 am

Values not beeing populated

Post by Abraxasnew »

Hi,

I have some trouble generating graphs from a script. The logs show that the values are parsed ok, but for some reason the rrds get updated with "-nan".
I have created a Data Input Method (attached) that calls: st1.pl
#!/usr/bin/perl
use strict;

#script that the text file containing the values from the server
my $file = "/opt/st1/st_sip1";

open(my $fh, "<", $file) or die "can't open file: $!";

my @line = <$fh>;
my $st1 = $line[0]+0;
my $st2 = $line[1]+0;
my $st3 = $line[2]+0;
my $st4 = $line[3]+0;
close($fh);

print "st1:$st1 st2:$st2 st3:$st3 st4:$st4";


Executing the scritp returns the valeus ok:
perl /usr/share/cacti/site/scripts/st1.pl
st1:53 st2:242 st3:0 st4:280

Here are the cacti logs regarding these:
07/08/2014 02:45:01 PM - CMDPHP: Poller[0] Host[1] DS[102] CMD: perl /usr/share/cacti/site/scripts/st1.pl, output: st1:54 st2:181 st3:2 st4:314
07/08/2014 02:45:01 PM - POLLER: Poller[0] Parsed MULTI output field 'st1:54' [map st1->st1]
07/08/2014 02:45:01 PM - POLLER: Poller[0] Parsed MULTI output field 'st2:181' [map st2->st2]
07/08/2014 02:45:01 PM - POLLER: Poller[0] Parsed MULTI output field 'st3:2' [map st3->st3]
07/08/2014 02:45:01 PM - POLLER: Poller[0] Parsed MULTI output field 'st4:314' [map st4->st4]

07/08/2014 02:48:24 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-86400 --end=-300 --title='CallsTracker' --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit='0' --vertical-label='' --slope-mode --font TITLE:10: --font AXIS:7: --font LEGEND:8: --font UNIT:7: DEF:a='/var/lib/cacti/rra/backup_calls_103.rrd':'Calls':AVERAGE AREA:a#FF0000FF:'Calls' GPRINT:a:LAST:'Last\:%8.0lf'
07/08/2014 02:48:25 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-33053184 --end=-86400 --title='CallsTracker' --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit='0' --vertical-label='' --slope-mode --font TITLE:10: --font AXIS:7: --font LEGEND:8: --font UNIT:7: DEF:a='/var/lib/cacti/rra/backup_calls_103.rrd':'Calls':AVERAGE AREA:a#FF0000FF:'Calls' GPRINT:a:LAST:'Last\:%8.0lf'
07/08/2014 02:48:25 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-2678400 --end=-7200 --title='CallsTracker' --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit='0' --vertical-label='' --slope-mode --font TITLE:10: --font AXIS:7: --font LEGEND:8: --font UNIT:7: DEF:a='/var/lib/cacti/rra/backup_calls_103.rrd':'Calls':AVERAGE AREA:a#FF0000FF:'Calls' GPRINT:a:LAST:'Last\:%8.0lf'
07/08/2014 02:48:25 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-604800 --end=-1800 --title='CallsTracker' --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit='0' --vertical-label='' --slope-mode --font TITLE:10: --font AXIS:7: --font LEGEND:8: --font UNIT:7: DEF:a='/var/lib/cacti/rra/backup_calls_103.rrd':'Calls':AVERAGE AREA:a#FF0000FF:'Calls' GPRINT:a:LAST:'Last\:%8.0lf'

Graphs are empty, and as far as I see the RRDs get populated with "-nan":
root@backup:/var/lib/cacti/rra# rrdtool fetch backup_st1_95.rrd AVERAGE
st1

1404745200: -nan
1404745500: -nan
1404745800: -nan
1404746100: -nan
1404746400: -nan
1404746700: -nan
1404747000: -nan
1404747300: -nan
1404747600: -nan
1404747900: -nan
1404748200: -nan
1404748500: -nan
1404748800: -nan
1404749100: -nan
1404749400: -nan
1404749700: -nan
1404750000: -nan
1404750300: -nan
1404750600: -nan
1404750900: -nan
1404751200: -nan
1404751500: -nan
1404751800: -nan
1404752100: -nan
1404752400: -nan
1404752700: -nan
1404753000: -nan
1404753300: -nan
1404753600: -nan
1404753900: -nan
1404754200: -nan
1404754500: -nan
1404754800: -nan
1404755100: -nan
1404755400: -nan
1404755700: -nan
1404756000: -nan
1404756300: -nan
1404756600: -nan
1404756900: -nan
1404757200: -nan
1404757500: -nan
1404757800: -nan
1404758100: -nan
1404758400: -nan
1404758700: -nan

I kept trying to play with the values returned from the script, but so far I had no luck.
Any idea on what to do next?
Attachments
Data Template
Data Template
DataTemplate.jpg (172.81 KiB) Viewed 1142 times
DataImputM.jpg
DataImputM.jpg (110.02 KiB) Viewed 1142 times
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Values not beeing populated

Post by cigamit »

Everything looks exactly right in the screen shots and the log output. Are you seeing the lines in the log that show it updating the RRD? I also assume your not using the Boost plugin.
Abraxasnew
Posts: 4
Joined: Thu Jun 19, 2014 10:02 am

Re: Values not beeing populated

Post by Abraxasnew »

Thanks for the prompt reply.
I don't use any plugins for now, and I do see the update line (seems I missed it when providing the longs):

07/08/2014 02:45:01 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/lib/cacti/rra/backup_st4_102.rrd --template st1:st2:st3:st4 1404848701:54:181:2:314

Thank you
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Values not beeing populated

Post by cigamit »

Ok, next step in troubleshooting. What user is the owner of that particular rrd file, and what user does the poller run as?
Abraxasnew
Posts: 4
Joined: Thu Jun 19, 2014 10:02 am

Re: Values not beeing populated

Post by Abraxasnew »

They are both www-data.
I also have a bunch of standard graphs (snmp based) that work just fine.
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Values not beeing populated

Post by cigamit »

The 2 things I would try next is to take that update command and run it and see if it is giving an error (you may have to change the timestamp). Another thing I would try, since you mentioned you had been changing things around, is delete the rrd file and let it recreate it. The rrd file structure could be out of sync. When you modify data templates, etc... Cacti doesn't run rrdtune to ensure the rrd file is changed also.
Abraxasnew
Posts: 4
Joined: Thu Jun 19, 2014 10:02 am

Re: Values not beeing populated

Post by Abraxasnew »

I deleted them all and re-created, and they seem to be working fine now. Something must have been messed up when the rrds were created i guess.
Thank you for the help!
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Values not beeing populated

Post by cigamit »

NP, glad we could get it working.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest