Updating the anti-virus database in HTTP mode

March 5, 2024

ID 179882

With default configuration, Kaspersky Scan Engine uses the anti-virus database from the ./bin/bases directory. You can update the anti-virus database by sending a signal or an HTTP request to Kaspersky Scan Engine.

When the anti-virus database is updated, the encrypted user agent string of Kaspersky Scan Engine is transferred to Kaspersky. See also the full list of data that is transferred to Kaspersky during an update.

Updating the database on demand

If you want to update the database manually, use updating on demand.

To update the database on demand in Linux by using signals:

  1. Before starting the kavhttpd service, specify the update setting in kavhttpd.xml.
  2. Start the kavhttpd service.
  3. Send a SIGUSR2 signal to the kavhttpd service.

    If the client and Kaspersky Scan Engine are installed and running on the same computer, you can send an HTTP request to the /api/v3.0/update/start address to update the database. Note that if you send this request from a different computer, Kaspersky Scan Engine will throw a 405 Method Not Allowed error. If the database update has been successfully initiated, the HTTP response will contain the following JSON object:

    {

    "status": "update started"

    }

    To learn how to track the database update status, see subsection "Getting the database update status" below.

To update the database on demand in Linux by using the sample HTTP client,

Call the sample HTTP client with the -d option:

kavhttp_client -j -d

To update the database on demand in Windows,

Call the sample HTTP client with the -d option:

kavhttp_client.exe -j -d

See also the detailed information on scheduling automatic database updates.

Getting the database update status

If you want to obtain the database update status, send a GET request to the /api/v3.0/update/status address or the /api/v3.1/update/status address.

You can only send this request if the client and Kaspersky Scan Engine are installed and running on the same computer.

When Kaspersky Scan Engine receives the request, it returns a response in the following format:

{

"status": "%UPDATE_STATUS%",

"progress": "%UPDATE_PROGRESS%",

"last_update_result": "%UPDATE_RESULT%",

"last_update_time": "%UPDATE_TIME%",

}

where:

  • status is the current status of the database update. It can have one of the following values:
    • "in progress"
    • "not started"
  • progress is the progress, in percent, of the database update.

    This element is only included in the response if the database update is being performed at present (that is if the status element has the value of "in progress").

  • last_update_result is the result of the last database update. It can have one of the following values:
    • "success"
    • "all components are up to date"
    • "invalid update sources"
    • "not all components are updated"
    • "download error"
    • "error while updating"
    • "error %ERROR_CODE% occurred", where %ERROR_CODE% is the error code received from Kaspersky Scan Engine

    This element is only included in the response if the database update is not in progress at present (that is if the status element has the value of "not started").

  • last_update_time is the date and the time of the last database update in the following format: %hh%:%mm%:%ss% %DD%.%MM%.%YYYY%.

    This element is only included in the response if the database update is not in progress at present (that is if the status element has the value of "not started").

Additional fields in KAV protocol version 3.1

If you send a GET request to the /api/v3.1/update/status address, you can get more information about the database update process. Some database updates can be used only after a reboot of the operating system or a restart of KAV SDK. In this case a response of KAV HTTPD has the extended format:

{

"status": "%UPDATE_STATUS%",

"progress": "%UPDATE_PROGRESS%",

"last_update_result": "%UPDATE_RESULT%",

"last_update_time": "%UPDATE_TIME%",

"action_needed": "%ACTION_NEEDED%",

"action_apply_period": "%APPLY_PERIOD%"

}

Here:

  • %ACTION_NEEDED% is the action to perform before you can apply the updates. It can have one of the following values:
    • Product restart needed

      This means that you must restart KAV HTTPD.

    • OS reboot needed

      This means that you must reboot the operating system on which KAV HTTPD runs.

  • %APPLY_PERIOD% is the recommended period (in hours) to perform the action specified in %ACTION_NEEDED%.

    This action is not performed automatically, you must perform it yourself.

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.