So, assuming you have the agent collecting (from the previous blog post: Real life question. Love Foglight for SQL but could it also help us with monitoring files? Answer Yes) we can navigate to Create Rule and start to create the rule.
I’ve highlighted the important bits. The rule is data driven (so when the agent collects the number of files in the folder, the rule will fire). The cartridge is whatever I called it originally (ie. A custom one) and the topology type is shown, you then click the 1st green button to put the type into the area below and click the green tick to check this is a valid rule scope.
Step 2 is to define whatever your logic is.
So for Warning, activate this level and I’ve put filecount > 4
Then Critical is > 8
And finally fatal > 12
Typically, we wouldn’t hardcode the threshold values, we would use registry variables. But this will suffice for the demo.
So, I leave it running while my CSV files are created, and here we see the alarm when we have > 12 CSV files
On the history tab we see how the alarm went from warning (>4), then critical (>8) and finally into Fatal once we reached more than 12. Once the files are processed the alarm will self-clear.
The dashboard at this point:
So fairly straight forward and a great easy way to customise Foglight for these annoying checks that you might be doing which can then be automated.