Problem getting data from script...

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
kalto
Posts: 4
Joined: Thu Apr 08, 2004 9:42 pm

Problem getting data from script...

Post by kalto »

I'm having trouble getting 2 scripts to work, apachehits.pl and weatherbug.pl.

The scripts themselve work well, the problem comes cmd.php tries to update it's rrd. Here's cmd.php output concerning these two scripts:

Code: Select all

MULTI command: /usr/bin/perl /home/www/sysinfo/cacti-0.8.5a/scripts/weatherbug.pl, output: current_temp:5 wind_speed:9 gust_wind_speed:9 barometer:101253 humidity:60 high_temp:5 low_temp:5 dew_point_temp:2 wind_chill_temp:3
MULTI expansion: found fieldid: 37, found rrdname: current_temp, value: 5
MULTI expansion: found fieldid: 38, found rrdname: , value: 9
MULTI expansion: found fieldid: 39, found rrdname: , value: 101253
MULTI expansion: found fieldid: 40, found rrdname: , value: 60
MULTI expansion: found fieldid: 41, found rrdname: high_temp, value: 5
MULTI expansion: found fieldid: 42, found rrdname: low_temp, value: 5
MULTI expansion: found fieldid: 43, found rrdname: , value: 2
MULTI expansion: found fieldid: 44, found rrdname: , value: 3
MULTI command: /usr/bin/perl /home/www/sysinfo/cacti-0.8.5a/scripts/apachehits.pl, output: request_sec:.0257 request_proc:1
MULTI expansion: found fieldid: 45, found rrdname: request_sec, value: .0257
MULTI expansion: found fieldid: 46, found rrdname: request_proc, value: 1
(some output)
update /home/www/sysinfo/cacti-0.8.5a/rra/current_temp_96.rrd --template current_temp::high_temp:low_temp N:5:3:5:5
ERROR: Template contains more DS definitions than RRD
update /home/www/sysinfo/cacti-0.8.5a/rra/apache_request_sec_99.rrd --template request_sec:request_proc N:.0257:1
ERROR: Template contains more DS definitions than RRD
And here's the data source debug of each:

Weatherbug (look at cmd.php's output, it output 4 values, one not named and not asked for either...)

Code: Select all

/usr/local/bin/rrdtool create \
/home/www/sysinfo/cacti-0.8.5a/rra/current_temp_96.rrd \
--step 300  \
DS:low_temp:GAUGE:600:0:100 \
DS:current_temp:GAUGE:600:0:U \
DS:high_temp:GAUGE:600:0:100 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
Apachehits.pl

Code: Select all

/usr/local/bin/rrdtool create \
/home/www/sysinfo/cacti-0.8.5a/rra/apache_request_sec_99.rrd \
--step 300  \
DS:request_sec:GAUGE:600:0:U \
DS:request_proc:GAUGE:600:0:100 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
From here, everything is ok, but rrdtool doesn't seem to share my point of view :P If any1 has a hint...

Also, concerning Weatherbug.pl, when using metrics value, it strips the minus sign before the temperature, like "-2°" will output as "2". I'm not really familiar with regexp, so, any1 knows how the script could be modified to keep that - ? I'd really appreciate ;)
kalto
Posts: 4
Joined: Thu Apr 08, 2004 9:42 pm

Post by kalto »

Finally fixed it... had to specify all output field, and remove the check from the "Update rrd files" for the field you don't plan to use...


Haven't resolved my problem with weatherbug.pl tough... again, if any1 could give me some hint... i'd really appreciate
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests