Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
Help !
I've read ( and re-read) the FAQs . I've even rebuilt a new machine and done a fresh install of Cacti and still have the same problem. I am simply trying to read a single value from a file which will be periodically updated via another source. I am using a simple perl script that runs correctly from command line that reads a file called data that has a single value (between 0 & 100). I am getting nothing back from the script into the rrd. Everything in the new machine is owned by root and file perms are OK.
10/24/2007 12:15:01 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update poller_reindex set assert_value='13891253' where host_id='2' and data_query_id='1' and arg1='.1.3.6.1.2.1.1.3.0'"
10/24/2007 12:15:01 AM - CMDPHP: Poller[0] Host[2] DS[10] WARNING: Result from CMD not valid. Partial Result:
10/24/2007 12:15:01 AM - CMDPHP: Poller[0] Host[2] DS[10] CMD: /usr/bin/perl /opt/software/cacti/scripts/read.pl, output: U
10/24/2007 12:15:01 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (10, 'xCast', '2007-10-24 00:15:01', 'U')"
Why is the system uptime OID in this output ?? I don't ask for it in my script !
It is probably something really obvious that I can be ashamed of not finding but at this stage I am willing to accept the red face just to get an answer and relieve my frustration.
mmmmmmm..... As a test I used the supplied ping.pl and the instructions in the FAQ to build the ping template. This all worked fine and the graph worked correctly. The output from running the script from command line was simply the returned single value of the rtt. So , withouth changing anything else, I renamed my own read.pl to ping.pl and examined the results. Even though both perl scripts returned a single value , the change to the ping.pl stopped the graph from working and caused the same error message of Result from CMD not valid. So I know that the issue is 100% within my perl script ! So, although they both give me a similar output only the ping.pl is correct ( and my read.pl is wrong .
Can someone tell me where I am going wrong and tell me the error of my script versus the working ping.pl script (below)?
mmmmmmm..... As a test I used the supplied ping.pl and the instructions in the FAQ to build the ping template. This all worked fine and the graph worked correctly. The output from running the script from command line was simply the returned single value of the rtt. So , withouth changing anything else, I renamed my own read.pl to ping.pl and examined the results. Even though both perl scripts returned a single value , the change to the ping.pl stopped the graph from working and caused the same error message of Result from CMD not valid. So I know that the issue is 100% within my perl script ! So, although they both give me a similar output only the ping.pl is correct ( and my read.pl is wrong .
Can someone tell me where I am going wrong and tell me the error of my script versus the working ping.pl script (below)?
OK , its working now . I messed around with the perl script and suddenly graph data appears. Guess I better learn Perl!
Good learning experience though ....
If anyone is interested here's the working code to read a single value from a file