Scheduled Reports

Moderator: crythias

Locked
fritzfreund
Znuny newbie
Posts: 16
Joined: 16 Oct 2012, 19:19
Znuny Version: 3.1.3
Real Name: Fritz Freund
Company: Intermountain Electric

Scheduled Reports

Post by fritzfreund »

I'm trying to schedule reports to be emailed to a manager. I have created the reports in Statistics, however I can't figure out how to schedule the job. I assume it will simply be a CRON job and I've found threads that tell people how to do it. However they are wanting to call mkStats.pl however I don't have one. I am assuming that they are running 2.x? What would be the script to do this on 3.1.11?

Thank you in advance for the help.
OTRS 3.1.11
Ubuntu Server 11.04
MySQL
Active Directory (Agent & Customer), SMTP/POP with MS Exchange, Multiple companies
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Scheduled Reports

Post by jojo »

bin/otrs.GenerateStats.pl
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
fritzfreund
Znuny newbie
Posts: 16
Joined: 16 Oct 2012, 19:19
Znuny Version: 3.1.3
Real Name: Fritz Freund
Company: Intermountain Electric

Re: Scheduled Reports

Post by fritzfreund »

LOL....

wow I must just be blind...
OTRS 3.1.11
Ubuntu Server 11.04
MySQL
Active Directory (Agent & Customer), SMTP/POP with MS Exchange, Multiple companies
fritzfreund
Znuny newbie
Posts: 16
Joined: 16 Oct 2012, 19:19
Znuny Version: 3.1.3
Real Name: Fritz Freund
Company: Intermountain Electric

Re: Scheduled Reports

Post by fritzfreund »

So, in case anyone else is looking for details on doing this. here is what I did.

log into your system as root (or use sudo)
crontab -u <otrsuser> -e
I added the following line to run a weekly report:
0 7 * * 1 $HOME/bin/otrs.GenerateStats.pl -n 10020 -f CSV -r tom@domain.com -r fred@domain.com -r tony@domain.com -m "Weekly Open Ticket Report" -F WeeklyOpen

The Report runs every Monday at 7:00AM (0 7 * * 1) (Minute Hour DayOfMonth Month DayOfWeek)
The report number is 10020. (-n 10020)
It's sending as a CSV file. (see below for what I had to tweak) (-f CSV)
It's sending to 3 poeple. (-r tom@domain.com -r fred@.....)
The message is Weekly Open Ticket Report. (-m "Weekly Open Ticket Report")
And the file name is WeeklyOpen.csv. (-F WeeklyOpen)

CSV fix
So, to get CSV working correctly, I actually had to edit otrs.GenerateStats.pl to use a comma(,) instead of a semi-colon(;).
change the following on line 148 to a comma.
my $Separator = $Opts{S} || ',';
OTRS 3.1.11
Ubuntu Server 11.04
MySQL
Active Directory (Agent & Customer), SMTP/POP with MS Exchange, Multiple companies
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Scheduled Reports

Post by jojo »

did you try -S <seperator> ?
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
fritzfreund
Znuny newbie
Posts: 16
Joined: 16 Oct 2012, 19:19
Znuny Version: 3.1.3
Real Name: Fritz Freund
Company: Intermountain Electric

Re: Scheduled Reports

Post by fritzfreund »

I didn't.

Do you by any chance have a site that has all the switches spelled out for the scripts?
OTRS 3.1.11
Ubuntu Server 11.04
MySQL
Active Directory (Agent & Customer), SMTP/POP with MS Exchange, Multiple companies
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Scheduled Reports

Post by crythias »

try otrs.RandomScript.pl --help
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Locked