Hello,
I am trying to better understand how rule evaluation works in Robinhood v3 alert policies.
Context
My goal is simple:
- Raise an alert when a file matches a condition (e.g.
last_access > X)
- Clear the alert when the file no longer matches this condition
All files belong to the same fileclass (e.g. user_file).
Observed behavior
From my understanding and testing:
- Rules are evaluated in order
- A rule is selected based on
target_fileclass
- When a file matches a rule’s
target_fileclass, evaluation stops, even if the condition is false
- The
default rule is not applied if the file already matches a previous rule’s fileclass ( cf. Policy rule default)
This makes it difficult to express a simple transition such as:
IF condition → alert
ELSE → clear
within a single policy and fileclass.
Questions
- Is this behavior expected, or am I misunderstanding how rules are intended to be used?
- What is the recommended best practice to implement clearing of alerts when a file no longer matches a condition?
- Is it acceptable to define fileclasses based on attributes like
last_access, or is this discouraged?
As WorkArround, I tried the third question and defined a class based on last_access and apply a rule on it:
### Alers rules
alert_rules {
rule Old_Files {
target_fileclass = old_file;
action = cmd("/etc/robinhood.d/scripts/unige_alert.sh -d /srv/beegfs/scratch/log/robinhood/report/ -f {fullpath} -r OldFiles ");
condition = true;
}
# clear alert status
rule default {
action = none;
action_params { alert = clear; }
# apply to all entries that don't match 'raise_alert'
condition { alert.status == alert }
}
}
But i get this expected warning message:
2026/05/25 17:16:03 [2698682/1] PolicyCheck | WARNING: in FileClass 'old_file', line 180: time-based conditions should be specified in policy condition instead of file class definition
So what the best practice here ?
Thank you for your clarification.
Hello,
I am trying to better understand how rule evaluation works in Robinhood v3 alert policies.
Context
My goal is simple:
last_access > X)All files belong to the same fileclass (e.g.
user_file).Observed behavior
From my understanding and testing:
target_fileclasstarget_fileclass, evaluation stops, even if the condition is falsedefaultrule is not applied if the file already matches a previous rule’s fileclass ( cf. Policy rule default)This makes it difficult to express a simple transition such as:
within a single policy and fileclass.
Questions
last_access, or is this discouraged?As WorkArround, I tried the third question and defined a class based on last_access and apply a rule on it:
But i get this expected warning message:
So what the best practice here ?
Thank you for your clarification.