H9.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:

Executable file

Location

Description

drweb-cmd-<OS>-<bitness>

Control Center, the Administration → Utilities section

Independent version of the utility. Can be launched from any directory or on any computer with corresponding operating system.

The webmin/utilities Server directory

drwcmd

The bin Server directory

Utility version depends on server libraries. Can be launched only from its location directory.

info

The drweb-cmd-<OS>-<bitness> and drwcmd version of the utility are similar in their functions. Further in the section, the drwcmd version is given, but all examples are relevant for both versions.

warning

For connection of the Server remote diagnostics utility, you must enable Dr.Web Server FrontDoor extension. To do this, in the Dr.Web Server configuration section, on the Modules tab, set the Dr.Web Server FrontDoor extension flag.

 

For connection of the Server remote diagnostics utility, administrator that connects via the utility, must have the Use additional features permission. Otherwise, access to the Server via the remote diagnostics utility will be forbidden.

The Server settings to connect Dr.Web Server remote diagnostics utility are given in the Administrator Manual, p. Dr.Web Server Remote Access.

The start instruction format

drwcmd [<switches>] [<files>]

Allowed Switches

info

The drwcmd utility uses switches according the general rules described in the H1. Introduction.

--?—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:

ssl://127.0.0.1 user1 password1

ssl://127.0.0.1 user2 password2

ssl://127.0.0.1 user pass%Sword

--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.

info

User name and password will be read from the .drwcmdrc file (can be redefined in the --resource switch), if it is not forbidden by the --read switch.

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.

For example

To execute the command from the --command switch and then a console commands, enter the following:

drwcmd --commands=<commands> -- -

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.