Poller not storing one script's data into RRD

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

Moderators: Developers, Moderators

Post Reply
mfleetwo
Posts: 9
Joined: Wed Nov 16, 2011 12:43 pm

Poller not storing one script's data into RRD

Post by mfleetwo »

Hi,

I use a number of scripts gathering data and returning to Cacti, but after editing the Data Input Method and Data Template affecting one RRD it is not being updated.

I have debugged the script and it is being run and outputting the data in the format Cacti expects. I have also enabled Poller debugging but it doesn't report reading the data or doing rrdtool update. Poller is processing other data sources though.

How do I find out why poller.php isn't processing the data for this one Data Source?

Thanks,
Mike

Script debugging for non-working "sdlengineevents" and working "schedulequeue" Data Sources:

Code: Select all

# egrep '17:25.*(sdlengineevents|schedulequeue)' /var/log/ora_stats.log
2011-11-16T17:25:08.376 [15068] argv=['/usr/local/bin/ora_stats.py', '--log=/var/log/ora_stats.log', '--', 'cacti/c4ct1@LIVE', 'schedulequeuelen', 'schedulequeuetime']
2011-11-16T17:25:08.377 [15068] Printing statistics -> schedulequeuelen:0 schedulequeuetime:0
2011-11-16T17:25:28.597 [15354] argv=['/usr/local/bin/ora_stats.py', '--log=/var/log/ora_stats.log', '--group=database', '--', 'cacti/c4ct1@LIVE', 'newsdlengineevents', 'opensdlengineevents']
2011-11-16T17:25:29.143 [15354] Printing statistics -> newsdlengineevents:114 opensdlengineevents:48
Poller.php output only showing working "schedulequeue" Data Sources:

Code: Select all

# egrep '(sdlengineevents|schedulequeue)' /tmp/poller-20111116-1725.out 
11/16/2011 05:25:31 PM - POLLER: Poller[0] Parsed MULTI output field 'schedulequeuelen:0' [map schedulequeuelen->schedulequeuelen]
11/16/2011 05:25:31 PM - POLLER: Poller[0] Parsed MULTI output field 'schedulequeuetime:0' [map schedulequeuetime->schedulequeuetime]
11/16/2011 05:25:31 PM - POLLER: Poller[0] CACTI2RRD: /usr/local/rrdtool/bin/rrdtool update /srv/www/htdocs/cacti/rra/live_schedulequeue_2908.rrd --template schedulequeuelen:schedulequeuetime 1321464301:0:0
mfleetwo
Posts: 9
Joined: Wed Nov 16, 2011 12:43 pm

Re: Poller not storing one script's data into RRD

Post by mfleetwo »

Finally got around to testing this further. Something strange is happening with cactid. Some times when testing cactid, it is not getting any output from my Data Source script:

Code: Select all

# ./cactid --readonly --stdout --verbosity=5
Host[0] DS[3229] WARNING: Result from SCRIPT not valid. Partial Result: ...
Host[0] DS[3229] SCRIPT: /usr/local/bin/ora_stats.py --log=/var/log/ora_stats.log --group=database -- cacti/c4ct1@LIVE newsdlengineevents opensdlengineevents, output: U
and at other times it seems to be working OK:

Code: Select all

# ./cactid --readonly --stdout --verbosity=5
Host[0] DS[3229] SCRIPT: /usr/local/bin/ora_stats.py --log=/var/log/ora_stats.log --group=database -- cacti/c4ct1@LIVE newsdlengineevents opensdlengineevents, output: newsdlengineevents:68 opensdlengineevents:37
but is seems to fail every time from cron. Also upgraded to the latest cactid-0.8.6k and got the same results.

Thanks,
Mike
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Poller not storing one script's data into RRD

Post by TheWitness »

Make sure that your script outputs all data at once. Spine and Cactid are both very temperamental, mainly for performance reasons. They don't wait around once you output data. So, doing the following is not supported in Cactid/Spine.

Code: Select all

echo "Name1:$Value1";
echo "Name2:$Value2\n";
The following is though:

Code: Select all

echo "Name1:$Value1 Name2:$Value2\n";
TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
mfleetwo
Posts: 9
Joined: Wed Nov 16, 2011 12:43 pm

Re: Poller not storing one script's data into RRD

Post by mfleetwo »

My script is written in Python and does produce all its output with a single print statement, thus a single OS write() call.
mfleetwo
Posts: 9
Joined: Wed Nov 16, 2011 12:43 pm

Re: Poller not storing one script's data into RRD

Post by mfleetwo »

I have finally worked out the failure case. I have created 2 data sources the same, using 2 nearly identical data templates. The only difference is the working data template (and source) uses a script as the data input method where the single input parameter is set in the data source, but the failing data template (and source) uses a script as the data input method where three input parameters are set in the template and one is set in the data source.

In the failing case the RRD is never created :-(

Manually created the RRD from the data source debug. Poller runs the script to fetch the data but never updates the DDR :-(
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Poller not storing one script's data into RRD

Post by gandalf »

Please post screenshots of data template and data input method
R.
mfleetwo
Posts: 9
Joined: Wed Nov 16, 2011 12:43 pm

Re: Poller not storing one script's data into RRD

Post by mfleetwo »

Screen shots as requested.
  • failing data template
    failing data input method
    working data input method
    working data template
Attachments
failing-data-template.png
failing-data-template.png (199.66 KiB) Viewed 1409 times
failing-data-input-method.png
failing-data-input-method.png (136.55 KiB) Viewed 1409 times
working-data-input-method.png
working-data-input-method.png (126.91 KiB) Viewed 1409 times
working-data-template.png
working-data-template.png (187.9 KiB) Viewed 1409 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Poller not storing one script's data into RRD

Post by gandalf »

Please post both "Input String"s as a whole as only parts of them are shown.
R.
mfleetwo
Posts: 9
Joined: Wed Nov 16, 2011 12:43 pm

Re: Poller not storing one script's data into RRD

Post by mfleetwo »

Input strings, failing:
/usr/local/bin/ora_stats.py --log=/var/log/ora_stats.log --group=<group> -- <oracon> <statname1> <statname2>

Working:
/usr/local/bin/ora_stats.py --log=/var/log/ora_stats.log --group=database -- <oracon> opensdlengineevents newsdlengineevents
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Poller not storing one script's data into RRD

Post by gandalf »

And how do you provide values for <group> and stuff on the non-working data input method? This should be done when creating graphs, normally
R.
mfleetwo
Posts: 9
Joined: Wed Nov 16, 2011 12:43 pm

Re: Poller not storing one script's data into RRD

Post by mfleetwo »

For the non-working case, 3 of the values are set in the Data Template (see failing-data-template.png above) and the 4th value is set in the Data Source. Debugging in my script confirms cactid passes all the parameters to my script. Enabling debugging of the poller shows it never runs rrdtool update to put the values into the RRD.

(For the working case, the only value is set in the Data Source).
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Poller not storing one script's data into RRD

Post by gandalf »

mfleetwo wrote: Also upgraded to the latest cactid-0.8.6k and got the same results.
Sorry, that this occured quite late for me. You are indeed talking about "cactid 0.8.6"? This is years old and by no means supported any longer.
We now are at the end of 087, current version is 087i. We need this version on your side to reproduce any issues that still may be hidden in the code
R.
mfleetwo
Posts: 9
Joined: Wed Nov 16, 2011 12:43 pm

Re: Poller not storing one script's data into RRD

Post by mfleetwo »

I was talking about cactid (D), the the latest version still appears to be 0.8.6k (http://www.cacti.net/downloads/cactid/).

However we are using cacti (no-D) 0.8.6i. Will upgrade to 0.8.7i and try again.
mfleetwo
Posts: 9
Joined: Wed Nov 16, 2011 12:43 pm

Re: Poller not storing one script's data into RRD

Post by mfleetwo »

Now upgraded to cacti 0.8.7i with PIA 3.1.

As an aside, I was getting this in the output from poller.php. I had to move the definition of log_cacti_stats() above its use in poller.php to fix this error. Could be because I am using an old version of php, 4.3.8.

Code: Select all

Fatal error: Call to undefined function:  log_cacti_stats() in /srv/www/htdocs/cacti/poller.php on line 379
Still get the same results from the data sources. The one with parameters split between data template and data source still executes my script correctly but never updates the RRD file.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest