Another Result from CMD not valid. Partial Result:

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
cshepherd
Posts: 37
Joined: Thu Jan 05, 2006 10:21 pm
Location: Australia

Another Result from CMD not valid. Partial Result:

Post by cshepherd »

Sorry to post about such an error, but I can't figure out what's wrong.

I've run the script from the user that runs the cron (www-data) and the output is;

Code: Select all

$ sh /usr/share/cacti/site/scripts/btstats.sh
connections:6 torrents:16$
Permissions on this file are identical to all the other scripts.
The poller cache shows the correct command.

My data source is setup as per other scripts.
Script/Command
<path_cacti>/scripts/btstats.sh
And the two output fields 'connections' and 'torrents'.

Debug gives me;

Code: Select all

09/17/2008 12:01:03 PM - CMDPHP: Poller[0] Host[4] DS[77] CMD: /usr/share/cacti/site/scripts/btstats.sh, output: U
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please make sure, that "sh" is in the $PATH of cactiuser, or, better, att /usr/bin/sh or the like to the command of the Data Input Method used. If you do so, run rebuild_poller_cache.php to apply
Reinhard
cshepherd
Posts: 37
Joined: Thu Jan 05, 2006 10:21 pm
Location: Australia

Post by cshepherd »

Ok, that's really weird. sh is in cactiuser's path and running the command from poller cache even works. I put /bin/sh in front anyway and that has fixed that issue.

I now have another problem. 'torrents' is graphing correctly, but I'm getting NaNs for 'connections'.

Here is the output from debug;

Code: Select all

09/18/2008 11:45:04 AM - CMDPHP: Poller[0] Host[4] DS[77] CMD: /bin/sh /usr/share/cacti/site/scripts/btstats.sh, output: connections:3 torrents:16
09/18/2008 11:45:04 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (77, '', '2008-09-18 11:45:03', 'connections:3 torrents:16')"
09/18/2008 11:45:05 AM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select     data_template_rrd.data_source_name,     data_input_fields.data_name     from (data_template_rrd,data_input_fields)     where data_template_rrd.data_input_field_id=data_input_fields.id     and data_template_rrd.local_data_id=77"
09/18/2008 11:45:05 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "delete from poller_output where local_data_id='77' and rrd_name='' and time='2008-09-18 11:45:03'"
09/18/2008 11:45:05 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/lib/cacti/rra/salty_tf_torrents_77.rrd --template tf_torrents 1221702303:16
So it seems that the poller is collecting the values, but I only see an rrdtool update line for 'torrents'.

Here is the output from rrdtool info;

Code: Select all

ds[tf_conns].type = "GAUGE"
ds[tf_conns].minimal_heartbeat = 600
ds[tf_conns].min = 0.0000000000e+00
ds[tf_conns].max = NaN
ds[tf_conns].last_ds = "U"
ds[tf_conns].value = NaN
ds[tf_conns].unknown_sec = 3
ds[tf_torrents].type = "GAUGE"
ds[tf_torrents].minimal_heartbeat = 600
ds[tf_torrents].min = 0.0000000000e+00
ds[tf_torrents].max = NaN
ds[tf_torrents].last_ds = "16"
ds[tf_torrents].value = 4.8000000000e+01
ds[tf_torrents].unknown_sec = 0
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Is it possible, that you've change the Data Input Method after the last change of the Data Template? Then, please "php -q rebuild_poller_cache.php"
Reinhard
cshepherd
Posts: 37
Joined: Thu Jan 05, 2006 10:21 pm
Location: Australia

Post by cshepherd »

Ok, I've deleted it all and started again. I shortened the connections to conns just in case, and I even tried swapping the output around to no avail.

My debug output looks similar, but I'm now seeing a Parsed MULTI output line which looks kind of promising, except there's only one...

Code: Select all

09/19/2008 03:08:06 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/lib/cacti/rra/salty_tf_torrents_78.rrd --template tf_torrents 1221800884:16
09/19/2008 03:08:06 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "delete from poller_output where local_data_id='78' and rrd_name='' and time='2008-09-19 15:08:04'"
09/19/2008 03:08:06 PM - POLLER: Poller[0] Parsed MULTI output field 'torrents:16' [map torrents->tf_torrents]
09/19/2008 03:08:06 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select data_template_rrd.data_source_name, data_input_fields.data_name from (data_template_rrd,data_input_fields) where data_template_rrd.data_input_field_id=data_input_fields.id and data_template_rrd.local_data_id=78"
09/19/2008 03:08:06 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_output.output, poller_output.time, poller_output.local_data_id, poller_item.rrd_path, poller_item.rrd_name, poller_item.rrd_num from (poller_output,poller_item) where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name) "
09/19/2008 03:08:06 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id=0"
09/19/2008 03:08:05 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())"
09/19/2008 03:08:05 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (78, '', '2008-09-19 15:08:04', 'torrents:16 conns:2')"
09/19/2008 03:08:05 PM - CMDPHP: Poller[0] Host[4] DS[78] CMD: /bin/sh /usr/share/cacti/site/scripts/btstats.sh, output: torrents:16 conns:2
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

cshepherd wrote:Ok, I've deleted it all and started again. I shortened the connections to conns just in case, and I even tried swapping the output around to no avail.
I'm sorry. But your explanation is not precise enough. Which resource was changed? The Data Input Method? The Data Template? Did you run the script mentioned above?
My debug output looks similar, but I'm now seeing a Parsed MULTI output line which looks kind of promising, except there's only one...
That's definitively a step ahead
Reinhard
cshepherd
Posts: 37
Joined: Thu Jan 05, 2006 10:21 pm
Location: Australia

Post by cshepherd »

By 'deleted it all' I meant graph template, data template and data input method.

Yes, I have rebuilt the poller cache every time to make sure it's correct. As in the first post, I even copied and pasted the command from the poller cache which works fine. Debug also shows that it is running the correct command.
cshepherd
Posts: 37
Joined: Thu Jan 05, 2006 10:21 pm
Location: Australia

Post by cshepherd »

Hi,

I have got around the problem by creating two scripts that output just the numbers, two data input methods and two data sources on one graph.

I don't know if this is incidental or not, but on a separate cacti install I am graphing mail queues from postfix using a script with multiple outputs. There are 6 values, and all of them are graphing except one.

It just seems a bit weird and it would be good if I could get multiple inputs working for one data input method.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

This week, there has been a bug fix that may be related. It was unveiled by watching the "System Utilities" -> View Poller Cache. If the data does not show up completely, it is likely that this patch may fix your issue
Reinhard
cshepherd
Posts: 37
Joined: Thu Jan 05, 2006 10:21 pm
Location: Australia

Post by cshepherd »

Is it possible to get a .patch for this change or do I need to get it from CVS?
I noticed I never mentioned I was running 0.8.7b with the three official patches on Ubuntu 8.04, apache2, php5.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests