Machine Agents Installer On Linux

Purpose

This document provides pre-requisites and SOPs for installing Cavisson agents (Machine Agent, APMs, and Log Agent) for PHP & Java programming framework using Cavisson Agent Installer.

Prerequisites

  1. Need to run by the root user.
  2. Installation of PHP 5.4 or later and any Server (Apache/Nginx) on the machine.
  3. Storage requirement – 1 GB.

Supported Platforms

It can run on below Linux environments:

  • Ubuntu
  • Fedora
  • OpenSuse
  • Redhat Enterprise
  • Suse Enterprise
  • CentOS
  • CoreOS
  • Amazon Linux
  • Alpine Linux
  • Oracle Linux
  • php(proxy)
  • NodeJS
  • Go
  • Python
  • Machine agent
  • Log agent

Installation Steps

  1. Download the Cavisson Agent Installer from the Build Hub.

       Path: http://Public-IP/others/AGENTS-INSTALLER
       Sample Installer file name: CavissonAgentInstaller-4.5.0.93.bin

  1. Store the file on your machine and provide execute permission.

       chmod +x CavissonAgentInstaller-x.x.x.xx.bin

  1. Execute the installer file.

Usage

Case1: All Agents with default values

./CavissonAgentsInstaller<x.y.z.build_number>.bin –cavisson-server=”Provide Cavisson server <hostname:443>” –tier=”Provide Tier name” –index-prefix=”Provide Index Prefix” –setup-name=”Provide Setup-name” –gateway-server=”Provide Gateway Server(Required for PHP Agent) <Gateway Server:port>”

Case2: Application and Machine Agents only

./CavissonAgentsInstaller<x.y.z.build_number>.bin –cavisson-server=”Provide Cavisson server <hostname:443>” –tier=”Provide Tier name” –gateway-server=”Provide Gateway Server(Required for PHP Agent) <Gateway Server:port>” –no-log-agent

 

./CavissonAgentsInstaller<x.y.z.build_number>.bin –cavisson-server=”Provide Cavisson server <hostname:port>” –tier=”Provide Tier name” –log-server=”Provide Log Server <hostname:443>” –index-prefix=”Provide Index Prefix” –setup-name=”Provide Setup-name” –gateway-server=”Provide Gateway Server(Required for PHP Agent) <Gateway Server:port>”

Installation with All arguments

./CavissonAgentsInstaller<x.y.z.build_number>.bin –basedir=”Provide Basedir-Default: /opt” –user=”Provide user account-Default: cavisson” –cavisson-server=”Provide Cavisson server <hostname:443>” –tier=”Provide Tier name-Default: Default” –server=”Provide Server Name-Default: Hostname” –log-server=”Provide Log Server <hostname:443>” –index-prefix=”Provide Index Prefix” –setup-name=”Provide Setup-name like Prod” –cavisson-server-protocol=”Provide Protocol-Default: wss” –gateway-server=”Provide Gateway Server(Required for PHP Agent) <Gateway Server:port>” –verbose=”Provide verbose option-Default: true” –heap-size=”Default is 256MB.(eg:-Xms256m -Xmx512m)”


Notes:
All parameters are optional and if not provided on the command line are picked from the bundled configuration file in binary. The default values in the configuration file provided in table “Keywords and their Values” in Appendix 1.

 

Installation only with python agent

bash CavissonAgentInstaller-Jdk-x.y.z.build.bin –basedir=”/opt” –user=” Provide user account-Default: cavisson ” –cavisson-server=”hostname:443″ –tier=” Provide Tier name-Default: Default ” –server=” Provide Server Name-Default: Hostname ” –cavisson-server-protocol=”TCP” –verbose=”true” –no-machine-agent –no-log-agent –no-nodejs-agent –no-php-agent –no-java-agent –no-go-agent

Execute installer as below to view help section

./CavissonAgentsInstaller.bin –-help

root@ubuntu:/home/cavisson/work# bash CavissonAgentInstaller-4.5.0.102.bin –help

10:09:58 Info: Distribution: Ubuntu 16.04

PLEASE EXECUTE THIS SHELL FROM “ROOT” USER

  1. Use this installer to install/upgrade Cavisson Agent modules like Machine Agent Module, Application Agent Modules.

 

  1. Options

[-b|–basedir] : Installation base dir eg: /home or /opt (default is /opt).

[-t|–tier] : Name to be given to a cluster of application servers running same application services

[-c|–cavisson-server]: Cavisson Server to which Application and Machine agents will be posting the captured data. Input format is <hostname:port>

  1. Advanced Options

[-u|–user]: User account to be used to start Cavisson Agent services. If this account doesn’t exist, installer will create this account. Default is cavisson.

[-s|–server]: Application server name. Default value will be the hostname of the server.

[-p|–cavisson-server-protocol]: Default is WSS(Web Secure Socket).Possible values WSS,WS,TCP.

[-x|–heap-size] : Default is 256MB. (eg:-Xms256m -Xmx256m)  User can customize it from /BASE_DIR/cavisson/monitors/sys/cmon.env

[-d|–endpointprefix]: EndPointPrefix to be given in ndsetting.conf (default is Collector)

[-f|–nd-endpoint-prefix]: ND_ENDPOINT_PREFIX to be given in cmon.env (default is collector)
[-T|–tags]: TAGS name to be given in ndsetting.conf file.

[-A|–attributes]: ATTRIBUTES name to be given in ndsetting.conf file.

  1. Log Agent Module Configurations

[-i|–index-prefix]: Prefix string that will be prefixed to all log indices managed by Log server

[-o|–log-server]: Centralized log server to which application logs will be sent in <hostname:port> format.

[-e|–setup-name]: Setup-name

[-n|–nf-endpoint-prefix]: NF_ENDPOINT_PREFIX to be given in nf.env (default value is netforest)

  1. PHP Agent Module Configuration

[-y|–gateway-server] : Gateway Server <Gateway Server:port>

  1. Use the below options to omit/exclude any of the Agent installation

[-m|–no-machine-agent]: for Machine Agent

[-a|–no-java-agent]: for Application Agent(Java)

[-l|–no-log-agent]: for Log Agent

[-w|–no-php-agent]: for Application Agent(PHP)

[-j|–no-python-agent]: for Python Agent

[-z|–no-nodejs-agent]: for NodeJS Agent

[-g|–no-gateway]: for Gateway

  1. Python Agent Module Configuration
  • [-k|–python-version]: Python version (default is python3)
  •  

NOTE:

[uninstall.sh]: Uninstall.sh is created in “BASE_DIR”(given by user). This file can be used to uninstall the deployed Agent Modules.

Syntax for long arguments

Eg:-./CavissonAgentsInstaller<x.y.z.build_number>.bin –basedir=”/opt” –user=”cavisson” –cavisson-server=” Provide Cavisson server <hostname:443>” –tier=” Provide Tier name-Default: Default” –server=” Provide Server Name-Default: Hostname” –index-prefix=” Provide Index Prefix ” –log-server=“Provide Log Server <hostname:443>” –setup-name=” Provide Setup-name like Prod” –cavisson-server-protocol=” Provide Protocol-Default: wss ” –gateway-server=” Provide Gateway Server(Required for PHP Agent) <Gateway Server:port>“-Xms256m -Xmx256m” –nf-endpoint-prefix=”netforest” –endpointprefix=”Collector” –nd-endpoint-prefix=”collector” –verbose= “ Provide verbose option-Default: true“key=inline:value:value1, key1=env:NDHOME:value2,key2=nds:proxyMode: value3 “attributes= “key=inline:value:value1, key1=env:LD_LIBRARY_PATH:value2, key2=nds:instance:value3″”

Syntax for short-hand arguments

Eg:-./CavissonAgentInstaller-<x.y.z.build_number>.bin -b”/ Provide Basedir-Default:” -u” Provide Cavisson server <hostname:443>” -c” Provide Cavisson server <hostname:443>” -t” Provide Tier name-Default: Default ” -s” Provide Server Name-Default: Hostname ” -i” Provide Index Prefix ” -o” Provide Log Server <hostname:443>” -e” Provide Setup-name like Prod ” -p” Provide Protocol-Default: wss” -y” Provide Gateway Server(Required for PHP Agent) <Gateway Server:port>” -x” Default is 256MB.(eg:-Xms256m -Xmx512m ” -n”netforest” -d”Collector” -f”collector” -v” Provide verbose option-Default: true ” -T”key=inline:value:value1,key1=env:NDHOME:value2,

key2=nds:proxyMode:value3″ –

A”key=inline:value:value1,key1=env:LD_LIBRARY_

PATH:value2,key2=nds:instance:value3\

Verification of Installation

Once you execute the installer, you can see the messages that show that agents are successfully installed.

Directory Structure

For Machine Agent Module: $Base_DIR/cavisson/monitors
For PHP Agent Module: $Base_DIR/cavisson/netdiagnostics/php
For Java Agent Module: $Base_DIR/cavisson/netdiagnostics/java

For Python Agent Module: $Base_DIR/cavisson/netdiagnostics/python

Files to check for PHP Agent

Check that Proxy Control file and PHP Agent .so file is present at the below mentioned paths.

Proxy Control File

Path: $Base_DIR/cavisson/netdiagnostics/proxy “proxyControl.<release>.<version>”
Example:  /opt/cavisson/netdiagnostics/proxy File- proxyControl.4.3.0.93

PHP Agent .so File

Path $Base_DIR /cavisson/netdiagnostics/php/extensions File- cavPHP<version>Agent<release>.<version>.so

Example: /opt/cavisson/netdiagnostics/php/extensions/cavPHP7.4Agent.4.10.0.39_Ubuntu20.so

Files to check for Java Agent

At ND_home, check for the lib directory. Below mentioned files should be present.

Steps to enable Java Agent

To enable Java Agent in any Java based server, add below command to the startup shell/Env setup file.

-agentpath: <ND_HOME>/lib/libjavanativeagent.so=feature_all -javaagent:<ND_HOME>/lib/ndmain.jar=time,ndAgentJar=<ND_HOME>/lib/ndagent-with-dep.jar,ndHome=<ND_HOME>

where, ND_HOME is $Base_DIR/cavisson/netdiagnostics

Note: For using Advance Features like:  Mutex Lock, memory profiling, OverOps. we need to add the following argument (Native Agent) along with the above (Java Agent) argument:

-agentpath:/home/cavisson/netdiagnostics/

lib/libjavanativeagent.so=feature_all

File to check for Python Agent

Path $Base_DIR /cavisson/netdiagnostics/python file- cavagent

Example: /opt/cavisson/netdiagnostics/python/cavagent

To run application with python agent, below is the command:

cavagent run python3 app.py

where cavagent run is used to hook python agent

Uninstallation Steps

  • In $Base_DIR/cavisson, uninstall.sh file should be present after completion of installation.
  • To uninstall, just run ./uninstall.sh.
  • It clears all the files and processes, which are initiated and created by the Installer.

Appendix 1 – Keywords and their Values

Keywords and their Values

Keywords

Default

Mandatory

Machine Agent

PHP Agent

Java Agent

Gateway

Nodejs agent

Python agent

–basedir

opt

No

Yes

Yes

Yes

Yes

Yes

Yes

–user

cavisson

No

Yes

Yes

Yes

Yes

Yes

Yes

–cavisson-server

Empty

Yes

Yes

Yes

Yes

Yes

Yes

Yes

–tier

Empty

Yes

Yes

Yes

Yes

No

Yes

Yes

–server

Empty

Yes

Yes

Yes

Yes

No

Yes

Yes

–cavisson-server-protocol

WSS

No

Yes

Yes

Yes

Yes

Yes

Yes

–gateway-server

<server:1111>

No

No

Yes

No

No

No

No

proxyConType

0

No

No

Yes

No

No

No

No

proxyMode

1

No (If using proxy)

No

Yes

No

No

No

No

–heap-size

-Xms256m -Xmx256m

No

Yes

No

No

No

No

No

–index-prefix

Empty

No

No

No

No

No

No

No

–log-server

<ServerHost:Port>

Yes

No

No

No

No

No

No

–setup-name

Empty

No

No

No

No

No

No

No

–nf-endpoint-prefix

netforest

No

No

No

No

No

No

No

–endpointprefix

Collector

No

No

No

Yes

Yes

Yes

Yes

–nd-endpoint-prefix

collector

No

Yes

No

No

Yes

Yes

Yes

–tags

Empty

No

Yes

Yes

Yes

Yes

Yes

Yes

–attributes

Empty

No

Yes

Yes

Yes

Yes

Yes

Yes

–python-version

python3

No

No

No

No

No

No

Yes

Excluding Agents from Installation

To exclude any agent in the installation process, refer the below section:

Agent to Exclude

Command

Machine Agent

–no-machine-agent

NF Agent

–no-log-agent

NetDiagnostics Java Agent

–no-app-agent

NetDiagnostics PHP Agent

–no-php-agent

NetDiagnostics python agent

–no-python-agent

NetDiagnostics nodejs agent

–no-nodejs-agent

NetDiagnostics gateway

–no-gateway

 

Example: To exclude the NF Agent from the installation:

./CavissonAgentsInstaller.bin –basedir=”<base directory>” –user=<user name> –cavisson-server=”<Hostname:Port>” –tier=”<tier name>” –server=”<application server name>” –cavisson-server-protocol=”<cavisson-server-protocol>” –php=”<php version>” –gateway-server=”<proxy IP:Port>”  –no-log-agent