Hi,
I would like to monitor the size of a particular file, file located on a windows server.
By example :
If size != 0 : alert
In case of alert, I would like to send it to an email address.
Ideally I wouldn't like to install a component on my server (nrpe client,...etc)
What's the easiest way to perform that ?
How to monitor file size
Re: How to monitor file size
We have some plugins on the Exchange that check the file size of files on SMB shares, or FTP servers. Maybe one of these could be useful?
https://exchange.nagios.org/index.php?o ... ile%20size
Another option would be to create a passive check. This would be more work without an agent like NCPA on the system. But not impossible. You could create a Powershell script to query WMI for the file size, and report back via NRDP on the Nagios XI server. Here is a document that shows more information about NRDP.
https://assets.nagios.com/downloads/nag ... erview.pdf
Here is an example Powershell command for getting the size of a file.
https://exchange.nagios.org/index.php?o ... ile%20size
Another option would be to create a passive check. This would be more work without an agent like NCPA on the system. But not impossible. You could create a Powershell script to query WMI for the file size, and report back via NRDP on the Nagios XI server. Here is a document that shows more information about NRDP.
https://assets.nagios.com/downloads/nag ... erview.pdf
Here is an example Powershell command for getting the size of a file.
Code: Select all
(Get-WmiObject -Class CIM_LogicalFile -Namespace "root\cimv2" -Property "FileSize" -Filter "Name = 'C:\\Monitoring\\ReadHere\\blah.txt'").FileSizeAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!