Jump to content
turgel

notification when file size exceeds limit

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By Sean Faria
      Hi Team,
       
      Has anyone tried the new feature custom titles? I have tried it with two applications and keep getting "Failed to read metadata".
      Can anyone help with this?
       
      Thank you,
      Sean Faria

    • By Parallax Abstraction
      Hey all.
      I've enabled 2FA on my Pulseway account but I'm having an issue with it constantly prompting for 2FA every time I try to use Remote Control on a system I manage from the Pulseway Dashboard application. I have the setting enabled in the WebApp to refuce the frequency of the prompts but it doesn't seem to have made much of a difference. I seem to be getting prompted every time. I'd honestly rather get prompted once when I launch the Dashboard application then every single time I want to remote to a system.
      Is there a way to stop these constant 2FA prompts without disabling it entirely? Thanks!
    • By Parallax Abstraction
      Remote Control really needs the ability to both trigger a reboot and to automatically reconnect when the system you're connected to completes the restart. Having it immediately disconnect when a reboot is triggered (usually if it's running as a service, it should be able to hold the session open for things like the first phase of installing Windows updates) and having to manually try over and over again to see if the machine has completed its reboot is really frustrating when you're trying to solve an issue remotely that requires a lot of reboots or even when you're just trying to do a number of updates to a system.
    • By AC_Martin_J
      I'm currently running Pulseway OnPrem (7.0.0 build 120 release 283), and I'm using Pulseway Remote Control (6.6.3). 
       
      The issue I have experienced is that the remote control notification doesn't always show up on the client when I attempt to remote control a session. We have 150+ computers in our environment and sometimes it works fine, and sometimes it doesn't, and the different behavior can even occur on the same machine from time to time.
      Pulseway is configured to automatically allow the remote session if no one accept (or deny) the request within a minute, and I have noticed that even if the notification doesn't show up, the connection will still be established when the timer runs out. 
       
      To make things clearer, here are two different scenarios. (Scenario 2 is the incorrect behavior)
      Scenario 1:
      Select computer -> Select active session -> Client notification "do you allow x to remote control" -> User press Allow -> Remote session established 
      Scenario 2:
      Select computer -> Select active session -> Client notification not shown -> 1 minute timeout -> Remote session established 
       
      Are you guys aware of this? Has anyone else experienced the same behavior?
    • By DuarteV
      Hi, having trouble discovering SNMP on Windows 8.1 pc, geting error: Rquest Timeout, have tried with Firewall off and the same error, the device already works with another requester, can anyone help?

×
×
  • Create New...