"rrdtool create" fails to create .rrd file

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

Moderators: Developers, Moderators

Post Reply
gigglesworth
Posts: 24
Joined: Wed Jan 25, 2006 12:51 pm

"rrdtool create" fails to create .rrd file

Post by gigglesworth »

I am trying to set up some new graphs in Cacti. When I try to setup the Data Sources, Cacti or rrdtool is not creating the .rrd files like I expect.

I defined a very simple test using the ping.pl Data Input Method, to a host "webdev2.example.com".

If I go to Data Sources for this host, and turn on "Data Source Debug Mode", I see the following debug output:

Code: Select all

Data Source Debug

/usr/bin/rrdtool create \
/srv/www/htdocs/cacti/rra/webdev2_example_com_ping_211.rrd \
--step 300  \
DS:ping:GAUGE:600:0:5000 \
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 \
There is a backslash on the last line of the output. It seems like this backslash prevents rrdtool from actually creating the file.

Likewise, if I go to Graph Management for this host and turn on "Graph Debug Mode", rrdtool cannot find the file:

Code: Select all

 RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-108000 \
--end=-300 \
--title="webdev2.example.com - Ping Latency" \
--base=1000 \
--height=120 \
--width=600 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="milliseconds" \
DEF:a="/srv/www/htdocs/cacti/rra/webdev2_example_com_ping_211.rrd":ping:AVERAGE \
AREA:a#FF0000:"Ping Round Trip Time"  \
GPRINT:a:LAST:"Current\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"  \
COMMENT:"\n"  \
COMMENT:"Graph last updated on Wed 25 Jan 10:15:09 PST 2006" 

RRDTool Says:

ERROR: opening '/srv/www/htdocs/cacti/rra/webdev2_example_com_ping_211.rrd': No such file or directory
I am new to Cacti and am completely stuck. I appreciate any help!
gigglesworth
Posts: 24
Joined: Wed Jan 25, 2006 12:51 pm

Post by gigglesworth »

In addition, I set the logfile to "DEBUG" mode, setup a new set of tests to ping www.google.com.

There the string "rrdtool create" never appears cacti.log. There are plenty of "rrdtool update" statements for the graphs which ARE functioning.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Look at

Code: Select all

ERROR: opening '/srv/www/htdocs/cacti/rra/webdev2_example_com_ping_211.rrd': No such file or directory 
Is the file there? Permissions? See your httpd error_log for file access problems!
Otherwise: "su" to your cactiuser, copy your rrdtool create statement to command line and run from there. Watch out for errors
Reinhard
gigglesworth
Posts: 24
Joined: Wed Jan 25, 2006 12:51 pm

Post by gigglesworth »

The file /srv/www/htdocs/cacti/rra/webdev2_example_com_ping_211.rrd does not exist. However, I believe that this is because the "rrdtool create" command does not actually create the file due to that hanging backslash.

I can run the command without error, as the user 'cacti' if I remove the hanging backslash. However, this simply creates a rrdfile and an empty graph image -- the image contains the basic grid, comment, ping times across the bottom, etc but nothing is being graphed.

This tells me that the "rrdtool create" command which I mentioned previously is incomplete-- something is missing.
Halfwalker
Posts: 18
Joined: Tue Jan 24, 2006 6:11 pm

Post by Halfwalker »

I can corroborate this - I've seen it several times here.

D.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

gigglesworth wrote:The file /srv/www/htdocs/cacti/rra/webdev2_example_com_ping_211.rrd does not exist. However, I believe that this is because the "rrdtool create" command does not actually create the file due to that hanging backslash.
This trailing backslash is always there, don't worry. If you created it manually and it does not get updated, I bet there's something wrong concerning "downed host detection". SO please: Settings->Logging Level set to DEBUG. Run this for at least one polling cycle and post the log/cacti.log. Don't forget to reset the Logging Level (prduces lots of output).
Please goto Devices and tell us about the status of that device.
Reinhard
gigglesworth
Posts: 24
Joined: Wed Jan 25, 2006 12:51 pm

Post by gigglesworth »

Thank you for your offer of help.

I created a new test for this... a test of www.google.com using 'Ping Latency'. It works from the commandline:

Code: Select all

# perl cacti/scripts/ping_latency.pl www.google.com
roundtrip:11 packetloss:0
Please goto Devices and tell us about the status of that device.

The status is 'Down':

Code: Select all

Description 	Status 	Hostname 	Current (ms) 	Average (ms) 	Availability
Google Ping   	Down  	www.google.com  	0  	0  	0%
Here is part of the logfile. The logfile itself is over 800-lines long, so I'll only include the first couple dozen lines and several seconds around "Google"

Code: Select all

01/27/2006 12:45:09 PM - CMDPHP: Poller[0] DEBUG: SQL Cell: "select count(*) from poller_item"
01/27/2006 12:45:09 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select id from host where disabled = '' order by id"
01/27/2006 12:45:09 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "replace into settings (name,value) values ('path_webroot','/srv/www/htdocs/cacti')"
01/27/2006 12:45:09 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "truncate table poller_time"
01/27/2006 12:45:09 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /srv/www/htdocs/cacti/cmd.php 0 35]
01/27/2006 12:45:10 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "replace into settings (name,value) values ('date',NOW())"
01/27/2006 12:45:10 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
01/27/2006 12:45:10 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)"
01/27/2006 12:45:11 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
01/27/2006 12:45:11 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)"
01/27/2006 12:45:12 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select * from host where (disabled = '' and id >= 0 and id <= 35) ORDER by id"
01/27/2006 12:45:12 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "SELECT * from poller_item WHERE (host_id >= 0 and host_id <= 35) ORDER by host_id"
01/27/2006 12:45:12 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
01/27/2006 12:45:12 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)"
01/27/2006 12:45:12 PM - CMDPHP: Poller[0] DEBUG: SQL Cell: "SELECT count(*) from poller_item WHERE (action=2 AND (host_id >= 0 and host_id <= 35))"
01/27/2006 12:45:12 PM - CMDPHP: Poller[0] Host[1] SNMP: Device does not require SNMP
01/27/2006 12:45:12 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 = '0.00000',  max_time = '0.00000',  cur_time = '0',  avg_time = '0',  total_polls = '14',  failed_polls = '0',  availability = '100'  where hostname = '127.0.0.1'"
01/27/2006 12:45:12 PM - CMDPHP: Poller[0] Host[1] No host availability check possible for '127.0.0.1'.
01/27/2006 12:45:12 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=1"
01/27/2006 12:45:12 PM - CMDPHP: Poller[0] Host[1] DS[3] CMD: perl /srv/www/htdocs/cacti/scripts/linux_memory.pl MemFree:, output: 2516

>>> SNIP <<<
01/27/2006 12:46:47 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
01/27/2006 12:46:47 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)"
01/27/2006 12:46:47 PM - CMDPHP: Poller[0] Host[31] SNMP: Host did not respond to SNMP
01/27/2006 12:46:47 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update host set  status = '1',  status_event_count = '13',  status_fail_date = '0000-00-00 00:00:00',  status_rec_date = '0000-00-00 00:00:00',  status_last_error = 'Host did not respond to SNMP',  min_time = '9.99999',  max_time = '0.00000',  cur_time = '0.00000',  avg_time = '0.00000',  total_polls = '14',  failed_polls = '14',  availability = '0'  where hostname = 'HOST3.REMOVED2.com'"
01/27/2006 12:46:48 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
01/27/2006 12:46:48 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)"
01/27/2006 12:46:49 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
01/27/2006 12:46:49 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)"
01/27/2006 12:46:49 PM - CMDPHP: Poller[0] Host[35] SNMP: Host did not respond to SNMP
01/27/2006 12:46:49 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update host set  status = '1',  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 = 'Host did not respond to SNMP',  min_time = '9.99999',  max_time = '0.00000',  cur_time = '0.00000',  avg_time = '0.00000',  total_polls = '1',  failed_polls = '1',  availability = '0'  where hostname = 'www.google.com'"
01/27/2006 12:46:49 PM - CMDPHP: Poller[0] Time: 96.6888 s, Theads: N/A, Hosts: 28
01/27/2006 12:46:49 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())"
01/27/2006 12:46:50 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
01/27/2006 12:46:50 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)"
01/27/2006 12:46:50 PM - SYSTEM STATS: Time:100.6011 Method:cmd.php Processes:1 Threads:N/A Hosts:29 HostsPerProcess:29 DataSources:166 RRDsProcessed:76
01/27/2006 12:46:50 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "replace into settings (name,value) values ('stats_poller','Time:100.6011 Method:cmd.php Processes:1 Threads:N/A Hosts:29 HostsPerProcess:29 DataSources:166 RRDsProcessed:76')"
01/27/2006 12:46:50 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "truncate table poller_output"
01/27/2006 12:46:50 PM - CMDPHP: Poller[0] DEBUG: SQL Cell: "select count(*) from poller_command"

User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Code: Select all

01/27/2006 12:46:47 PM - CMDPHP: Poller[0] Host[31] SNMP: Host did not respond to SNMP
So your host is configured for SNMP availabilty check but does not respond to that. As google won't respond to SNMP requests and as you won't need them, please clear the community string for that Device.
You may want to change Settings -> Downed Host Detection. I recommend using "SNMP - Reliable":
- Using PING/ICMP required poller running as root
- Using PING/UDP often produces problems with firewalls because of the UDP port used
If you have "SNMP - Reliable", you will be able to check SNMP aware hosts (e.g. on your LAN) when using the correct SNMP community string.
Reinhard
gigglesworth
Posts: 24
Joined: Wed Jan 25, 2006 12:51 pm

Post by gigglesworth »

Ah! Thanks. I did not realize that an SNMP Community would automatically trigger an SNMP test. I thought this was just executing a shell command.

I was able to fix my problems with your solution. Thank you!
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests