[rt-users] RES: RES: RES: RES: RES: Generate end of the day report and email

Asanka Gunasekera asanka_gunasekera at yahoo.co.uk
Tue Jul 16 05:37:36 EDT 2013


Hi Diaulas, thanks you for your help, it works :) there was some control charactors in the file, I guess when I copy the script from my machine to linex

Thank you for the help

Best Of regards



________________________________
 From: Asanka Gunasekera <asanka_gunasekera at yahoo.co.uk>
To: Asanka Gunasekera <asanka_gunasekera at yahoo.co.uk>; Diaulas Castro <diaulas.castro at intersolution.inf.br> 
Sent: Tuesday, 16 July 2013, 14:43
Subject: Re: RES: RES: RES: RES: [rt-users] RES:  Generate end of the day report and email
 


Hi, Diaulas found what was wrong. the rt process owner was a user called apache, after su to apache and was able to login to RT CLI. But when I ran your script I am getting am empty mail.

Thanks and best regards


________________________________
 From: Asanka Gunasekera <asanka_gunasekera at yahoo.co.uk>
To: Diaulas Castro <diaulas.castro at intersolution.inf.br> 
Sent: Tuesday, 4 June 2013, 10:15
Subject: Re: RES: RES: RES: RES: [rt-users] RES:  Generate end of the day report and email
 


Hi Diaulas tanks you for the reply but I tryed below

[root at iilrt bin]# export RTSERVER=http://192.168.11.39
[root at iilrt bin]#
[root at iilrt bin]#
[root at iilrt bin]# ./rt ls
Query:Status!='resolved' and Status!='rejected'
   Strong encryption not available, switched off by externalauth=0
   Password will be sent to 192.168.11.39 unencrypted
   Press CTRL-C now if you do not want to continue
Password:
rt: Server error: Forbidden (403)
[root at iilrt bin]# export RTSERVER=192.168.11.39
[root at iilrt bin]#
[root at iilrt bin]#
[root at iilrt bin]# ./rt ls
Query:Status!='resolved' and Status!='rejected'
   Strong encryption not available, switched off by externalauth=0
   Password will be sent to 192.168.11.39 unencrypted
   Press CTRL-C now if you do not want to continue
Password:
rt: Server error: URL must be absolute (400)


I simply cnat get connected to RT

Best Regards


________________________________
 From: Diaulas Castro <diaulas.castro at intersolution.inf.br>
To: Asanka Gunasekera <asanka_gunasekera at yahoo.co.uk> 
Sent: Friday, 31 May 2013, 17:09
Subject: RES: RES: RES: RES: [rt-users] RES:  Generate end of the day report and email
 


 
Try to use 192.168.11.39 as RTSERVER variable.
 
 
Diaulas Castro
Consultor Linux / Microsoft
InterSolution Informática
Tel.: ( 55 11 ) 3443-1472
www.intersolution.inf.br
Oracle Certified Partner
 
De:Asanka Gunasekera [mailto:asanka_gunasekera at yahoo.co.uk] 
Enviada em: quinta-feira, 30 de maio de 2013 03:02
Para: Diaulas Castro
Assunto: Re: RES: RES: RES: [rt-users] RES: Generate end of the day report and email
 
Hi Diaulas, thank you for the reply attached is my config file
 
Best Regards
 
Asanka
 
From:Diaulas Castro <diaulas.castro at intersolution.inf.br>
To: Asanka Gunasekera <asanka_gunasekera at yahoo.co.uk>; "rt-users at lists.bestpractical.com" <rt-users at lists.bestpractical.com> 
Sent: Tuesday, 28 May 2013, 17:07
Subject: RES: RES: RES: [rt-users] RES: Generate end of the day report and email
 
Send your RT_SiteConfig.pm
 
 
De:Asanka Gunasekera [mailto:asanka_gunasekera at yahoo.co.uk] 
Enviada em: terça-feira, 28 de maio de 2013 01:34
Para: Diaulas Castro; rt-users at lists.bestpractical.com
Assunto: Re: RES: RES: [rt-users] RES: Generate end of the day report and email
 
Hi Diaulas, I have read this document, below is my configuration
 
<VirtualHost *:80>
    ServerAdmin webmaster at dummy-host.example.com
    ServerName rt.mydomain.com
    ErrorLog "logs/virtual_host_80_for-mail_error.log"
    CustomLog "logs/virtual_host_80_for-mail.log" common
 
        AddDefaultCharset UTF-8
 
        DocumentRoot "/usr/local/rt-ora/share/html"
        <Location />
            Order allow,deny
            Allow from all
 
            SetHandler perl-script
            PerlResponseHandler Plack::Handler::Apache2
            PerlSetVar psgi_app /usr/local/rt-ora/sbin/rt-server
        </Location>
        <Perl>
            use Plack::Handler::Apache2;
            Plack::Handler::Apache2->preload("/usr/local/rt-ora/sbin/rt-server");
        </Perl>
 
</VirtualHost>
 
And I used below parameers
 
RTUSER=root
RTPASSWORD=112211
RTSERVER=http://localhost
 
Please tell me what I am doing wrong
 
Thanks and Best Regards
Asanka
 

________________________________
 
From:Diaulas Castro <diaulas.castro at intersolution.inf.br>
To: Asanka Gunasekera <asanka_gunasekera at yahoo.co.uk>; "rt-users at lists.bestpractical.com" <rt-users at lists.bestpractical.com> 
Sent: Monday, 27 May 2013, 17:20
Subject: RES: RES: [rt-users] RES: Generate end of the day report and email
 
Hello Asanka,
  
From http://requesttracker.wikia.com/wiki/CLI  
 
export RTUSER=your.rtusername
export RTPASSWD=your rt password
export RTSERVER=your.rt3.installation
 
Try with /rt after domain or anything you have configured on Apache.
  RTSERVER=http://localhost/rt
 
 
 
De:Asanka Gunasekera [mailto:asanka_gunasekera at yahoo.co.uk] 
Enviada em: segunda-feira, 27 de maio de 2013 07:59
Para: Diaulas Castro; rt-users at lists.bestpractical.com
Assunto: Re: RES: [rt-users] RES: Generate end of the day report and email
 
Hi Diaulas, thank you for the reply but the thing is I am unable to log in to the RT when I do below
 
export RTSERVER=http://localhost
 
and do 
 
rt ls 
 
it prompt me for a password once I enter the password and hit enter I get below error
 
Query:Status!='resolved' and Status!='rejected'
   Strong encryption not available, switched off by externalauth=0
   Password will be sent to localhost unencrypted
   Press CTRL-C now if you do not want to continue
Password:
rt: Server error: Forbidden (403)
 
As the URL I tried http://x.x.x.xas well but with the same error
 
Thanks and Regards

________________________________
 
From:Diaulas Castro <diaulas.castro at intersolution.inf.br>
To: Asanka Gunasekera <asanka_gunasekera at yahoo.co.uk>; "rt-users at lists.bestpractical.com" <rt-users at lists.bestpractical.com> 
Sent: Wednesday, 22 May 2013, 17:20
Subject: RES: [rt-users] RES: Generate end of the day report and email
 
Sorry, didnt understand your message, but from your log I think you don’t have RTSERVER variable,
 
Try to add on top of script:
export RTSERVER=your.rt.installation
 
 
if you got error try to execute a simple /usr/bin/rt ls TICKET_NUMBER
 
That script relies on output of RT CLI command.
 
 
De:Asanka Gunasekera [mailto:asanka_gunasekera at yahoo.co.uk] 
Enviada em: quarta-feira, 22 de maio de 2013 08:38
Para: Diaulas Castro; rt-users at lists.bestpractical.com
Assunto: Re: [rt-users] RES: Generate end of the day report and email
 
Hi Diaulas, can you tell me the user name that the rt command is looking for since I put root (of rt) and tried some and other rt account as well, but I am getting below error
 
Query:Status!='resolved' and Status!='rejected'
rt: Server error: Forbidden (403)
 
Thank you and Best Regards
 

________________________________
 
From:Diaulas Castro <diaulas.castro at intersolution.inf.br>
To: "rt-users at lists.bestpractical.com" <rt-users at lists.bestpractical.com> 
Sent: Friday, 10 May 2013, 21:42
Subject: [rt-users] RES: Generate end of the day report and email
 
Made this bash script to accomplish using RT CLI.
 
Just customize “From:”,  To:” and “Status” search in rt ls command and schedule on crontab.
 
This script will list all tickets and mail fields to temp file after that a while loop will add html tags (tables and rows) trough command sed, so I got a nice looking mail report. (http://postimg.org/image/yfmlp9307/)
 
  If you want to color the rows use this before sendmail command:
 
  sed -i -e '/Nobody/s/D2EAF1/CCCCCC/g'          $MAIL
  sed -i -e '/diaulas.castro/s/D2EAF1/6FCCFF/g'   $MAIL
    This will change all tickets by nobody to gray and Diaulas.castro to light blue
 
 
PS: I know! RT-CRONTOOL exist, but I m not perl expert.. =(
 
 
 
####################################
export RTORDERBY=owner
 
MAIL=/tmp/rel_todos_tickets_abertos.sh.mail
echo "From: MY_TICKET at MY_DOMAIN.COM "                > $MAIL
echo "To: DIRECTORS at MYDOMAIN.COM"     >> $MAIL
echo "MIME-Version: 1.0"                                >> $MAIL
echo 'Content-type: text/html; charset=iso-8859-1'      >> $MAIL
echo " boundary=`date +%s`/rt.MY.DOMAIN.COM"     >> $MAIL
echo "Subject: All open Tickets:$(date +%d/%m/%y)"       >> $MAIL
echo ""                                                 >> $MAIL
echo "<html>"                                           >> $MAIL
echo "<HEAD>"                                           >> $MAIL
echo "</HEAD>"                                          >> $MAIL
echo "<BODY>"                                           >> $MAIL
echo "<span style=\'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D\'>" >> $MAIL
echo "<table>">>                                        $MAIL
 
/usr/bin/rt ls "Status != resolved AND Status != report AND Status != plantao AND Status != stalled" -f id,subject,queue,status,owner,lastupdated |iconv -f UTF-8 -t ISO8859-1 > /tmp/rel.tmp
while read line ; do
  echo  "<span style='color:#000000'><TR><TD style='background:#D2EAF1;padding:0cm 5.4pt 0cm 5.4pt'>$line</TD></TR></span" | sed "s/    /<TD style='background:#D2EAF1'>/g"
 
done < /tmp/rel.tmp >> $MAIL
 
echo "</table>">> $MAIL
echo "</BODY>"                                          >> $MAIL
echo "</html>"                                          >> $MAIL
 
/usr/sbin/sendmail -t < $MAIL
 
 
 
De:rt-users-bounces at lists.bestpractical.com [mailto:rt-users-bounces at lists.bestpractical.com] Em nome de Asanka Gunasekera
Enviada em: sexta-feira, 10 de maio de 2013 05:48
Para: rt-users at lists.bestpractical.com
Assunto: [rt-users] Generate end of the day report and email
 
Hi, is there any way to auto generate end of the day report and emal this to management (all open, all new etc)
 
I am using RT4 and oracle database on redhat
 
Thanks and Regards



-- 
RT Training in Seattle, June 19-20: http://bestpractical.com/training
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130716/7b467bc4/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 4503 bytes
Desc: image001.png
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130716/7b467bc4/attachment.png>


More information about the rt-users mailing list