Hi Team,
Is it possible to monitor a log file size in windows for every five minutes.
Scenarios:
I have a log file which changes its size in frequent intervals.
If the file size remains same even after 3 checks with out changing its size, than an alert should be triggered.
If size changes , we should not want any alert.
Please help us with some checks for window OS
log file size monitoring in Nagios for Windows OS
-
Uday Kumar
- Posts: 32
- Joined: Wed May 11, 2016 11:59 pm
Re: log file size monitoring in Nagios for Windows OS
You should be able to write a plugin which would do this to be used with NSClient++, but it would take quite a bit of logic to have it do what you're after.
Using powershell you can get the size of the file with something like this -
You would need to build the logic after that though, so that it counts 3 checks and sets the exit code accordingly for Nagios.
Using powershell you can get the size of the file with something like this -
Code: Select all
PS C:\Users\rkennedy> get-item 'C:\netstat.txt'
Directory: C:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 6/13/2016 3:44 PM 13416 netstat.txt
Former Nagios Employee