views:

27

answers:

2

How do you verify the state of the environment for a system without drastically increasing the scope of the system?

I'm working on a system which talks to some remote servers. For example, it connects to a server and grabs logs of MyApp that ran on that server. These remote servers use a multitude of operating systems and are "manually" managed. Our system can't install MyApp on the remote servers, but our system can't function correctly if MyApp isn't installed.

I would like to check that these applications are installed on the remote server before our software does its job. And I'd like these checks to throw reasonable error messages.

My fear is that this can't be effectively done without our system "taking over" these remote servers and being responsible for their configuration -- which is way out of scope for our project.

What do you think?

+1  A: 

My best answer here is not to check and simply try to do the job as best as it can. If and when a problem occurs, throw the appropriate error message. What would be the purpose of checking beforehand that the application is not installed, other than to warn the user that it is not? It would be the same as simply going ahead and attempting to execute and then failing and telling the user the exact same message.

It's really not that bad of a strategy, for example in Python its encouraged to simply try to perform the function and then when an error occurs, recover properly.

If you really want to check for external resources, you could have a messaging service set up on the server which tells your application whether or not the resources exist. I don't know if you're allowed to set that up or not.

AlbertoPL
A: 

You might try requesting that a web server expose (password protected, of course) the logs directory; if your "MyApp" creates a log upon installation, you could just check the web server for the presence of the installation log.

McWafflestix