Mac Agent Installation


 

SapphireIMS supports agent based discovery and inventory on Mac computers. Agents can be installed either manually or remotely from the SapphireIMS server using automation tasks.

The Mac agent supports the following capabilities:

  1. Discovery and Hardware Inventory Management

  2. Software Inventory Management

  3. Custom Inventory (File Trawl)

  4. Software License Compliance Tracking

  5. IT Policy Compliance Tracking

  6. Hardware and Software Inventory Reports

  7. Remote Control (only Direct Remote Control is supported)

  8. Software Installation (using custom BASH scripts)

  9. Custom Script execution (BASH scripts)

 

Note.gifNote: For remote installation of the Mac agent using the SapphireIMS server, follow the same instructions as for Linux. Refer Settings->IT Automation->Agent Installer->Remote Agent Installation for Linux.

Mac OS Versions supported

Mac agents are supported only on the following Mac OS versions

  1. 10.10: "Yosemite"

  2. 10.11: "El Capitan"

  3. 10.12: "Sierra"

  4. 10.13: "High Sierra"

  5. 11: "Big Sur"

 

Pre-requisites for Mac agent installation

 

Mac Agent Installation

 

  1. The agent installer package is shipped with SapphireIMS and located in the following folder on the server

SapphireIMS\ConsoleManagement\ExternalWar\SoftwareRepository.war\SapphireIMSAgent.zip

  1. Copy the SapphireIMS agent installer file SapphireIMSAgent.zip to any folder in the target system.

  2. Open a Terminal and go to the folder where the agent installer is located.

  3. Extract the files from the archive using the following command

unzip SapphireIMSAgent.zip

  1. The following files will be extracted into the same folder.

sapphire_agent_installer_scripts.tar.gz

sapphire_agent_cksum.txt

sapphire_agent_install.sh

  1. You can install the SapphireIMS agent by running the following command as 'root' user.

'sh sapphire_agent_install.sh –installloc /opt –server 172.16.11.133 –port  80  –username  sapphire –password  ims'

or by running the following command as a 'sudo' user

'sh sapphire_agent_install.sh –sudo –install –loc /opt –server 172.16.11.133 –port  80 –username  sapphire –password ims'

  1. After successful installation, the SapphireIMS agent will automatically be discovered by the SapphireIMS server.

  2. The usage of the agent installer command is as follows

'sh sapphire_agent_install.sh <-sudo|-nosudo> <-install|-reinstall> -loc <install_path> -server <ServerIP/Hostname> -port <port> -ssl <1-https 0-http> -username <Username> -password <Password>  -proxyip <ProxyIP/Hostname> -proxyport <Proxy Port> -proxyusername <Proxy Username> -proxypassword <Proxy Password> -proxyssl <1-https 0-http> -ou <Organization Unit> -tag <Asset Tag> -customername <customer name> -siteid <site id>'

  1. The arguments are described below.

Serial No

Command Option

Mandatory or Optional

Description

     1

-sudo|-nosudo

Optional  

-sudo: used with a sudo user

-nosudo (Default): used with root user

     2

-install|

-reinstall

Mandatory

- install: used for fresh installation

- reinstall: used for a re-installation

     3

-loc

Mandatory

Specify the location for the agent installation

     4

-server

Mandatory

Specify the IP address or Hostname of the SapphireIMS Server

     5

-port

Mandatory

Specify the port

     6

-username

Mandatory

Specify the server username for agent communication

     7

-password

Mandatory

Specify the password for agent communication

     8

-ssl

Optional

0 (default)- use http for agent communication

1 -use https for agent communication

     9

-proxyip

Optional

Specify the IP address of a proxy server if setup

     10

-proxyport

Optional

Specify the port of the proxy server

     11

-proxyusername

Optional

 

 Specify the user name for the proxy server

     12

-proxypassword

Optional

 Specify the password for the proxy server

     13

-proxyssl

Optional

0 (default)- use http for agent communication

1 -use https for agent communication

     14

-ou

Optional

Specify the Organization Unit to which the asset belongs

     15

-tag

Optional

Specify the Asset Tag

     16

-customername

Mandatory (for SapphireIMS SaaS only)

Specifies the customer name

     17

-siteid

Mandatory (for SapphireIMS SaaS only)

Specifies the site id

 

 

Mac Agent Uninstallation

 

  1. To uninstall SapphireIMS agent run the following command on the Mac Terminal

sh /Applications/SapphireIMSAgent.app/SapphireOperations.sh  <-sudo|-nosudo> uninstall

Note: <-sudo|-nosudo> is an optional parameter; if not passed then value provided during agent installation is considered.

  1. After successful uninstallation, you will find a message “SUCCESS: SapphireIMS agent uninstall is completed.” displayed on the Terminal.

  2. After uninstallation delete the folder using the following command if you are logged in as 'root':

rm -rd /Applications/SapphireIMSAgent.app

If logged in as 'sudo' user, use the following command:

sudo sh  /Applications/SapphireIMSAgent.app/SapphireOperations.sh -sudo uninstall

          

Mac Agent Commands

 

sh  /Applications/SapphireIMSAgent.app/SapphireOperations.sh getpath

      If running as 'root' user enter the following command      

   sh /Applications/SapphireIMSAgent.app/SapphireOperations.sh  <Start|Stop|Restart|Status> 

      If running as 'sudo' user enter the following command

              sudo sh /Applications/SapphireIMSAgent.app/SapphireOperations.sh  <Start|Stop|Restart|Status>

               

Installing as a sudo user

 

/bin/ps, /bin/cat, /bin/mkdir, /bin/mv, /bin/kill, /bin/cp, /bin/ls, /bin/chmod, /bin/rm, /sbin/ifconfig, /bin/launchctl, /etc/resolv.conf, netstat, /bin/test, /usr/bin/gunzip, /usr/bin/unzip, /tmp , /usr/bin/tar, /usr/sbin/chown, /usr/bin/find, /usr/bin/zip, /bin/sh, system_profiler, /usr/sbin/sysctl, grep, visudo, /Applications/SapphireIMSAgent.app/SapphireOperations.sh,  $$TEMP_SCRIPT_COPY_LOCATION$$, $$MAC_AGENT_INSTALL_PATH$$

Cmnd_Alias  SAPPHIREAGENT=  /bin/ps, /bin/cat, /bin/mkdir, /bin/mv, /bin/kill, /bin/cp, /bin/ls, /bin/chmod, /bin/rm, /sbin/ifconfig, /usr/bin/unzip, /bin/launchctl, /etc/resolv.conf, netstat, /bin/test, /usr/bin/gunzip, /tmp , /usr/bin/tar, /usr/sbin/chown, /usr/bin/find, /usr/bin/zip, /bin/sh, system_profiler, /usr/sbin/sysctl, grep, visudo, ,/Applications/SapphireIMSAgent.app/SapphireOperations.sh,/var/tmp,/opt

<user> ALL=NOPASSWD: <command alias>

As an example if sudo user is ‘macuser’ and command alias is ‘SAPPHIREAGENT' then the entry will be as follows

macuser ALL=NOPASSWD: SAPPHIREAGENT