Go to All Forums

Add the ability to alert on the number of files in a directory to Directory Checks

This would be incredibly helpful to alert on backed-up queue directories. For example, notify me if there are >1000 files in this directory.
Like (3) Reply
Replies (2)

We have written plugin in vbs and shell script which will get the File count and Directory count  from particular directory.

For adding this  plugin please follow the steps listed below 

1. Download the attached zip file and unzip filecount.zip under the Plugins folder
      Eg: C:\Program Files (x86)\Site24x7\WinAgent\monitoring\Plugins 
    
2. Edit the script to input the directory (absolute path ) to monitor. 

3. Now You can view the file count and Directory count in Plugin Page(Site24x7 account -> Server tab -> Plugins tab ).You can set threshold for file_count with 1000 and get alert when its violates.  
To Set Threshold - Plugin Page ->Threshold Profile -> Click on pencil icon to edit

To write Windows plugin

To write Linux plugin
Attachments
filecount.zip
Size: 1.45 KB
Like (0) Reply

Sabari, thanks for posting that helpful info.  I am not having any luck getting the info into the "Plugins" tab of the portal.  After checking the logs I'm noticing this in the "PluginRegisterLog.log"

10/18/2016 9:14:29 AM Register Plugin FileCount

10/18/2016 9:14:29 AM   Script Output 
10/18/2016 9:14:29 AM  Script output for FileCount is {"message":"Connection could not be established","data":{},"availability":"0"}
10/18/2016 9:14:29 AM  Util GetFileNameReg FileName is C:\Program Files (x86)\Site24x7\WinAgent\monitoring\bin\PluginRegister\FileCount.txt
10/18/2016 9:14:29 AM  Util writeToFileReg Successfully written to C:\Program Files (x86)\Site24x7\WinAgent\monitoring\bin\PluginRegister\FileCount.txt
10/18/2016 9:14:29 AM  Util writeToFileReg {"message":"Connection could not be established","data":{},"availability":"0"}
10/18/2016 9:14:29 AM  PluginDetails   {"filecount":{"displayname":"","pluginkey":"NULL","JsonCount":"0","status":"2","heartbeat":"True","version":"1"},"FileCount":{"displayname":"","pluginkey":"NULL","JsonCount":"0","status":"2","heartbeat":"True","version":"1"}}

Any advice?

Thanks,

-Chris

Like (0) Reply

Was this post helpful?