Table of contents 

1. Introduction

2. Basic Architecture of Agent 

3. How the Discovery Agent Establishes Communication with Freshservice

4. Installation & Uninstallation of Discovery Agent

5. What information does the Agent fetch

6. How the Agent fetches information

7. Services


Introduction


The Discovery Agent effortlessly collects hardware and software data from an asset, ensuring that Freshservice consistently updates the asset inventory without requiring any additional effort from end users.


With the Discovery Agent installed on devices, the Freshservice asset inventory dynamically updates whenever there is a change, providing a streamlined and efficient approach to maintaining accurate and up-to-date asset information.

Basic Architecture of Agent 


How the Discovery Agent Establishes Communication with Freshservice

Integration Setup Process:

Agent Registration


Upon installation, the Discovery Agent automatically registers with Freshservice. It communicates with two crucial components: the Registration Key and the Access Key.

Authentication

Freshservice validates the Discovery Agent Registration Key using a secret hash. Successful validation leads to agent registration and the generation of an Access Key for authentication purposes.


Post-Registration Actions

Scanning and Updates

Following registration, the system conducts comprehensive scans to gather essential data. It also schedules regular updates, ensuring the system remains up-to-date with the latest features and patches.


Installation & Uninstallation of Discovery Agent

Installation:

The Freshservice Discovery Agent can be installed on Windows, Mac and Linux based systems. Refer to the links below for additional information on installing discovery agent on Windows, Mac and Linux.


Default installation paths:

  • Windows: C:\Program Files (x86)\Freshworks\Freshservice Discovery Agent\

  • Mac: /Library/Freshservice-Agent/Freshservice-Discovery-Agent/

  • Linux: /usr/local/sbin/Freshservice/Discovery-Agent/


Uninstallation :

The discovery agents installed can be uninstalled directly from Freshservice Portal. The link is included below for reference.

What information does the Agent fetch

Laptops and Desktop Computers

  • Name

  • User

  • Domain

  • Asset Type

  • Manufacturer/ Product

  • Serial Number 

  • Last Audit Date 

  • OS/OS Version/OS Service Pack 

  • Memory 

  • Disk Space

  • CPU Speed, CPU Core Count 

  • Mac Address

  • Components: Processor, Memory, Logical Drive, Network Adapter, Software installed in the device.

 Software Applications

  • Software Name

  • Version

  • Installed Machine

  • Installation Path

  • Installation Date


How the agent fetches information

 The Agent utilizes WMI (Windows Management Instrumentation) Queries to retrieve data from Windows machines, while it executes shell commands to fetch information from Linux and Mac machines.

Windows:
We use following WMI tables to fetch details from agent installed machine.

  • Win32_ComputerSystem - computer name, model, Manufacturer and user details 

  • Win32_BIOS - Version, Serial Number

  • Win32_ComputerSystemProduct - Model Version, UUID

  • Win32_OperatingSystem - Total Virtual Memory, Total Visible Memory, OS Version, Service Pack Major/Minor Version, OS Installed date, OS System drive, OS Manufacturer.

  • Win32_SystemEnclosure - Chasis Type

  • Win32_LogicalDisk - Drive type, Drive Name, File System, Size, Free Space

  • Win32_NetworkAdapterConfiguration - Adapter Name, IP Address, Mac Address, DHCP Status

  • Win32_PhysicalMemory - Memory Type, Capacity, Speed, Locator

  • Win32_Processor - Name, Manufacturer, Number of Cores, Max Clock Speed

Software details will be fetched from Registry only for Machine specific softwares by the Agent and both 32 and 64 bit software details will be fetched by the agent.

Enter scanned details will be stored in JSON format in a text file (scan-data.txt)

Mac:

Following are the Mac commands used by agent:

  • hostname -s - to get the name of the device.

  • system_profiler SPHardwareDataType to fetch Serial Number, UUID, CPU Speed, Number of cores, Model Identifier, Model Name.

  • last - command for getting user details.

  • sw_vers -productName - for OS name

  • sw_vers -productVersion - for OS version

  • sysctl - command to fetch computer information such as Model, Manufacturer, Number of cores, physical memory, and virtual memory

  • system_profiler SPApplicationsDataType - to fetch all installed software/application information.  For each software/application agent fetches only Name, and Version

  • system_profiler SPMemoryDataType - command is used to fetch the main memory(RAM) details such as Speed, Capacity, and Type

  • system_profiler SPStorageDataType - all storage details such as Drive Name, Drive Type, Drive File system, Drive Capacity, Free Space, and Mount Point.

  • ifconfig - to get network adapters details such as Name, IP Address, and MAC Address(For only active adapters).

 Linux:

Following are the Linux commands used by agent:

  • df  - to get the disk space information of mounted File systems

  • dpkg - to get information about available software packages (Debian packages)

  • hostname - to get the current host, domain or node name of the system

  • dmidecode - to get DMI table contents such as processor and memory information

  • lscpu - to get CPU architecture information

  • python - just to find operating system

  • rpm - to get information about software packages (Red-hat packages)

Files read by agent:     

  • /proc/cpuinfo  -  to get information about the CPUs (central processing units) on a computer

  • /proc/meminfo     - to get information about the available and used memory in a computer

In the above commands, dmidecode and ifconfig are the commands which need sudo privilege.  So a sudo user with the privilege to execute the dmidecode and ifconfig commands will suffice to discover Linux devices.

Services

Windows:

The Discovery Agent operates as a service on Windows. Users can start, stop, and restart the agent service manually. Upon installation, the service starts to perform background operations. Before uninstallation, the service is gracefully stopped to halt the agent's activities. The service is configured to automatically restart in response to exceptions or errors.

Mac and Linux:

On Mac, the scan is initiated by the daemon specified in '/Library/LaunchDaemons/freshservice.agent.daemon.plist'. In Linux, the scan task is triggered by the cron job named '/etc/cron.d/FSAgentCron'. Commands can be used to force the agent to perform specific operations.