Posted November 26, 20159 yr Hello, I was wondering if it is possible to get a notification if a file exceeds a certain file size. In my case I want to get an alert when a file or a folder exceeds 5 GB. Is that possible? I only found an option to either monitor the whole harddisk or get an alert when a file changes in size
November 26, 20159 yr Staff Hi, You can get the file/folder size of a file with powershell (check this link: https://technet.microsoft.com/en-us/library/ff730945.aspx), if the condition matches then you can send a notification with this plugin: http://forum.pulseway.com/topic/962-notification-bridge and then create a scheduled task that will run the script every minute or so. Chris
November 26, 20159 yr Author Hi Chris, Â Thank you four the reply, i will check it out! Â Cheers, turgel
November 30, 20159 yr Author Hi everyone, After playing around with the powershell i wrote a small script which does the following: 1. get the size of a certain folder 2. take this result and compare it with a set limit (in this case 7500 Megabytes) 3. if this limit is exceeded it starts the pulseway notifcation bridge and sends out the notification.  This is very useful to me, i use it to monitor the sql database size of vmware vcenter. I will post it here, hopefully it will help someone else: ###########################################################  $h = 7500 $colItems = (Get-ChildItem "C:\THISFOLDER" | Measure-Object -property length -sum) "{0:N2}" -f ($colItems.sum / 1MB) + " MB" If ($colItems.sum / 1MB -gt $h ) { invoke-item "C:\YOURPULSEWAYFOLDER\NOT.lnk" }  ##################################################################  note: I made a link to the notifcationbridge.exe (NOT.lnk) to give to correct commands, writing it out directly in the powershell didn't work for some reason.
November 30, 20159 yr Staff Hi, Thank you for posting your script. Here is how you can start a process with arguments from powershell: $plugin = "C:\Users\paul\Documents\notification-bridge-plugin\Release\NotificationBridge.exe" &$plugin -p 1 -t "test" Note: The "NotificationBridge.exe" doesn't need to be in the same directory as Pulseway, neither the .dll file. Chris
Create an account or sign in to comment