[solved] Problem graphing multiple data inputs
Moderators: Developers, Moderators
[solved] Problem graphing multiple data inputs
I'm trying to graph ifInOctets and ifOutOctets for the network interface that doesn't have an ifIndex (go figure).
I've created a php script that returns the data correctly (afaik):
bash$> php -q 604lb_ifinout_1.php 10.1.1.2, public, 1, , , 161, 500
ifInOctets:301579232 ifOutOctets:1221487204
as well as a data template and a graph tempate.
This is the output from my cacti.log in DEBUG mode:
04/17/2008 01:20:45 PM - SYSTEM STATS: Time:43.9011 Method:cmd.php Processes:1 Threads:N/A Hosts:18 HostsPerProcess:18 DataSources:295 RRDsProcessed:213
04/17/2008 01:20:45 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd --template ifOutOctets 1208431245:1225304825
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "delete from poller_output where local_data_id='484' and rrd_name='' and time='2008-04-17 13:20:45'"
04/17/2008 01:20:45 PM - POLLER: Poller[0] Parsed MULTI output field 'ifOutOctets:1225304825' [map ifOutOctets->ifOutOctets]
04/17/2008 01:20:45 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=484"
04/17/2008 01:20:45 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) "
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id=0"
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())"
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] Time: 43.5491 s, Theads: N/A, Hosts: 17
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (484, '', '2008-04-17 13:20:45', 'ifInOctets:302653305 ifOutOctets:1225304825')"
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] Host[34] DS[484] CMD: /usr/bin/php -q /usr/local/cacti/scripts/604lb_ifinout_1.php 10.1.1.2, public, 1, , , 161, 500, output: ifInOctets:302653305 ifOutOctets:1225304825
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_reindex.data_query_id, poller_reindex.action, poller_reindex.op, poller_reindex.assert_value, poller_reindex.arg1 from poller_reindex where poller_reindex.host_id=34"
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update host set status = '3', status_event_count = '0', status_fail_date = '0000-00-00 00:00:00', status_rec_date = '0000-00-00 00:00:00', status_last_error = '', min_time = '9.99999', max_time = '151.30000', cur_time = '146.64', avg_time = '106.5055968', total_polls = '25', failed_polls = '0', availability = '100' where hostname = '10.1.1.2'"
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] Host[34] SNMP: Host responded to SNMP
As a result of the bold, only output is graphed. Input is created as "NaN".
Anything I'm obviously missing?
I've created a php script that returns the data correctly (afaik):
bash$> php -q 604lb_ifinout_1.php 10.1.1.2, public, 1, , , 161, 500
ifInOctets:301579232 ifOutOctets:1221487204
as well as a data template and a graph tempate.
This is the output from my cacti.log in DEBUG mode:
04/17/2008 01:20:45 PM - SYSTEM STATS: Time:43.9011 Method:cmd.php Processes:1 Threads:N/A Hosts:18 HostsPerProcess:18 DataSources:295 RRDsProcessed:213
04/17/2008 01:20:45 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd --template ifOutOctets 1208431245:1225304825
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "delete from poller_output where local_data_id='484' and rrd_name='' and time='2008-04-17 13:20:45'"
04/17/2008 01:20:45 PM - POLLER: Poller[0] Parsed MULTI output field 'ifOutOctets:1225304825' [map ifOutOctets->ifOutOctets]
04/17/2008 01:20:45 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=484"
04/17/2008 01:20:45 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) "
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id=0"
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())"
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] Time: 43.5491 s, Theads: N/A, Hosts: 17
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (484, '', '2008-04-17 13:20:45', 'ifInOctets:302653305 ifOutOctets:1225304825')"
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] Host[34] DS[484] CMD: /usr/bin/php -q /usr/local/cacti/scripts/604lb_ifinout_1.php 10.1.1.2, public, 1, , , 161, 500, output: ifInOctets:302653305 ifOutOctets:1225304825
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_reindex.data_query_id, poller_reindex.action, poller_reindex.op, poller_reindex.assert_value, poller_reindex.arg1 from poller_reindex where poller_reindex.host_id=34"
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update host set status = '3', status_event_count = '0', status_fail_date = '0000-00-00 00:00:00', status_rec_date = '0000-00-00 00:00:00', status_last_error = '', min_time = '9.99999', max_time = '151.30000', cur_time = '146.64', avg_time = '106.5055968', total_polls = '25', failed_polls = '0', availability = '100' where hostname = '10.1.1.2'"
04/17/2008 01:20:45 PM - CMDPHP: Poller[0] Host[34] SNMP: Host responded to SNMP
As a result of the bold, only output is graphed. Input is created as "NaN".
Anything I'm obviously missing?
- Attachments
-
- Graph image.
- dsl_lb.png (28.29 KiB) Viewed 2986 times
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="DSL Load Balancer - Ethernet Traffic" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:8: \
--font UNIT:8: \
DEF:a="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifOutOctets:AVERAGE \
DEF:b="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifOutOctets:LAST \
DEF:c="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifOutOctets:MIN \
DEF:d="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifOutOctets:MAX \
DEF:e="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifInOctets:AVERAGE \
DEF:f="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifInOctets:LAST \
DEF:g="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifInOctets:MIN \
DEF:h="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifInOctets:MAX \
CDEF:cdefa=a,8,* \
CDEF:cdefb=b,8,* \
CDEF:cdefc=c,8,* \
CDEF:cdefd=d,8,* \
CDEF:cdefe=e,8,* \
CDEF:cdeff=f,8,* \
CDEF:cdefg=g,8,* \
CDEF:cdefh=h,8,* \
AREA:cdefa#00CF00FF:"Outbound" \
GPRINT:cdefb:LAST:"Current\:%8.2lf%s" \
GPRINT:cdefc:MIN:"Minimum\:%8.2lf%s" \
GPRINT:cdefd:MAX:"Maximum\:%8.2lf%s\n" \
LINE2:cdefe#0D006AFF:"Inbound" \
GPRINT:cdeff:LAST:" Current\:%8.2lf%s" \
GPRINT:cdefg:MIN:"Minimum\:%8.2lf%s" \
GPRINT:cdefh:MAX:"Maximum\:%8.2lf%s"
RRDTool Says:
OK
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="DSL Load Balancer - Ethernet Traffic" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:8: \
--font UNIT:8: \
DEF:a="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifOutOctets:AVERAGE \
DEF:b="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifOutOctets:LAST \
DEF:c="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifOutOctets:MIN \
DEF:d="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifOutOctets:MAX \
DEF:e="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifInOctets:AVERAGE \
DEF:f="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifInOctets:LAST \
DEF:g="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifInOctets:MIN \
DEF:h="/usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd":ifInOctets:MAX \
CDEF:cdefa=a,8,* \
CDEF:cdefb=b,8,* \
CDEF:cdefc=c,8,* \
CDEF:cdefd=d,8,* \
CDEF:cdefe=e,8,* \
CDEF:cdeff=f,8,* \
CDEF:cdefg=g,8,* \
CDEF:cdefh=h,8,* \
AREA:cdefa#00CF00FF:"Outbound" \
GPRINT:cdefb:LAST:"Current\:%8.2lf%s" \
GPRINT:cdefc:MIN:"Minimum\:%8.2lf%s" \
GPRINT:cdefd:MAX:"Maximum\:%8.2lf%s\n" \
LINE2:cdefe#0D006AFF:"Inbound" \
GPRINT:cdeff:LAST:" Current\:%8.2lf%s" \
GPRINT:cdefg:MIN:"Minimum\:%8.2lf%s" \
GPRINT:cdefh:MAX:"Maximum\:%8.2lf%s"
RRDTool Says:
OK
Is this plausibly a problem?
rrdtool info dsl_load_balancer_ifinoctets_484.rrd
filename = "dsl_load_balancer_ifinoctets_484.rrd"
rrd_version = "0003"
step = 300
last_update = 1208780457
ds[ifInOctets].type = "COUNTER"
ds[ifInOctets].minimal_heartbeat = 600
ds[ifInOctets].min = 0.0000000000e+00
ds[ifInOctets].max = NaN
ds[ifInOctets].last_ds = "U"
ds[ifInOctets].value = NaN
ds[ifInOctets].unknown_sec = 57
ds[ifOutOctets].type = "COUNTER"
ds[ifOutOctets].minimal_heartbeat = 600
ds[ifOutOctets].min = 0.0000000000e+00
ds[ifOutOctets].max = NaN
ds[ifOutOctets].last_ds = "1674434857"
ds[ifOutOctets].value = 3.9105948506e+06
ds[ifOutOctets].unknown_sec = 0
Why does it show "U" when the query returns the correct result (as above)?
rrdtool info dsl_load_balancer_ifinoctets_484.rrd
filename = "dsl_load_balancer_ifinoctets_484.rrd"
rrd_version = "0003"
step = 300
last_update = 1208780457
ds[ifInOctets].type = "COUNTER"
ds[ifInOctets].minimal_heartbeat = 600
ds[ifInOctets].min = 0.0000000000e+00
ds[ifInOctets].max = NaN
ds[ifInOctets].last_ds = "U"
ds[ifInOctets].value = NaN
ds[ifInOctets].unknown_sec = 57
ds[ifOutOctets].type = "COUNTER"
ds[ifOutOctets].minimal_heartbeat = 600
ds[ifOutOctets].min = 0.0000000000e+00
ds[ifOutOctets].max = NaN
ds[ifOutOctets].last_ds = "1674434857"
ds[ifOutOctets].value = 3.9105948506e+06
ds[ifOutOctets].unknown_sec = 0
Why does it show "U" when the query returns the correct result (as above)?
The update statement is in my initial post:
04/17/2008 01:20:45 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd --template ifOutOctets 1208431245:1225304825
That is all that is ever logged.
Below is my poller cache.
To summarise, the output from the script shows ifInOctets. ifInOctets gets logged in the database, but makes it no further than that.
04/17/2008 01:20:45 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd --template ifOutOctets 1208431245:1225304825
That is all that is ever logged.
Below is my poller cache.
To summarise, the output from the script shows ifInOctets. ifInOctets gets logged in the database, but makes it no further than that.
- Attachments
-
- poller_cache.jpg (63.86 KiB) Viewed 2814 times
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
This shows, that tehre is an error with a previous step. The rrdtool update should update both data sources of that rrd file; currentyl it updates only the ifOutOctets. So please verify the first steps of my Debug instructions to find that errornvdm wrote:The update statement is in my initial post:
04/17/2008 01:20:45 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/local/cacti/rra/dsl_load_balancer_ifinoctets_484.rrd --template ifOutOctets 1208431245:1225304825
That is all that is ever logged.
Below is my poller cache.
To summarise, the output from the script shows ifInOctets. ifInOctets gets logged in the database, but makes it no further than that.
Reinhard
By stepping through the log file manually and executing each of the SQL commands by hand, I think I've found something that might be causing the problem:
mysql> 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=484;
+------------------+-------------+
| data_source_name | data_name |
+------------------+-------------+
| ifOutOctets | ifOutOctets |
+------------------+-------------+
1 row in set (0.00 sec)
Should this not contain ifInOctets too?
mysql> 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=484;
+------------------+-------------+
| data_source_name | data_name |
+------------------+-------------+
| ifOutOctets | ifOutOctets |
+------------------+-------------+
1 row in set (0.00 sec)
Should this not contain ifInOctets too?
Who is online
Users browsing this forum: No registered users and 2 guests