How to determine if an NCR ATM is in service or out of service programmatically based on fault logs?
I am working on a project where I need to programmatically determine whether a unit (e.g., an ATM or similar device) is in service or out of service. The unit generates logs that include fault entries, and my task is to analyze these logs to evaluate the service status.
Here’s the context:
Input Data:
- Logs contain fault entries with various types of issues (e.g., "Currency transport jam," "Card reader fault").
- Some faults are critical (impact service), while others are non-critical (do not impact service).
Current Approach:
- I parse the log entries and identify faults.
- If any fault is found, I currently classify the unit as "Out of Service." However, this is not accurate because certain faults do not disrupt service.
Desired Logic:
- Distinguish between critical faults (e.g., "Currency transport jam") and non-critical faults (e.g., "Printer low on paper").
- Mark the unit as Out of Service only if critical faults exist.
- Otherwise, mark it as In Service.
Programming Language:
- I am using powershell for testing but the main service is in C#.
What I’ve Tried:
- Created a list of critical faults.
- Iterated through log entries to match faults against the critical list.
Challenges:
- Some faults are ambiguous and may require thresholds (e.g., repeated non-critical faults within a time period might also disrupt service).
- I am unsure how to efficiently structure the logic for this evaluation.
Question: How can I implement a reliable method to evaluate the service status programmatically? Are there best practices for fault classification and status evaluation based on logs?
Example Log Entries:
19/11/2024,15:24:59.097,TTUSP,FW,<Fault>Currency transport jam</Fault>
19/11/2024,15:22:59.061,TTUSP,CU,<Fault>Printer low on paper</Fault>
Expected Output:
- If only "Currency transport jam" exists → Out of Service.
- If only "Printer low on paper" exists → In Service.
I appreciate any guidance or code examples!