06-25-2007 02:41 PM
Hi,
I'm getting trouble trying the IronPort tool called API Reporting designing to graph some information from an ESA into a simple web server. The script is written in Perl so I'm getting a perl error when I launch the script.
Processing ... 00_Chart.txt
Argument "--\r" isn't numeric in addition (+) at apireport.pl line 264, <CSVFILE> line 2.
By default, perl tries to do a math operation but in my CSV I have a non numerical value (--). But in the file defining the chart (config/Report_Config/00_Chart.txt), I've correctly selected which columns the script has to handle :
COLUMN=Stopped by Reputation Filtering
COLUMN=Stopped as Invalid Recipients
COLUMN=Spam Detected
COLUMN=Virus Detected
COLUMN=Stopped by Content Filter
#COLUMN=Total Threat Messages
COLUMN=Clean Messages
#COLUMN=Total Attempted Messages
I think I've figured out the source of the problem but my perl knowledge is a little bit weak to solve the problem.
Does anybody know the problem and/or the solution?
Thanks for any tips,
Vincent
06-28-2007 01:12 PM
okay...
When I take a look in the perl script, I can read that :
###########################################################################
#
# parse_csv_time(hashref, file, int, int)
#
# parse a csv file, aggregating the data by a time period defined in
# the third parameter.
#
# 86400 seconds = 1 day
# 3600 seconds = 1 hour
# .. etc.
#
# if the csv data contains a non-numerical key in one column (to be
# ignored), the fourth parameter should be changed from 4 to 5 (or
# whichever column contains the first 100% numerical data).
#
###########################################################################
According to the previous error message, the problem comes from this function but I don't well understand the "fourth parameter" thing. It isn't set up to 4 so where can I change it to 5????
Thanks,
Vincent
08-02-2007 04:29 PM
We've just installed the apireport.pl script and config etc. We get the same error when generating a pie chart eg for all incoming mail split by reason it is blocked. Chart config is
#
# Report/Chart Configuration File
#
TITLE_A=Incoming Mail
TITLE_B=Today
#
# REPORT_SPAN defines the date range covered
# by the report.
#
# current_day = (roughly) the past 24 hours.
# current_month = the past 30 days.
#
# previous_day = yesterday (starting 00:00)
# previous_month = entire month before current month
#
#REPORT_SPAN=previous_day
#REPORT_SPAN=previous_month
REPORT_SPAN=current_day
#REPORT_SPAN=current_month
#REPORT_SPAN=custom
#
# datestamp_to & datestamp_from are IGNORED
# for all except 'custom' report spans.
#
# The date must be in this format:
#
# "DD Mon YYYY HH24:MM:SS"
#
# (spaces must be replaced with "%20")
#
# Example datestamps:
#
# datestamp_from=2%20Dec%202006%2000:00:00
# datestamp_to=11%20Dec%202006%2023:59:59
#
#datestamp_from=
#datestamp_to=
#
# rollup sets the rollup time period
#
# a value of "0" creates a single
# time period (necessary for pie charts)
#
# a value of 86400 divides everyting by
# day, applying the GMT offset from the
# main config file before displaying
# the data
#
# etc.
#
ROLLUP=0
#ROLLUP=86400
#
# don't change these unless you're familiar with the 5.0 API!
#
REPORT_DEF_ID=mga_overview
SECTION=ss_1_0_1
COLUMN=Stopped by Reputation Filtering
COLUMN=Stopped as Invalid Recipients
COLUMN=Spam Detected
COLUMN=Virus Detected
COLUMN=Stopped by Content Filter
#COLUMN=Total Threat Messages:
COLUMN=Clean Messages
#COLUMN=Total Attempted Messages:
CHART_TYPE=Pie
#CHART_TYPE=Bar
#GROUP=time
GROUP=key
EXPLODE=10
WIDTH=600
HEIGHT=400
BGCOLOR=fff
XML_FILE=chart00.xml
The errors are (ine per host you poll) due to the row of data with percentages as the Total number... column has no number. But the report generated is OK despite the errors. The numbers in the report (if you activate the control) are not right - it adds the percentages so the the "total percentage" depends on how many devices you poll but the segments of the chart are the right relative size compared to each other.
The tool is frustrating - trying to get a chart a bit like the one in the PDF file in docs folder. Would love to see the report config file that generated it. Looks like the GROUP=key reports dont use the rollup value so how to get a report showing - say daily totals for last week by reason mail was blocked. Any ideas?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide