I want to monitor the log file in windows machine using dynatrace. In my project, one of our services will updating the information in the log file and the log file will keep on updating for every 2 mins, but in some case the log file will stop updating.
Team want to monitor the log file when it is not updating for more that 10 mins. Please let me know the feasibility of monitor this situation using log file plugin or any other option.
Thanks & Regards
Solved! Go to Solution.
As a first answer:
You could use the Generic Execution Plugin to schedule periodically a script.
For example a windows command - or a power shell script. The script should check the modified date of your file and return for example a 1 or 0 value, this will be converted by the plugin to a AppMon measure which you can view into a dashboard.
There's also a Log File Monitor Plugin that you can use. You give it the file location, and each time it executes it will return a 1 if a new line was added since last time or a 0 if not. If you're only interested whether new stuff has been written to the log, then this should offer a quick fix.
P.S. This will only work if the log gets new information appended to it. If the existing stuff gets overwritten, and the log ends up having the same number of lines even though the information is new, then you might not get accurate results from this monitor.
Thanks a lot Radu!!!
Yes, my log file will keep updating every minutes. I don't want to know what is updating in the file, I just want to know the file is keep updating continuously.
I have few more concerns,
1. separate file will be creating on every day.
2. if there is any disturbance or activity, we will restart some services. so whenever restart new log file will create and update the logs.
In some time, 1st log file create will create 12:30 am (log1)and if service restart at 9am , new log file will create(log2), so after that we need to monitor the log2 file. Please let me know that the plugin will fulfill the requirement.
Thanks & Regards
The configuration has the "File Regex" option. This allows you to specify the name of the log file as a regular expression and only the newest file will be read. So if you have log1 created at 12:30am and then it restarts and creates another file log2 at 9am, you can give the file name as "log.*" and it will only read log2 because it's the newest file. As long as the location stays the same, you should be good to go.