![]()
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:
Discovery and Hardware Inventory Management
Software Inventory Management
Custom Inventory (File Trawl)
Software License Compliance Tracking
IT Policy Compliance Tracking
Hardware and Software Inventory Reports
Remote Control (only Direct Remote Control is supported)
Software Installation (using custom BASH scripts)
Custom Script execution (BASH scripts)
Note: 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 agents are supported only on the following Mac OS versions
10.10: "Yosemite"
10.11: "El Capitan"
10.12: "Sierra"
10.13: "High Sierra"
11: "Big Sur"
To install SapphireIMS agent on Mac systems, user must be either root or have sudo privileges. If the installation is being done as a user with sudo privileges, then complete the pre-requisites in Installing as a sudo user before proceeding with the rest of the installation
Target system should have Python version 2.6 or above installed. You can download Python from here.
Target system should have sqlite3 python module installed. This module is part of the Python standard library.
Target system should be reachable from SapphireIMS server over SSH (port 22), if SapphireIMS agents are remotely installed from SapphireIMS server using Automation tasks.
The SapphireIMS server should be reachable from the target system using HTTP/HTTPS. The URLs are as follows:
<http or https>://<SapphireIMS Server IP>:<SapphireIMS Server Port>/SapphireWS
<http or https>://<SapphireIMS Server IP>:<SapphireIMS Server Port>/SoftwareRepository
The agent installer package is shipped with SapphireIMS and located in the following folder on the server
SapphireIMS\ConsoleManagement\ExternalWar\SoftwareRepository.war\SapphireIMSAgent.zip
Copy the SapphireIMS agent installer file SapphireIMSAgent.zip to any folder in the target system.
Open a Terminal and go to the folder where the agent installer is located.
Extract the files from the archive using the following command
unzip SapphireIMSAgent.zip
The following files will be extracted into the same folder.
sapphire_agent_installer_scripts.tar.gz
sapphire_agent_cksum.txt
sapphire_agent_install.sh
You can install the SapphireIMS agent by running the following command as 'root' user.
'sh sapphire_agent_install.sh –install –loc /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'
After successful installation, the SapphireIMS agent will automatically be discovered by the SapphireIMS server.
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>'
The arguments are described below.
|
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.
After successful uninstallation, you will find a message “SUCCESS: SapphireIMS agent uninstall is completed.” displayed on the Terminal.
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
SapphireIMS agent supports the following commands
To get the SapphireIMS agent installed location, run the following command
sh /Applications/SapphireIMSAgent.app/SapphireOperations.sh getpath
To perform Start, Stop, Restart and Status operations on Agent, run the following command with the respective option
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>
If you are installing the Mac agent as a Sudo user there are some pre-requisites to be carried out. A 'sudoer' command list has to be created in '/etc/sudoer' file. SapphireIMS needs root privileges for these commands.
The command list which needs to be added includes the following
/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$$
The commands shown in red may need a path to be prefixed. The paths may differ based on the version of the MacOS.
'TEMP_SCRIPT_COPY_LOCATION' and 'MAC_AGENT_INSTALL_PATH' shown in Blue have to be replaced with the actual values from the global settings on the SapphireIMS server. Default values for above settings are ‘/var/tmp’ and ‘/opt’ respectively.' TEMP_SCRIPT_COPY_LOCATION' is the path where SapphireIMS agent installer files will be copied. 'MAC_AGENT_INSTALL_PATH' is the path where SapphireIMS agent files will be copied. The user installing the SapphireIMS agent should have read/write permission to both the directories.
A sudo user should be created and remote access enabled for the user.
Create a command alias for the all the commands (commands for which sudo privilege is required by SapphireIMS) by adding the following line in the sudoer file.
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
Enable no password option for the command alias by adding the following line.
<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