Having been asked to do this by my manager, this was my solution:

pass a pre-encoded set of post variables to lynx, dump the server's response to stdout, and pipe it all in to an html e-mail. and just run the script from cron. the sed command in there keeps the e-mail client from trying to print it as soon as it loads. in this example, StatID lets you chose which stat to run. this one is fairly simple.

echo -en "MAIL FROM: [EMAIL PROTECTED] TO: [EMAIL PROTECTED]: OTRS: Daily Tickets by Creator\nContent-Type: text/html; charset=ISO-8859-1\n$(echo "Action=Login&RequestedURL=Action%3DAgentStats%26Subaction%3DRun%26StatID%3D5%26Format%3DPrint&Lang=en&TimeOffset=360&User=OTRSUSER&Password=OTRSPASS" | lynx -source -post_data http://172.26.8.8/otrs/index.pl | sed s/^\<body.*/\<body\>/)\n.\n" | nc 127.0.0.1 25 &> /dev/null

Here is another example where start and stop dates are passed by the script (this one was written to be run on the first of every month):

### Year to Date tickets by Site and Queue
MONTH=$(perl -e 'use Date::Calc qw(Today Add_Delta_Days); my ($y, $m, $d) = Add_Delta_Days(Today(), -1); print "$m";') DAY=$(perl -e 'use Date::Calc qw(Today Add_Delta_Days); my ($y, $m, $d) = Add_Delta_Days(Today(), -1); print "$d";') YEAR=$(perl -e 'use Date::Calc qw(Today Add_Delta_Days); my ($y, $m, $d) = Add_Delta_Days(Today(), -1); print "$y";') #echo -en "MAIL FROM: [EMAIL PROTECTED] TO: [EMAIL PROTECTED]: OTRS: Year-To-Date Tickets by Site and Queue\nContent-Type: text/html; charset=ISO-8859-1\n$(echo "Action=Login&RequestedURL=Action%3DAgentStats%26Subaction%3DRun%26StatID%3D8%26Format%3DPrint%26UseAsRestrictionCreateTimeStartMonth%3D1%26UseAsRestrictionCreateTimeStartDay%3D1%26UseAsRestrictionCreateTimeStartYear%3D$YEAR%26UseAsRestrictionCreateTimeStopMonth%3D$MONTH%26UseAsRestrictionCreateTimeStopDay%3D$DAY%26UseAsRestrictionCreateTimeStopYear%3D$YEAR%26&Lang=en&TimeOffset=360&User=OTRSUSER&Password=OTRSPASS" | lynx -source -post_data http://172.26.8.8/otrs/index.pl | sed s/^\<body.*/\<body\>/)\n.\n" | nc 127.0.0.1 25 &> /dev/null

Hope this helps

aix tiger wrote:
Hi
I want to know that when OTRS will include reporting feature ( like daily or monthly reports ) which reflects performance of service desk for management review I beleive MIS reports from Service desk is a important requirement of ITIL framework and methodology so it should be included in OTRS Any comments or advices how can we get such kind of reports from OTRS? Regards
------------------------------------------------------------------------
Bored stiff? <http://us.rd.yahoo.com/evt=49935/*http://games.yahoo.com> Loosen up... Download and play hundreds of games for free <http://us.rd.yahoo.com/evt=49935/*http://games.yahoo.com> on Yahoo! Games.
------------------------------------------------------------------------

_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support or consulting for your OTRS system?
=> http://www.otrs.com/

_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support or consulting for your OTRS system?
=> http://www.otrs.com/

Reply via email to