[Solved ]Please help on OTRS Escalation email notifications

Moderator: crythias

Post Reply
kychau
Znuny newbie
Posts: 7
Joined: 20 Sep 2012, 10:50
Znuny Version: 3.1.7
Real Name: Chau KY
Company: SML HK

[Solved ]Please help on OTRS Escalation email notifications

Post by kychau »

I would like to seek your advise on following case:
We are now implmenting the OTRS 3.1.7 with ITSM package to replace our existing Helpdesk system, most functions are going to work fine but there has a great issue in sending a email notification if no one picks up and handles the new ticket after a certain escalation time.

According to my existing setting, several GenericAgent jobs would do the checking each queue with ticket of reaching a Escalcation time to update the Priority field and move up a specified SLA level. Then related Notification (Event) job to trigger on the event of TicketPriorityUpdate on sending to defined Recipent Role. But those Notification (Event) job can not be executed on every time even the GenericAgent jobs update the Priority.
I checked from the Ticket History and see the record with issue when priority from 4 high(4) to 5 "5 very high"(5). which cannot trigger the SendAgentNotification (Captured for reference).
But some Ticket History showed that it can triggered all the SendAgentNotification and It is very strange
and seem to be unable on the OTRS of Notification(Event) job.

I am sure that the cronjob is working propertly and would appreciated if you would provide hints to me.

(Ticket History for your reference)
09/20/2012 16:03:19 (+8) SLAUpdate Updated SLA to INFRA HK SLA 1_2 (ID=4).
09/20/2012 16:23:27 (+8) PriorityUpdate Changed priority from "3 normal" (3) to "4 high" (4).
09/20/2012 16:23:27 (+8) SendAgentNotification
"INFRA General HK Reach 1st SolutionTime"-notification sent to "name1@company.com".
09/20/2012 16:23:38 (+8) SLAUpdate Updated SLA to INFRA HK SLA 1_3 (ID=5).
09/20/2012 16:43:57 (+8) PriorityUpdate Changed priority from "4 high" (4) to "5 very high" (5).
09/20/2012 16:43:57 (+8) PriorityUpdate Changed priority from "5 very high" (5) to "6 extreme high" (6).
09/20/2012 16:54:00 (+8) SendAgentNotification
"INFRA General HK Reach 3rd SolutionTime"-notification sent to "name1@company.com".
Last edited by kychau on 26 Sep 2012, 10:29, edited 1 time in total.
kychau
Znuny newbie
Posts: 7
Joined: 20 Sep 2012, 10:50
Znuny Version: 3.1.7
Real Name: Chau KY
Company: SML HK

Re: Please help on OTRS Escalation email notifications

Post by kychau »

May I know if there is anyone can help..
kychau
Znuny newbie
Posts: 7
Joined: 20 Sep 2012, 10:50
Znuny Version: 3.1.7
Real Name: Chau KY
Company: SML HK

Re: Please help on OTRS Escalation email notifications

Post by kychau »

There has one finding with strange pattern:

If I submit the generic job manually via web interface of "Run this Task" during the esclation time reached, it can be process to sendagentnotify with normally.
When it was scheduled with cronjob $HOME/bin/otrs.GenericAgent.pl -c db, it was found to be unable to trigger the notification (event) job in sometime.

Please have any advise to me since it is very important feature for designing on the new helpdesk system.
kychau
Znuny newbie
Posts: 7
Joined: 20 Sep 2012, 10:50
Znuny Version: 3.1.7
Real Name: Chau KY
Company: SML HK

Re: Please help on OTRS Escalation email notifications

Post by kychau »

Would it be anyone can help!!!

Below both Situation has the escalation time of ticket reached the 2nd SLA time.

Situation 1
I run the generic job manually "Run this task" (refer to the runjob.jpg for information), it could triggered the noitification (event) and I see under the /opt/otrs/var/log/otrs.log-2012-9 without problem.
[Tue Sep 25 10:16:01 2012][Notice][Kernel::System::GenericAgent::JobRun] Run GenericAgent
Job 'INFRA HK Region 2nd Solution escalate time' from db.
[Tue Sep 25 10:16:07 2012][Notice][Kernel::System::Ticket::Event::NotificationEvent::_SendNotification] Sent agent 'INFRA General HK Reach 2nd SolutionTime' notification to 'name1@company.com'.
[Tue Sep 25 10:16:11 2012][Notice][Kernel::System::Ticket::Event::NotificationEvent::_SendNotification] Sent agent 'INFRA General HK Reach 2nd SolutionTime' notification to 'name2@company.com'.

Situation 2[/u
]But If it was scheduled under otrs crontjob with */10 * * * * $HOME/bin/otrs.GenericAgent.pl -c db >> /dev/null,
I see under the /opt/otrs/var/log/otrs.log-2012-9 with problem with no triggering for the notification (event)

[Tue Sep 25 09:10:04 2012][Notice][Kernel::System::GenericAgent::JobRun] Run Gen
ericAgent Job 'INFRA HK Region 2nd Solution escalate time' from db. <------ no Notification event triggered.
[Tue Sep 25 09:10:04 2012][Notice][Kernel::System::GenericAgent::JobRun] Run Gen
ericAgent Job 'INFRA HK Region 3rd Solution escalate time' from db.
[Tue Sep 25 09:10:04 2012][Notice][Kernel::System::GenericAgent::JobRun] Run Gen
ericAgent Job 'PDS DH Region 1st Solution escalate time' from db.
You do not have the required permissions to view the files attached to this post.
CSL
Znuny expert
Posts: 159
Joined: 11 Nov 2011, 19:27
Znuny Version: 3.0.11

Re: Please help on OTRS Escalation email notifications

Post by CSL »

The first thing that comes to mind is that your generic agent ticket filter might not have the right criteria to identify these tickets. What criteria are you using under 'ticket filter?'

If you run a normal ticket search with the same criteria, does it find the tickets you want, or does nothing appear?
Backend: OTRS 3.0.11 RedHat Enterprise Linux 6.2, Apache, MySQL with replication
Frontend: OTRS 3.0.11 RedHat Enterprise Linux 6.2 with SELinux, Apache SSL
kychau
Znuny newbie
Posts: 7
Joined: 20 Sep 2012, 10:50
Znuny Version: 3.1.7
Real Name: Chau KY
Company: SML HK

Re: Please help on OTRS Escalation email notifications

Post by kychau »

For the ticket filter, it base on the Service name, Service Level Agreement, Priority, Queue
and Escalation solution time before reached 1 minutes. The Ticket action is to move Service Level Agreement and Priority to next level.

When I check from the ticket history, it can processed the Generic Agent job for ticket SLA reach before 1 mins with SLAupdate
and Priority Update.

Situation 1- Manual submit the Generic job and Notification (Event) of TicketPriorityUpdate can triggered
SLAUpdate Updated SLA to INFRA HK SLA 1_2 (ID=4).09/25/2012 21:34:42 (+8)
PriorityUpdate Changed priority from "3 normal" (3) to "4 high" (4). 09/25/2012 21:34:42 (+8)
SendAgentNotification
"INFRA General HK Reach 1st SolutionTime"-notification sent to "name1g@company.com". 09/25/2012 21:34:47 (+8)

Situation 2- Schedule with cronjob of the Generic job and Notification (Event) of TicketPriorityUpdate CANNOT triggered
SLAUpdate Updated SLA to INFRA HK SLA 1_3 (ID=5). 09/25/2012 21:40:05 (+8)
PriorityUpdate Changed priority from "4 high" (4) to "5 very high" (5). 09/25/2012 21:40:05 (+8)
<---- No Notification event occurred

May I know what is the difference between trigger the Generic job by manual instead of scheduled by cronjob?
Why it is unable to trigger the Notification (Event), event the Generic job perform the SLAUpdate and PriorityUpdate action?
CSL
Znuny expert
Posts: 159
Joined: 11 Nov 2011, 19:27
Znuny Version: 3.0.11

Re: Please help on OTRS Escalation email notifications

Post by CSL »

Apart from that it's run by cron, and not by apache & mod_perl, there should be no difference between running it manually or via the scheduler as far as I know.

What happens if you run the command from the cron file inside the terminal as root? Does it print any errors or does it do exactly the same thing? What happens if you then run it as the OTRS user?
Backend: OTRS 3.0.11 RedHat Enterprise Linux 6.2, Apache, MySQL with replication
Frontend: OTRS 3.0.11 RedHat Enterprise Linux 6.2 with SELinux, Apache SSL
kychau
Znuny newbie
Posts: 7
Joined: 20 Sep 2012, 10:50
Znuny Version: 3.1.7
Real Name: Chau KY
Company: SML HK

Re: Please help on OTRS Escalation email notifications

Post by kychau »

Please find result which performed:

Situation 1- execute /opt/otrs/bin/otrs.GenericAgent.pl -c db under root or otrs user account with no error

Result from console output:
Job: 'INFRA HK Region 1st Solution escalate time'
For all Queues:
- set sla id of Ticket (2012092510159/261) to '4'
- set priority id of Ticket (2012092510159/261) to '4'
Job: 'INFRA HK Region 2nd Solution escalate time'
For all Queues:

Check from ticket history:
PriorityUpdate Changed priority from "1 very low" (1) to "3 normal" (3).09/25/2012 23:10:02 (+8)
SLAUpdate Updated SLA to INFRA HK SLA 1_2 (ID=4). 09/25/2012 23:21:18 (+8)
PriorityUpdate Changed priority from "3 normal" (3) to "4 high" (4). 09/25/2012 23:21:18 (+8)
<--- NO SendAgentNotification job triggered

Situation 2 -executed the job on the Web Interface of Generic Agent under System Administration session
Click the button "Run this Task" of the job

Check from ticket history:
PriorityUpdate Changed priority from "5 very high" (5) to "6 extreme high" (6). 09/25/2012 23:48:31 (+8)
SendAgentNotification "INFRA General HK Reach 3rd SolutionTime"-notification sent to "name1g@company.com". <-- Triggered which defined in the Notfication (Event)

It is strange that the GenericAgent can conjunction with Notification (Event) when execute via Web Interface manually but it cannot perform the same behaviour in the Scheduling or even manual execution of otrs.GenericAgent.pl -c db.
Just one thing I think of the difference is the execution Web Interface with one Generic job at a time while the command
"Otrs.GenericAgent.pl -c db" with execution all the jobs defined under the GenericAgent.
May I know if there is any hints or solution to solve above issue?
kychau
Znuny newbie
Posts: 7
Joined: 20 Sep 2012, 10:50
Znuny Version: 3.1.7
Real Name: Chau KY
Company: SML HK

Re: [Solved ]Please help on OTRS Escalation email notificati

Post by kychau »

First of all to thanks for those who reply my post.

Actually I give up to use the method of GenericAgent in database to conjunction with Notification (Event).
In order to do this I add this code to the GenericAgent.pm file (\OTRS\Kernel\Config\GenericAgent.pm), so that the Notification (Event)
keep checking the ArticleCreate and to trigger the sendAgentNotification.

'send L1 escalation notifications' => {
# ticket escalation time of between 0 and 10 minutes ago
TicketEscalationTimeOlderMinutes => 0,
TicketEscalationTimeNewerMinutes => 10,
# new ticket properties
New => {
Note => {
From => 'helpdesk@example.com',
Subject => 'Escalation!',
Body => 'This ticket escalation counter was reached',
ArticleType => 'note-internal', # note-internal|note-external|note-report
},
},
Post Reply