Size limits with script output in a data input method?

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

Moderators: Developers, Moderators

Post Reply
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Size limits with script output in a data input method?

Post by niobe »

I have a script that has stopped working after adding more data items.

My script now outputs 57 variables in around 1300 characters. I am wondering if I have hit some internal limit with the size of script output. Rrdtool generates a graph but there are only NaNs in the RRD. A debug of the poller showed this which seems to support my theory:

Code: Select all

03/17/2011 10:43:02 PM - SPINE: Poller[0] Host[1906] TH[1] DS[90596] SCRIPT: tclsh /var/www/cacti/scripts/bind96-stats.tcl -h 10.203.1.10 -u netman, output: 0 
The script works perfectly when run from the command line, and the poller is not complaining at all, but the output is just "0"!

Can anyone tell me what the limits are for script output? Or is there possibly a limit on number of data items?

cheers,

N
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Re: Size limits with script output in a data input method?

Post by niobe »

Well I did some testing. This is bizarre, but it seems there is a hard limit of 1121 characters in script output!
I don't know where this value comes from, or if the limit is in spine or elsewhere, but it's quite odd.
The limit doesn't seem to be related to number of data items at all. To be under 1121 chars I can only have around 48 data items at the moment, but I can get that higher by shortening the variable names in the output.

Would be nice if a Cacti dev can confirm this limit, and if there's an easy workaround!

cheers,

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

Re: Size limits with script output in a data input method?

Post by rony »

There is a limit to the input buffer on spine. There is a ./configure option to increase it, I would strongly suggest doing that.
[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]
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Re: Size limits with script output in a data input method?

Post by niobe »

Thanks Rony, will give it a try.
At the moment I've worked around the problem by allowing the scripts to output 3 different sets of results based on a cmd line switch.
The downside is the script has to be executed 3 times per host - 1 per graph, so its a little inefficient.
By the way, is the cacti poller clever enough to update data items only once if they occur in multiple graphs?
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Re: Size limits with script output in a data input method?

Post by rony »

Clever...

Depends on your data source and input method setup, not the graphs...
[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]
tarre
Posts: 12
Joined: Wed Mar 05, 2008 6:15 am

Re: Size limits with script output in a data input method?

Post by tarre »

rony wrote:There is a limit to the input buffer on spine. There is a ./configure option to increase it, I would strongly suggest doing that.
Nice hit! this was driving me crazy :)

I got this from Spine detailed output in cLog:
SPINE: Poller[1] ERROR: SS[1] The Script Server result was longer than the acceptable range

I found that the error came from spine:
https://github.com/resmon/resmon-spine/ ... ster/php.c (Line 251).

Following your advice, i double check the Spine ./configure options, and there it is :)
$> ./configure --with-results-buffer=2048

* Results buffer defaults to 1024

$> make && make install && echo "all works as expected, spine limit doesnt stop me now"


Lot of thanks and regards,
Dani
tarre
Posts: 12
Joined: Wed Mar 05, 2008 6:15 am

Re: Size limits with script output in a data input method?

Post by tarre »

tarre wrote:
rony wrote:There is a limit to the input buffer on spine. There is a ./configure option to increase it, I would strongly suggest doing that.
Nice hit! this was driving me crazy :)

I got this from Spine detailed output in cLog:
SPINE: Poller[1] ERROR: SS[1] The Script Server result was longer than the acceptable range

I found that the error came from spine:
https://github.com/resmon/resmon-spine/ ... ster/php.c (Line 251).

Following your advice, i double check the Spine ./configure options, and there it is :)
$> ./configure --with-results-buffer=2048

* Results buffer defaults to 1024

$> make && make install && echo "all works as expected, spine limit doesnt stop me now"


Lot of thanks and regards,
Dani
I have face again this "limit" problem.
It seems not only spine impose limits, also Operative System, php, and so...

Finally i had to reduce my Script return output in order to get it working with 64 Data Sources.

Output looks like: "d_00:0 d_01:0 d_02:1" and so on.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Size limits with script output in a data input method?

Post by netniV »

tarre wrote:I got this from Spine detailed output in cLog:
SPINE: Poller[1] ERROR: SS[1] The Script Server result was longer than the acceptable range

I found that the error came from spine:
https://github.com/resmon/resmon-spine/ ... ster/php.c (Line 251).
It should be noted that the official spine repo is actually at
https://github.com/cacti/spine
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest