my $stats = $htmlcontent;
@rows = split(/\n/,$stats);
#prints the cleaned up data after dumping it to an array
#foreach (@rows) {
# print "$_\n";
#}
#Make sure 'good' data is pulled
if ( $rows[0] !~ /Function Name/ ) {
$np->nagios_exit("UNKNOWN", "Can't find csv header!\n");
exit $ERRORS{"UNKNOWN"}
}
#get number of rows after data cleanup
$rowcount = scalar(grep {defined $_} @rows);
#foreach (@values) {
# print "$_\n";
#}
#die;
my @fields = ();
@fields = split(/\,/,$rows[0]);
@values = ();
my %stats = ();
for ( my $i = 1; $i <= $rowcount; $i++ ) {
@values = split(/\,/,$rows[$i]);
#print "this is row [$i] : $rows[$i]\n";
if ( !defined($stats{$values[0]}) ) {
$stats{$values[0]} = {};
}
if ( !defined($stats{$values[0]}{$values[1]}) ) {
$stats{$values[0]}{$values[1]} = {};
}
for ( my $x = 2,; $x < $#values; $x++ ) {
# $stats{pxname}{svname}{valuename}
$stats{$values[0]}{$values[1]}{$fields[$x]} = $values[$x];
}
}