H7.4. Dr.Web Server Remote Scriptable Diagnostics Utility |
Dr.Web Server remote diagnostics utility allows remotely connect to Dr.Web Server for basic controlling and viewing the operation statistics. Unlike the drwcntl, the drwcmd utility can be used at scripting. The following console versions of Dr.Web Server remote scriptable diagnostics utility are provided:
The Server settings to connect Dr.Web Server remote diagnostics utility are given in the , p. Dr.Web Server Remote Access. The start instruction format drwcmd [<switches>] [<files>] Allowed Switches
•--?—show help message on switches for using the utility. •--help—show help message on switches for using the utility. •--commands=<commands>—execute specified commands (similar to the drwcntl utility commands). To specify several commands, use the ; sign as a separator. •--debug=yes|no—log utility operations in the debug mode (the stderr standard output stream). Default is no. •--files=yes|no—allow execution of the commands (similar to the drwcntl utility commands) from the specified files. Default is yes. Commands must be set in a file by one on each line. Empty lines are ignored. Use the # sign to start a comment. •--keep=yes|no—keep the connection with the Server after the last command is executed till the completion of the utility process. Default is no. •--output=<file>—output file for the Server response. By default, if the file is not specified, the stdout standard output stream is used. If the file name starts with the (+), then the result of commands execution will be added to the end to file, otherwise—file will be rewritten. •--password=<password>—password for the authorization at the Server. Can be defined in the file set in the --resource switch. •--read=yes|no—allow reading the Server connection parameters from the resource file. Default is yes. •--resource=<file>—resource file with the Server connection parameters: the Server address and administrator credentials for the authorization at the Server. By default, the .drwcmdrc file is used from the following directory: ▫For UNIX system-based OS: $HOME ▫For Windows OS: %LOCALAPPDATA% Each line in the file must contain 3 words separated by spaces: <Server> <user> <password>. To specify the space in the middle of a word, use the %S. If you need the percent sign, use %P. For example:
•--server=<Server>—the Server address. Default is ssl://127.0.0.1. Can be defined in the file set in the --resource switch. •--user=<user>—user name for the authorization at the Server. Can be defined in the file set in the --resource switch. •--verbose=yes|no—print detailed response of the Server (the stdout standard output stream). Default is no. The procedure for connecting to the Server: 1.When defining the data for the Server connection, the priority are given to the values specified in the switches --server, --user and --password. 2.If the --server switch is not specified, the default value is used—ssl://127.0.0.1. 3.If the --user switch is not specified, then the necessary Server is searched in the .drwcmdrc file (can be redefined in the --resource switch) and first user name is taken in the alphabetical order. 4.If the --password switch is not specified, then the search is performed in the.drwcmdrc file (can be redefined in the --resource switch) by the Server and user name.
5.If a user name and a password are not specified via the switches or the resource file, the utility prompts for credentials to be entered via the console. Commands execution features: •If the (-) values is set for the files with commands, then the utility reads command entered via the console. •If both command in the --commands switch and the files list are set, then the commands from the --commands switch are executed first. •If neither files of commands in the --commands switch are specified, then the commands entered via the console are read. To execute the command from the --command switch and then a console commands, enter the following:
Completion Codes •0—successful execution. •1—the help in switches is requested: --help or --?. •2—command line parse error: authorization parameters are not specified, etc. •3—cannot create output file for the Server response. •4—Server authorization error: wrong administrator's login and/or password. •5—Server connection terminated abnormally. •127—unknown fatal error. |