wood burning stoves
The moose likes Java in General and the fly likes File count monitoring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "File count monitoring" Watch "File count monitoring" New topic

File count monitoring

Vernon Mimms

Joined: Feb 22, 2013
Posts: 1

Fellow developers,
Several failed attempts have made me very unsure of myself and I need your advise and expertise. I'll be as brief as possible.
I have banks of servers set up in 4 different configurations. I must be able to select one or more of these servers and ask them for the file count of specific directories every 2-3 seconds. (Could be a few seconds longer if needed) The server names and information for each is read in from a text file. The list of directories to monitor is also in the text file. This monitoring must go on non-stop changing if a different sever is selected. The servers are linux. I have used ProcessBuilder to build commands to retrieve the file counts and updated the counts with the return. While this is a heave way to go is works and I may go back to it. I have tried to open sockets to selected servers and request file_count from each server and have it return counts but the sockets have proven a nightmare. When they work it is great but they stop for no reason I can determine and have been very hard to work with for my complicated tasks. File counts are not the only thing I need to interact with the servers. I send many different requests to the servers like copy files (thousands of files), move files, edit files, generate reports and statistics. It all seems to break down with the constant file counting. If anyone has any good advise I would love to hear it.
Winston Gutkowski

Joined: Mar 17, 2011
Posts: 8927

Vernon Mimms wrote:It all seems to break down with the constant file counting. If anyone has any good advise I would love to hear it.


1. This sounds like an admin function to me. Have you asked one of your friendly sysadmins if they have anything that might help (and that they're prepared to let you use )?
2. Whatever you're doing, all this counting sounds incredibly "busy" to me. Have you looked at alternatives, like notifiers; or is this something you've simply been "told to do"?
3. Have you looked at the WatchService API?


Bats fly at night, 'cause they aren't we. And if we tried, we'd hit a tree -- Ogden Nash (or should've been).
Articles by Winston can be found here
I agree. Here's the link: http://aspose.com/file-tools
subject: File count monitoring
It's not a secret anymore!