
Installing an agent on Linux servers
We need an agent to manage Linux/Unix machines; in this recipe, we will install it manually on a Linux machine.
Getting ready
In case of a Linux installer, make sure that it is copied from the same VCM server where the managed machine will get managed, as VCM certificates are embedded in the installer. If we use an installer from another VCM server and then try to manage it from a different server, it will fail.
Copy the correct installer from the VCM server to the Linux server.
Install the prerequisites and verify that the glibc.i686
, net-tools
, and redhat-lsb-core
packages have been installed on the target machine.
Open port 26542
if a firewall is enabled.
We need the root password of the machine where the agent will be installed.
The agent is available at X: \Program Files (x86)\VMware\VCM\Installer\Packages\CMAgent.5.8.2.linux
on the VCM Collector server. We don't need to copy the certificate the way we did in Windows as the certificate is built into the installer.
How to do it...
Follow the steps to install the agent on a Linux machine:
- Copy the installer with
scp
orwinscp
on the server. - Log in to the Linux server as root.
- Run
chmod u+x CMAgent.5.8.2.linux
. - Run
./CMAgent.5.8.2.linux
. - Copy the modified and
savedcsi.config
file to the extracted location.Note
Note:
csi.config
is a configuration file used by the VCM agent to install the agent.More details about the configuration options can be found at https://www.vmware.com/support/vcm/doc/help/vcm581/Content/NIX/CM_Ref_UNIX_csi_config_options.htm.There are lots of options available to configure the
csi.config
file.We need to set
CSI_AGENT_RUN_OPTION = daemon
to start this as a daemon; for the rest, you can consult with your Linux admin and decide.An example:
# cp /<Shared_location> csi.config /<extractedlocation>/CSIInstall/csi.config
. - Once this is done, run the installer script using
./CSIInstall/InstallCMAgent -s
.Once the agent has been installed, follow the previous recipe from step 6 onward; just change the location from Licensed Windows Machines to Licensed UNIX Machines, and when entering details, set Machine Type as Red Hat Server or any other, depending upon the OS and as per the following screenshot:
How it works...
We added the agent to the Linux/Unix machines as well so that we can collect the details of the managed machines; then, those details will be used to check compliance and patch status.
There's more...
We can create a preconfigured csi-config
file and copy it to /opt/CMAgent
along with the installer.
Copy the content of the following script into a .sh
file.
Give it execute permission: chmod CMAgentInstall.sh 755
.
Then, run the ./CMAgentInstall.sh
command.
IPTABLES="/sbin/iptables" grep -i suse /etc/issue >/dev/null || rc=$? if [ $rc -ne 0 ]; then IPTABLES="/usr/sbin/iptables" fi ${IPTABLES}-save > /opt/APPL/iptables.CMAgent.preinstall ${IPTABLES} -I INPUT -m state --state NEW -p tcp --dport 26542 -j ACCEPT grep -i suse /etc/issue >/dev/null || rc=$? if [ $rc -ne 0 ]; then /sbin/SuSEfirewall2 open EXT TCP 26542 else grep -i maipo /etc/redhat-release >/dev/null || rc=$? if [ $rc -ne 0 ]; then /sbin/firewall-cmd --zone=public --add-port=26542/tcp --permanent else /sbin/service iptables save fi fi cd /opt; /opt/APPL/CMAgent.5.8.2.Linux cp /opt/CMAgent/csi.config.CMAgent /opt/CSIInstall/csi.config /opt/CSIInstall/InstallCMAgent -s
The script identifies the OS of the machine and, based on that, opens port 26542
on the local firewall. Then, it copies the preconfigured csi.config
file and, finally, installs the agent from the /opt/CSIInstall
folder.