Hello everybody,
As mentioned in my previous topic, I successfully created a new metric based on response time (see the code below).
Now, the problem is that when I tried to create a new notification based on threshold 75 and 100, I did not receive anything. No results are shown in 'Last Executions'. Instead, other notifications, like the threshold for TTO, are working fine!
Can anyone kindly help me figure out what I am missing ?
(A little extra info: When I update the dictionary to change the field 'rt' to 'RT', the modification is not applied. However, if I change it directly in the source code, it works).
New RT metric code (dependency: itop-service-mgmt/3.2.0)
<?php/***ComputetheResponseTimeofaticket-nulliftheclass'SLT'doesnotexist*/classResponseTicketRTextendsResponseTicketSLTimplementsiMetricComputer{publicstaticfunctionGetDescription(){return"Time to response a ticket";}publicfunctionComputeMetric($oObject){$iRes=$this->ComputeSLT($oObject,'rt');return$iRes;}}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The stopwatch code must be at least 3 characters long; otherwise, the following query inside ormstopwatch.class.inc.php will fail:
SELECT TriggerOnThresholdReached AS t WHERE t.target_class IN ('$sClassList') AND stop_watch_code MATCHES :stop_watch_code AND threshold_index = :threshold_index
So, after changing 'rt' to 'rtx', notifications are now working fine too.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everybody,
As mentioned in my previous topic, I successfully created a new metric based on response time (see the code below).
Now, the problem is that when I tried to create a new notification based on threshold 75 and 100, I did not receive anything. No results are shown in 'Last Executions'. Instead, other notifications, like the threshold for TTO, are working fine!
Can anyone kindly help me figure out what I am missing ?
(A little extra info: When I update the dictionary to change the field 'rt' to 'RT', the modification is not applied. However, if I change it directly in the source code, it works).
New RT metric code (dependency: itop-service-mgmt/3.2.0)
Stop watch (redefine of user request, dependency "itop-request-mgmt-itil/3.2.0)":
Method to recalcute the stopwatch every time there is an update on public log (same XML as the stopwatch):
PHP function:
Hello everyone,
Is there anyone who could provide me with assistance or suggest any advices/tips/guides to solve the problem?
Thanks.
Solved with a surprising solution:
The stopwatch code must be at least 3 characters long; otherwise, the following query inside ormstopwatch.class.inc.php will fail:
SELECT TriggerOnThresholdReached AS t WHERE t.target_class IN ('$sClassList') AND stop_watch_code MATCHES :stop_watch_code AND threshold_index = :threshold_index
So, after changing 'rt' to 'rtx', notifications are now working fine too.