On 6/29/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello All,
> I am working on a project to roll data from an existing monitoring
> product, which does not have good reporting, to RRDTOOL. Here is what I
> have so far;
>
>
>
> -------------Sample Input--------------------------
>
> AEPDEV02 AnalyticsNT:CPUTotalCPUPct 1117778551
> 75.133115972581251
> AEPDEV02 AnalyticsNT:CPUTotalCPUPct 1117778551
> 75.019411752361364
> AEPDEV02 AnalyticsNT:CPUTotalCPUPct 1117778551
> 76.609172267616998
> AEPDEV02 AnalyticsNT:CPUTotalCPUPct 1117778551
> 75.632765893312623
> AEPDEV02 AnalyticsNT:CPUTotalCPUPct 1117778551
> 77.481031808564822
>
>
>
> ------------Sample Output-------------------------
>
>
> rrdtool update MMPSQL05 DS:CPUSystemPctCPU 1119451966:10.67392349
>
>
>
> ------------Code---------------------------------
>
>
>
> open(INPUT, "rrd_input.txt");
> open(OUTPUT, ">rrd_update.cmd");
>
>
>
> while (INPUT)
> {
> ($ServerName,$DS,$Time,$Value) = Split (/\T/,$Data,4);
>
> print OUTPUT "rrdtool update $ServerName DS:$DS $Time:$Value\n";
> #write the non-remmed
> }
>
> close(INPUT);
> close(OUTPUT);
>
>
>
> -----------Error---------------------------------
>
> I'm getting Undefined subroutine and nothing in the output file
>
>
> * I want to make this as fast as possible because it will be parsing
> through 100's of thousands of lines of data every 5 minutes or so, thanks
> for your help.
>
>
> Dave Dowdy
> Tech Services
> Honda of America Manufacturing
Dave,
I would have thought an undefined variable or a "bareword not
allowed". But you never know. There is no $Data in your program. Also,
it shouldn't be letting you get away with that bare filehandle. Are
you using strict? You should be.
while (<INPUT>) {
($ServerName,$DS,$Time,$Value) = split( /\T/, $_, 4 );
print OUTPUT "rrdtool update $ServerName DS:$DS $Time:$Value\n";
}
Also, I've never encountered a 'Split' function in Perl. You probably
want 'split' (which may be the source of the undefined subroutine,
come to think of it).
HTH
-- jay
--------------------
daggerquill [at] gmail [dot] com
http://www.tuaw.com
http://www.dpguru.com
http://www.engatiki.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>