As a good practice, I'll clone the Directories list and make my entries there. You can edit the properties for the Filecount agent.
So go ahead and deploy the package and create an agent using the Agent Status page. The script is set to monitor the filesystem of the machine running the fglam. Internally, this creates a cartridge that you can view in Cartridge Inventory and an agent package that can be deployed to a Foglight Agent Manager (fglam). Select the Filecount.bat file, then click "Build Script Agent". Once that completes, navigate to Administration -> Tooling -> Script Agent Builder. Usr is the foglight user (with Administrator role) and pwd is the password. You will need to change the items in red to suit your environment. We will first start by loading the monitoring-policy.xml file using fglcmd from the command prompt.Ĭ:\Quest_Software\Foglight\bin\fglcmd -srv fmshost -port 8080 -usr foglight -pwd foglight -cmd util:configimport -f C:\Foglight\FileCount\monitoring-policy.xml (Please visit the site to view this file) We have attached (hopefully!) to this post:Ģ- this is the script, it will need to be saved as Filecount.bat
It also contained code for using agent properties with a script agent, versus having to hardcode parameters into the script.įirst, we will need to save some files. Luckily for me, I found that a colleague had already written an agent to do just this. Although this is not something the Infrastructure monitoring agents do out of the box, Foglight has built in tooling for creating your own script agents.
I recently had a couple customers ask if we are able to monitor a Windows folder and count the number of files that are present.
Storage Performance & Utilization Management.Foglight for Virtualization, Enterprise Edition.I know this is not the easiest solution but it works as you intended and I didn't find a tool that will do this for you and given the fact that this is pretty easy to program as you mostly just have to copy&paste you are safer as you would be if you would take any random program from the internet. In the given code you can insert your move-files-command after "//Start processing.".
This guy wrote a fiddle that checks the folder you specify for new file creations and continues to process whatever you want when the file is complete (by trying to open it in a certain interval which will not work if the file is still being written). Net-Class provided by Microsoft, called "FileSystemWatcher" but sadly it doesn't check for copy completion (just create, change and delete-events). In this case you're lucky that there is a. If I run across problems like this and I don't find a suitable easy and understandable solution online I use my (limited) programming skills to find a solution. I'm sure other sysadmins have had to deal with this type of issue, so rather than reinventing the wheel myself, I'd like to hear what others have done. I use rsync regularly in Linux is it as reliable under Windows? More importantly, is rsync capable of handling a situation where a file has appeared but has not yet been completely written to - in this case can rsync (or other tool) wait until the file has been completely written before trying to move it?
I'd like some suggestions on how to achieve this. In Linux, there is a kernel hook to monitor in realtime the appearance of new files in a directory, I don't know if something similar exists in Windows, or if that would even be a desirable solution. Does not necessarily need to occur in real-time, but would like to keep it to within, say, 15 minutes of the appearance of the file. Monitor a folder for the appearance of new file(s), when such files appear, move them into a different folder. I would like to do the following in a Windows environment: