[solved] create a graph based on the output of a script?

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

Moderators: Developers, Moderators

Post Reply
leoh
Posts: 30
Joined: Thu Feb 05, 2009 8:55 am

[solved] create a graph based on the output of a script?

Post by leoh »

I have found many tutorials in the internet but it still does not work.

Here is the steps that I have followed:


1 - Created a script (attached) and here is the output (input: IP of NTP Server)

# ./ntpdateq_mrtg.pl 10.100.0.100
offset: 1423688

2 - Create a Data Input Method (attached image)

3 - Create a Data Source
At this point, debug shows an error

"Notice: Undefined index: in /opt/cacti/lib/rrd.php on line 225"



This is the first problem that I am facing. How to solve it?

ps: logs shows no lines with ntpdateq_mrtg.pl text.
Attachments
data_source_detail.gif
data_source_detail.gif (26.57 KiB) Viewed 2065 times
data_source_debug.gif
data_source_debug.gif (4.22 KiB) Viewed 2065 times
data_source.gif
data_source.gif (10.69 KiB) Viewed 2065 times
data_input_method.gif
data_input_method.gif (11.72 KiB) Viewed 2065 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

All looks ok. Running cacti 0.8.7d + patches?

looking in the cacti.log file with debugging mode enabled, is that ntp rrd file created? The script run, collect data, etc?

Also, you need the full path to perl for spine to work properly.
leoh
Posts: 30
Joined: Thu Feb 05, 2009 8:55 am

Post by leoh »

1 - full path to perl ajusted
2 - output of my script ajusted

Now. log is showing:

05/27/2009 12:40:01 PM - SPINE: Poller[0] Host[1] DS[2549] SCRIPT: /usr/bin/perl /opt/cacti/scripts/ntpdateq_mrtg.pl 10.100.0.100, output: offset:108064


Cacti Version 0.8.7b


Why there is no *ntp_offset_2549.rrd in my rra directory? After creating Data Source this file should have have been created or not?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

leoh wrote: After creating Data Source this file should have have been created or not?
No.

Look in the cacti.log for ntp_offset_2549.rrd. Cacti should've tried to create it and then update it with offset:108064. What did it do?
leoh
Posts: 30
Joined: Thu Feb 05, 2009 8:55 am

Post by leoh »

Look what we have in the logs.
I still have no idea why there is no graph.
I have started everyghint from the begining and it never works. I am making a mistake somewhere.

----------------------
05/28/2009 03:45:01 PM - SPINE: Poller[0] Host[1] DS[2549] SCRIPT: /usr/bin/perl /opt/cacti/scripts/ntpdateq_mrtg.pl 10.100.0.100, output: offset:177.096

05/28/2009 03:45:02 PM - POLLER: Poller[0] Parsed MULTI output field 'offset:177.096' [map offset->ntp_offset]

05/28/2009 03:45:02 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "delete from poller_output where local_data_id='2549' and rrd_name='ntp_offset' and time='2009-05-28 15:45:01'"

05/28/2009 03:45:02 PM - POLLER: Poller[0] CACTI2RRD: /usr/local/rrdtool-1.2.19/bin/rrdtool update /opt/cacti/rra/bms65_ntp_offset_2549.rrd --template ntp_offset 1243536301:177.096
---------------
leoh
Posts: 30
Joined: Thu Feb 05, 2009 8:55 am

Post by leoh »

There is something strange about my graph.
The debug seems to be incomplete. See attached image please.
Attachments
ScreenHunter_006.gif
ScreenHunter_006.gif (3.91 KiB) Viewed 1977 times
leoh
Posts: 30
Joined: Thu Feb 05, 2009 8:55 am

Post by leoh »

The single item type of my graph was of time comment. That's was the reason. Now it seems to work. I will take a look deep in the logs and reply here if every thing is fine.
leoh
Posts: 30
Joined: Thu Feb 05, 2009 8:55 am

Post by leoh »

All fine. Now its working. thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests