[Logo] OpenEgg.org - Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
New feature to Command line clients  XML
Forum Index » Feature Request
Author Message
Brahim


Joined: 09/04/2008 23:28:33
Messages: 1455
Online


The Command Line client can be scripted.
This is be useful for those wanting to manage their RAID configurations through scripts or their favorite automation tools.


----------------------------------------------------------------------
Quick tutorial (full tutorial will be posted on the main site when I get a chance to)

To run the command line client in:
- Interactive mode: FlexRAIDClient [Host] [Port] [Timeout]
- Non-Interactive mode: FlexRAIDClient Host Port Timeout Command

The Host/Port/Timeout parameters are optional in interactive mode, but required in non-interactive mode.

To use the default values for the Port and Timeout parameter, use a '-' as value.
Ex: FlexRAIDClient localhost - - run C:\cmds\create.txt

For the non-interactive mode, the "Command" parameter represents the command you would normally type in interactive mode.
In the previous example, the bolded text is the command.

In non-interactive mode, the client will return an exit-code that you can make use of in your script.

Exit-Codes:


Sample script 1:


Sample script 2:


Where config.txt would contain something like (see command templates package for more info):

This message was edited 13 times. Last update was at 25/09/2009 13:32:20


Server (VMware ESXi): dual Quad 8356@2.4Ghz | ASUS KFN5-D SLI | 16GB (4x 4GB) DDR2 667Mhz ECC REG w/Parity [Chipkill] | Radeon X300 | Intel 160GB SSD (VM datastore) | 6+ TB storage
File Server VM (running FlexRAID): 512MB RAM | 2 vCPUs | 6TB storage | Parity on 2TB NAS
gorman


Joined: 03/11/2008 09:57:22
Messages: 146
Offline

Are you referring to 009?

And is this something to be used on schedulers, right?
Brahim


Joined: 09/04/2008 23:28:33
Messages: 1455
Online

gorman wrote:Are you referring to 009?

And is this something to be used on schedulers, right?


This will be on the command line clients.
There multiple parts to FlexRAID:

- A Host service: currently at RC 3 build 008 (009 released to select users)
- A Web UI client: currently at build 3
- A DOS/Shell client: currently at RC2 build 001

The next release of the DOS/Shell client will have the stated feature.
Currently, you can only use the DOS/Shell client in interactive mode (you cannot script against it).

The non-interactive mode will be useful for those not wanting to use the Web UI but wanting to automate/manage FlexRAID through a script and their own scheduler/tool of choice.

The Web UI has a lot of features including a very good scheduler and e-mail alerts.
However, some users might prefer a more "lightweight" client configuration.

For instance, you will able to create a simple script (DOS script in this example) as follow:


Of course, there will be full documentation of how to use the DOS/Shell clients in non-interactive mode along with the full list of error and status codes.

This message was edited 5 times. Last update was at 06/01/2009 07:58:05


Server (VMware ESXi): dual Quad 8356@2.4Ghz | ASUS KFN5-D SLI | 16GB (4x 4GB) DDR2 667Mhz ECC REG w/Parity [Chipkill] | Radeon X300 | Intel 160GB SSD (VM datastore) | 6+ TB storage
File Server VM (running FlexRAID): 512MB RAM | 2 vCPUs | 6TB storage | Parity on 2TB NAS
Brahim


Joined: 09/04/2008 23:28:33
Messages: 1455
Online

Another thing to add is that, you could have a file monitoring tool kick off the parity update script.

Some users have expressed the idea of kicking off the parity update task (rsynch) when data changes are detected.
Those users could use a tool like FileMon for Windows to detect data changes and kick off the script.

On that note, is there a .NET developer here willing to go through this article(http://articles.techrepublic.com.com/5100-10878_11-6165137.html) and create a nice disk/folder monitoring tool for us?

Server (VMware ESXi): dual Quad 8356@2.4Ghz | ASUS KFN5-D SLI | 16GB (4x 4GB) DDR2 667Mhz ECC REG w/Parity [Chipkill] | Radeon X300 | Intel 160GB SSD (VM datastore) | 6+ TB storage
File Server VM (running FlexRAID): 512MB RAM | 2 vCPUs | 6TB storage | Parity on 2TB NAS
f00kie


Joined: 18/01/2009 16:01:18
Messages: 31
Offline

I'd just like to add that for anyone that wants to get an email everytime your rsynch or whatnot failed, use the script below:



Put the above code, edited of course, in a .vbs file and call it within the script Brahim posted at the top of this thread. Now, every time the exit code is greater than 0 (error), I get an email so I can investigate further.
Brahim


Joined: 09/04/2008 23:28:33
Messages: 1455
Online

Cool stuff.

Nice and very clean.


Server (VMware ESXi): dual Quad 8356@2.4Ghz | ASUS KFN5-D SLI | 16GB (4x 4GB) DDR2 667Mhz ECC REG w/Parity [Chipkill] | Radeon X300 | Intel 160GB SSD (VM datastore) | 6+ TB storage
File Server VM (running FlexRAID): 512MB RAM | 2 vCPUs | 6TB storage | Parity on 2TB NAS
jrwalte


Joined: 24/01/2010 11:20:01
Messages: 21
Offline

I'm having hard time getting my script to work.

What is the correct extension I should be using? .bat .cmd?

I've created the below script:


cd "C:\Program Files(x86)\OpenEgg.org\FlexRAID Basic CMD Client 1.0"
c:
set myhost=localhost
rem '-' means use the default value (9595)
set myPort=-
rem '-' means use the default value (2000 - [in milliseconds])
set myTimeOut=-
set cmdStart=FlexRAIDClient %myhost% %myPort% %myTimeOut%
set logFile=C:\logs\myLog.txt
%cmdStart% run C:\cmd\quick-validate.txt >> %logFile%


If I type all of the above lines in a cmd window, it works without a problem and I'll get an entry in the log file.

But when I try to run the .bat or .cmd nothing happens.

This message was edited 1 time. Last update was at 21/03/2010 14:34:11

Brahim


Joined: 09/04/2008 23:28:33
Messages: 1455
Online

Did you check that the host did not receive the command?

If you run the script by just double clicking, then you might need to pause it to see the output.
Otherwise, it will run quickly and close the window.

You are not monitoring the task.
So, your script essentially just sends the command and exists.


Server (VMware ESXi): dual Quad 8356@2.4Ghz | ASUS KFN5-D SLI | 16GB (4x 4GB) DDR2 667Mhz ECC REG w/Parity [Chipkill] | Radeon X300 | Intel 160GB SSD (VM datastore) | 6+ TB storage
File Server VM (running FlexRAID): 512MB RAM | 2 vCPUs | 6TB storage | Parity on 2TB NAS
jrwalte


Joined: 24/01/2010 11:20:01
Messages: 21
Offline

I ended up trying the webclient again (I couldn't get it to work previously) and it worked. It could have been that I changed from FlexRAID 1.2 to 1.3 or that I re-downloaded the webclient package.

All I had to do was import my .meta file and then setup a schedule and it's working without a hitch. Even have the email functionality working. The webclient is definitely a nice feature.
 
Forum Index » Feature Request
Go to:   
Powered by JForum 2.1.8 © JForum Team



Locations of visitors to this page