otrs.GenerateStats.pl fails to send the e-mail

Moderator: crythias

Post Reply
OTRSRDNewbie
Znuny newbie
Posts: 69
Joined: 29 Apr 2016, 10:23
Znuny Version: 3.2, 5
Real Name: Dennis Cua
Company: N/A

otrs.GenerateStats.pl fails to send the e-mail

Post by OTRSRDNewbie »

Hi

Actually I'm doing some testing to see if what I can use in what I should be doing and based on the reading of the document and forum. Here's how I executed it from the command line. I tried running otrsGenerateStats.pl saving it on a folder it works so the stats # is correct and CSV.

GenerateStats uses the EmailObject so I am assuming its using the e-mail configuration of otrs. Can anyone just give me a few pointers and guidelines on how to troubleshoot.

I know I needed to learn more about otrs development, situations happen where I can ask to also handle otrs development and time is not a luxury so I'm learning as fast as I can. Sorry

Code: Select all


 perl otrs.GenerateStats.pl -n <stats # > -f CSV -r <my e-mail address> -s <my e-mail address> -m "This is a test on automating a report"
 
 
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: otrs.GenerateStats.pl fails to send the e-mail

Post by EXG133 »

Here's an example I scheduled, I think you're missing the filename (-F) :

50 23 * * * $HOME/bin/otrs.GenerateStats.pl -n 1111 -f CSV -r fake@fake.com -m "Something lalala" -F filename`date +\%Y\%m\%d`
OTRSRDNewbie
Znuny newbie
Posts: 69
Joined: 29 Apr 2016, 10:23
Znuny Version: 3.2, 5
Real Name: Dennis Cua
Company: N/A

Re: otrs.GenerateStats.pl fails to send the e-mail

Post by OTRSRDNewbie »

Thanks for the response, but I think the pre-prod server's mail server and sendmail is already not working. I'm not knowledgeable in administration of servers but I tried some of the tips in forums from other sites on checking if sendmail is working and it seems that the mails are stuck in some queue or something I see in /var/log/mail/maillog that the e-mail sending is received, accepted and sent.

I'll try if I can get this working. Thanks for the respond atleast I know the right command to write eliminates finding what is the actual problem
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: otrs.GenerateStats.pl fails to send the e-mail

Post by EXG133 »

otrs.GenerateStats.pl uses whatever is configured in OTRS:

Code: Select all

    $Kernel::OM->Get('Kernel::System::Email')->Send(
        From       => $Opts{s},
        To         => $Recipient,
        Subject    => "[Stats - $CountStatArray Records] $Title; Created: $Time",
        Body       => $Kernel::OM->Get('Kernel::Language')->Translate( $Opts{m} ),
        Charset    => 'utf-8',
        Attachment => [ {%Attachment}, ],
    );
    print "NOTICE: Email sent to '$Recipient'.\n";

}
exit(0);
If you can send an email from the frontend it should work for the job too.
OTRSRDNewbie
Znuny newbie
Posts: 69
Joined: 29 Apr 2016, 10:23
Znuny Version: 3.2, 5
Real Name: Dennis Cua
Company: N/A

Re: otrs.GenerateStats.pl fails to send the e-mail

Post by OTRSRDNewbie »

I haven't really had yet a ticket that needs e-mail. Now while testing if I can make the monthly report their request send an e-mail did I found out that its not working anymore.

I have very little experience with maintaining mail server but it looks like it accepted the mail request but no delivery. I'm not even sure if the sendmail is configured correctly. We are running Red Hat Entrprise Linux Server release 6.3

Code: Select all

Jul 17 04:51:53 ab2trx1c0005 sendmail[16806]: u6GKnJRA016806: to=<root@ab2trx1c0005>, delay=00:00:00, mailer=local, pri=32445, dsn=4.5.1, stat=queued
Jul 17 05:06:47 ab2trx1c0005 sendmail[16899]: u6GL6lUE016899: Authentication-Warning: ab2trx1c0005: apache set sender to helpdesk@genericcompany.com using -f
Jul 17 05:06:47 ab2trx1c0005 sendmail[16899]: u6GL6lUE016899: from=helpdesk@genericcompany.com, size=2017, class=-60, nrcpts=1, msgid=<1468703207.302861.721146371@itsm.acme.com>, relay=apache@localhost
Jul 17 05:06:47 ab2trx1c0005 sendmail[16899]: u6GL6lUE016899: to=monitoring@genericcompany.com, delay=00:00:00, mailer=esmtp, pri=140017, dsn=4.5.1, stat=queued
Jul 17 05:06:47 ab2trx1c0005 sendmail[16900]: u6GL6lDU016900: Authentication-Warning: ab2trx1c0005: apache set sender to helpdesk@genericcompany.com using -f
Jul 17 05:06:47 ab2trx1c0005 sendmail[16900]: u6GL6lDU016900: from=helpdesk@genericcompany.com, size=2122, class=-60, nrcpts=1, msgid=<1468703207.479815.81105694@itsm.acme.com>, relay=apache@localhost
:
:
Jul 17 14:51:55 ab2trx1c0005 sendmail[18994]: u6H6nJg4018994: to=<root@ab2trx1c0005>, delay=00:00:00, mailer=local, pri=32534, dsn=4.5.1, stat=queued
Jul 17 14:51:55 ab2trx1c0005 sendmail[18994]: u6C6U3f4020555: u6H6nJg5018994: sender notify: Cannot send message for 5 days
Jul 17 14:51:55 ab2trx1c0005 sendmail[18994]: u6H6nJg5018994: to=<root@ab2trx1c0005>, delay=00:00:00, mailer=local, pri=32534, dsn=4.5.1, stat=queued
Jul 17 14:51:55 ab2trx1c0005 sendmail[18994]: u6C6A3hh020496: u6H6nJg6018994: sender notify: Cannot send message for 5 days
Jul 17 14:51:55 ab2trx1c0005 sendmail[18994]: u6H6nJg6018994: to=<root@ab2trx1c0005>, delay=00:00:00, mailer=local, pri=32534, dsn=4.5.1, stat=queued
Jul 17 14:51:55 ab2trx1c0005 sendmail[18994]: u6C6K3iQ020525: u6H6nJg7018994: sender notify: Cannot send message for 5 days
Jul 17 14:51:55 ab2trx1c0005 sendmail[18994]: u6H6nJg7018994: to=<root@ab2trx1c0005>, delay=00:00:00, mailer=local, pri=32534, dsn=4.5.1, stat=queued
Jul 17 15:03:19 ab2trx1c0005 sendmail[19080]: u6H73J2c019080: Authentication-Warning: ab2trx1c0005: otrs set sender to otrsrdnewbie@gmail.com using -f
Jul 17 15:03:19 ab2trx1c0005 sendmail[19080]: u6H73J2c019080: from=otrsrdnewbie@gmail.com, size=3028, class=0, nrcpts=1, msgid=<1468738999.721944.989539497@itsm.acme.com>, relay=otrs@localhost
Jul 17 15:03:19 ab2trx1c0005 sendmail[19080]: u6H73J2c019080: to=otrsrdnewbie@gmail.com, delay=00:00:00, mailer=esmtp, pri=33028, dsn=4.5.1, stat=queued

Post Reply