15 Create Rules to Monitor Issues
Create rules to generate incidents or alerts that allow you to monitor and maintain all your assets including vehicles, facilities, shipments, drivers, trips, equipment, ship-units, and ship items. Rules can facilitate and encourage driver accountability, track location deviations of trips and all its sub-entities, monitor condition of shipment items, monitor vehicle utilization and fuel costs.
Rules are typically applied on all entities of a specific type, such as all vehicles, all trips, its sub-entities, all shipments, facilities, or all drivers. You can also selectively apply a rule to specific vehicles or specific shipments.
Rules contain one or more conditions, which if met, generate alerts or incidents, and you are notified.
Rules can be broadly categorized into the following categories:
-
Location-Based Rules: Use location rules to monitor the geo-location of entities. For example, you can track when a vehicle leaves its assigned stop of a trip, and use the rule to generate an incident.
-
Threshold-Based Rules: Threshold rules are based on sensor or metric values. Use threshold rules to track sensor values, such as fuel levels and temperature values. For example, you can configure a threshold rule to raise an alert when the fuel levels of a vehicle goes below a threshold value.
You can configure a threshold rule to trigger an incident based on sensor values of temperature or humidity. For example, you may want to monitor the condition of ship-items being transported in a trip.
Threshold rules also let you track KPI values, such as the number of open incidents. For example, you may want to trigger an alert if the number of open outage incidents cross a threshold number.
-
Alert Rules: Use alert rules to respond to device alert conditions. If your sensor device supports alerts, then you can use alert rules to configure alert responses. For example, an alert rule can trigger a device action based on an alert.
- Event-Based Rules: In this rule, you define event codes and target external subscribers to notification accounts. When the rule condition is met, the corresponding event is transmitted to the external system or to a webhook.
Use rules to trigger the following:
-
Incidents: Use incidents to report issues and notify the maintenance staff or concerned user for resolutions.
The number of open incidents prominently appears on the metrics bar on the map view. Open incidents against an entity are also flagged under the respective entity's information page. You can access all reported incidents from the Incidents page of the Operation Center. The Organization Dashboard can lead you to the specific entities with open incidents.
-
Alerts: Use alerts to pass device-related alerts to other integrated applications or to generate messages that inform the state or condition of an entity. You can access all reported alerts from the Alerts page of the Operation Center, information page of each entity, or from the Organization Dashboard.
-
On the Design Center, from the Organization view, use the Rules option.
-
On the Design Center, from the left navigation bar, select the entity for which you need to create a rule, and then use the Rules option.
Create a Rule
Create a rule to generate an incident or alert when a specific entity or all entities of a specific type, meets one or more conditions.
Rules Usage Examples
Review a few scenarios for creating rules that generates incidents or alerts.
Typically, you apply rules on all entities of a specific type, such as all vehicles, all trips, its sub-entities, all shipments, facilities, or all drivers. Alternatively, you can selectively apply a rule to specific vehicles or specific shipments. In the following examples, let's assume that the required vehicle types, vehicles, and trips have been configured in the application and you are familiar with the steps to Create a Rule.
Monitor Vehicles
The following examples show you how to use sensor attributes and metrics to keep track of vehicles' performance.
Example 15-1 Detect over-usage of fuel by vehicles
Scenario: As an administrator, you should receive alerts when any vehicle consumes unusual amount of fuel, which can help you monitor fuel efficiency and performance of vehicles.
Solution: Create a rule on the vehicle type, use the ora_obd2_total_fuel_used
sensor attribute to check the fuel usage to a value, and raise an alert if the condition is met.
Example 15-2 Detect vehicles that are inactive
Scenario: As an administrator, you should have a list of vehicles that have been inactive over a period of time.
Solution: Create a rule on the vehicle type, use the inactive_duration
system-defined metric to check the duration of inactivity with a value, and raise an incident if the condition is met.
Monitor Trips
The following examples show you how to use system-defined metrics in rules to get notified about trips.
Example 15-3 Monitor distance covered by a trip
Scenario: As an administrator, you should be able to identify those trips that cover unusual distances.
Solution: Create a rule on trips, use the sys_distanceTravelled
system-defined metric to check the total distance traveled, and raise an incident if the condition is met.
Example 15-4 Monitor duration elapsed in a trip
Scenario: As an administrator, you should be aware of those trips whose duration have exceeded a specific time threshold.
Solution: Create a rule on trips, use thesys_elapsedDurationSeconds
system-defined metric to define a condition, and raise an alert if the condition is met.
Use Contextual Parameters in Incident Messages
When creating rules, you can use dynamic contextual parameters in the incident details. You can also use contextual parameters in string message values of your incident messages. The incident messages with contextual information are also sent as email notification to the subscribed users.
Contextual parameters can include variables, such as entity names, sensor values, metric values, and location coordinates of the entity. These variables are dynamically resolved each time the rule is triggered.
The following incident fields can include dynamic contextual parameters:
- Summary
- Description
Here's an example of the rule configuration screen containing dynamic contextual parameters in the Summary and Description fields:
And here's an actual Incident created by the preceding rule:
The following contextual parameters can dynamically retrieve entity, sensor, metric, rule, and location related information:
Note:
The Shipment business object will be deprecated in a future release. Hence it is recommended to use Trips for real-time monitoring of in-transit movements.Parameter Type | Parameter Name |
---|---|
Vehicle |
|
Driver |
|
Facility |
|
Shipment |
|
Trip |
|
Equipment |
|
ShipUnit |
|
ShipUnit |
|
Rule | ${rule.id} |
The following examples describe the usage of the parameters:
-
Vehicle Parameters
-
${vehilce.name}
: Retrieves the name of the asset for which the incident is generated.For example: The entity ${vehicle.name} has low fuel.
May translate to:
The asset RedTruck has low fuel
. -
${vehicle.id}
: Retrieves the ID (GUID) of the asset for which the incident is generated.
-
-
Sensor Parameters
-
${event.sensor.attributeName}
: Retrieves the value of the specified sensor attribute name.For example: The entity ${vehicle.name} has low fuel level: ${event.sensor.fuel}%.
May translate to:
The entity Truck1 has low fuel level: 10%
.Here,
fuel
is a sensor attribute for the truck asset.
-
-
Metric Parameters: You can use metric-related parameters only if the rule condition uses the metric.
-
${event.metric.name}
: Retrieves the name of the metric that triggered the rule. -
${event.metric.value}
: Retrieves the value of the metric that triggered the rule.For example: ${event.metric.name} for ${vehicle.name} is High: It is ${event.metric.value}.
May translate to:
Average Temperature for Engine1 is High: It is 150.
-
-
Rule Parameter
${rule.id}
: Retrieves the ID (GUID) of the rule for which the incident is generated. -
Location Parameters: You can use these contextual parameters only in location-based rules.
-
${event.location.deviceId}
: Retrieves the Device ID of the asset device. -
${event.location.latitude}
: Retrieves the latitude co-ordinates of the device. -
${event.location.longitude}
: Retrieves the longitude co-ordinates of the device. -
${event.location.altitude}
: Retrieves the altitude reading of the device.For example: The entity ${vehicle.name} has exited its designated location. The entity's co-ordinates are: ${event.location.longitude} ${event.location.latitude}.
May translate to:
The vehicle Truck21 has exited its designated location. The vehicle's co-ordinates are: -122 37.
-