How to update the next scan date/time of a Discovery Agent

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

目的

It's possible to set the next scan date/time for each scan settings via the Discovery tool as shown in the screenshot below. However, it's not possible to set/update the same for a Discovery Agent on the UI. This guide is to show you where the setting can be found and how we could update it.  

ソリューション

As per Set up Discovery Agent, the Agent is ready to be deployed and ran without any changes required. In some situations, you might wish to have the Agent running the scan at a specific interval starting a specific date and time. These settings are in the Agent.cfg file located in the installation folder of the Agent. A common path of the Agent installation folder is C:\Program Files\Atlassian\Discovery Agent.

Sample Agent.cfg
<?xml version="1.0" encoding="utf-8"?><Settings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ScanLogLevel>Normal</ScanLogLevel><NextScanDate>2021-11-10T13:04:15.4476259+01:00</NextScanDate><ScanInterval>24</ScanInterval><AgentPort>51337</AgentPort><JustUseFirstIP>false</JustUseFirstIP><DeleteLogsAfter>7</DeleteLogsAfter><DisableTCPListener>false</DisableTCPListener><DirectCopyPath /><SFTPSettings><TransferReties>5</TransferReties><TranserRetryInterval>30</TranserRetryInterval></SFTPSettings></Settings>

To update the next scan date/time,

  1. Open the Agent.cfg file in a text editor.
  2. Set the desired date and time between <NextScanDate></NextScanDate>.
  3. XSD format (YYYY-MM-DDThh:mm:ss(+|-)hh:mm) should be used for the next scan date. For example, the next scan date and time should be November 10th, 2021 at 11pm UTC+1. This should be written as 2021-11-10T23:00:00+01:00.

  4. Save the Agent.cfg file for the new next scan date to take effect.
  5. To check if the new scan date is correctly saved, you can close the Agent.cfg file and open it again in a text editor to check the next scan date.
  6. You could also check the latest log in the logs folder in the Agent installation path. If the date is invalid, an error as shown below will appear and the previously saved date will be taken from the Agent.bak file which is a backup of the configuration file.

    11/10/2021 11:29:35 AM : Error loading settings.
    11/10/2021 11:29:35 AM : Exceptions:
    11/10/2021 11:29:35 AM : There is an error in XML document (1, 234).
       at Insight.Discovery.Tools.ObjectSerializer.DeserializeObject[T](String file, SerializeType sType) in C:\SourceCode\discovery_repo\DiscoTools\ObjectSerializer.cs:line 127
       at Insight.Discovery.Agent.Logic.Settings.TryLoad(String settingsFile) in C:\SourceCode\discovery_repo\Discovery_Agent\Logic\Settings.cs:line 109
    11/10/2021 11:29:35 AM : The string '2021-11-12T01:00+01:00' is not a valid AllXsd value.
       at System.Xml.Schema.XsdDateTime..ctor(String text, XsdDateTimeFlags kinds)
       at System.Xml.XmlConvert.ToDateTime(String s, XmlDateTimeSerializationMode dateTimeOption)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderSettings.Read4_Settings(Boolean isNullable, Boolean checkType)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderSettings.Read5_Settings()
    11/10/2021 11:29:35 AM : Could not load settings, settings are reseted from backup file.



説明 How to update the Next scan date/time of a Discovery Agent
製品Insight Discovery
最終更新日 2021 年 11 月 10 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.