Installing Service Monitor Agent on Linux

Pre-installation Tasks

Service Monitor Agent has dependencies on the third-party package zlib-devel readline-devel bzip2-devel ncurses-devel gdbm-devel xz-devel tk-devel libffi-devel. Run the rpm -qa|grep -E "zlib-devel|readline-devel|bzip2-devel|ncurses-devel|gdbm-devel|xz-devel|tk-devel|libffi-devel" command to check whether it has been installed on this Linux server. If it has not been installed yet, you can choose either option below to install the dependencies:

oOnline Install: run the yum -y install zlib-devel readline-devel bzip2-devel ncurses-devel gdbm-devel xz-devel tk-devel libffi-devel command to install it online.

oOffline Install: refer to Offline Installing Third-party Dependencies for more details.

Installing Service Monitor Agent on Linux

1.Log in to the Linux server as the root user.

2.Run the cd /opt/netbraintemp8.0.3 command to navigate to the /opt/netbraintemp8.0.3 directory.

3.Download the installation package.

Option 1: If the Linux server has no access to the Internet, obtain the netbrain-servicemonitoragent-linux-x86_64-rhel7-8.0.3.tar.gz file from NetBrain and then upload it to the /opt/netbraintemp8.0.3 directory by using a file transfer tool.  

Option 2: If the Linux server has access to the Internet, run the
wget <download link> command under the /opt/netbraintemp8.0.3 directory to directly download the netbrain-servicemonitoragent-linux-x86_64-rhel7-8.0.3.tar.gz file from NetBrain official download site.

Note: Contact NetBrain Support Team to get the download link. The download link is case-sensitive.

Tip: Run the yum -y install wget command to install the wget command if it has not been installed on the server.

4.Run the tar -zxvf netbrain-servicemonitoragent-linux-x86_64-rhel7-8.0.3.tar.gz command under the /opt/netbraintemp8.0.3 directory to extract installation files.

[[email protected] netbraintemp8.0.3]# tar -zxvf netbrain-servicemonitoragent-linux-x86_64-rhel7-8.0.3.tar.gz
ServiceMonitorAgent/
ServiceMonitorAgent/config/
ServiceMonitorAgent/config/setup.conf
...
ServiceMonitorAgent/install.sh
...

5.Run the cd ServiceMonitorAgent/config command to navigate to the config directory.

6.Modify the parameters in the setup.conf file located under the config directory according to your environment and save the changes. For how to modify the configuration file, refer to Editing a File with VI Editor.

[[email protected] config]# vi setup.conf
 
# IE API Url, for example: http://ie.netbrain.com/ServicesAPI
# Attention please: /ServicesAPI is a fixed suffix
Server_Url=http://localhost/ServicesAPI
 
# Authentication Key to be used to communicate with Web API server.
# Note: please ensure this key must be the same as the API key created on Web API server.
Server_Key=netbrain
 
# LogPath is used to store log files for Servicemonitor.
# This directory must be at least a second level directory and used exclusively for this purpose.
LogPath=/var/log/netbrain/nbagent
 
# Whether to enable verifying Certificate Authority (CA): By default, it is disabled. 
yes indicates enabled; no indicates disabled.
# Note: To enable the verifying CA, it is needed to change configuration of the Web Server.
CA_Verify=no
 
# CertAuth specifies the CA file source path. Below CA file will be copied to folder /etc/ssl/netbrain/nbagent
CertAuth=/etc/ssl/cacert.pem

7.Run the cd .. command to navigate to the ServiceMonitorAgent directory.  

8.Run the ./install.sh script under the ServiceMonitorAgent directory to install the Service Monitor Agent.

1)Read the License Agreement, and type YES.

2)Type I ACCEPT to accept the License Agreement. The script starts to install Service Monitor Agent.

[[email protected] ServiceMonitorAgent]# ./install.sh
 
Please read the End User License Agreement (“EULA”) for the license type (perpetual or subscription) purchased in the order form at 
https://www.netbraintech.com/legal-tc/ carefully. I have read the subscription EULA, if I have purchased a subscription license, or the
perpetual EULA, if I have purchased a perpetual license, at the link provided above. Please type “YES” if you have read the applicable EULA
and understand its contents, or “NO” if you have not read the applicable EULA. [YES/NO]: YES 
 
Do you accept the terms in the subscription EULA, if you have purchased a subscription license, or the perpetual EULA, if you have purchased
a perpetual license? If you accept, and to continue with the installation, please type "I Accept" to continue. If you do not accept, and to quit
the installation script, please type "CANCEL" to stop. [I ACCEPT/CANCEL]: I ACCEPT 
 
Preprocessing SUCCEEDED
Starting to install Service Monitor Agent ...
Starting to system checking...
  Collecting system information...
...
  Collecting system information SUCCEEDED.
System checking SUCCEEDED.
Starting to configuration parameters checking...
Configuration parameters checking SUCCEEDED.
Start dependencies checking...
Dependencies checking SUCCEEDED.
... 
Obtaining file:///usr/share/nbagent
Installing collected packages: agent
  Running setup.py develop for agent
Successfully installed agent
You are using pip version 18.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Configuration parameters updating SUCCEEDED.
Starting to permission assigning...
Permission assigning SUCCEEDED.
Starting to deamon setting...
Deamon setting SUCCEEDED.
... 
Successfully installed Service Monitor Agent. Service is running.
INFO: Backing up uninstall.sh SUCCEEDED
INFO: Successfully installed Service Monitor Agent.

9.Run the systemctl status netbrainagent command to verify whether its service starts successfully.  

[[email protected] ~]# systemctl status netbrainagent
 netbrainagent.service - NetBrain Service Monitor Agent Daemon
   Loaded: loaded (/usr/lib/systemd/system/netbrainagent.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2019-05-04 23:19:09 EDT; 5min ago
 Main PID: 4520 (python3)
   Memory: 73.5M
...

10.(Only required if you have changed the default port number or configured DNS connection when installing MongoDB/License Agent/Elasticsearch/Redis/RabbitMQ). To make the Server Monitor can still detect and monitor its service, add the customized port number to the corresponding configuration file.

Server Name

File Name

MongoDB

mongodb.yaml

License Agent

license.yaml

Elasticsearch

elasticsearch.yaml

Front Server

fs.yaml

RabbitMQ

rabbitmq.yaml

Redis

redis.yaml

Example: If you configured the port number 27000 during MongoDB installation, do the following:

1)Run the cd /etc/netbrain/nbagent/checks command to navigate to the checks directory.

2)Add the customized port number to the mongodb.yaml file, and save the changes. For how to modify the file, refer to Editing a File with VI Editor.

Note: If fully qualified domain name (FQDN) is used when installing MongoDB on this machine, add dns:<MongoDB FQDN> to the mongodb.yaml file.

Note: Follow the text format in the example strictly, including alignment, punctuations, and spaces.

init_config:
 
instances:
    - name: default
      port: 27000

Tip: It is highly recommended to run the rm -rf /opt/netbraintemp8.0.3/ServiceMonitorAgent/config/setup.conf command to delete the setup.conf file from the server after Service Monitor Agent is successfully installed because the file may cause security vulnerability.

Parameters

Parameter

Default Value

Description

Server_Url

http://localhost/ServicesAPI

The URL used to call the Web API service, http://<IP address of NetBrain Web API Server>/ServicesAPI. For example, http://10.10.3.141/ServicesAPI.

Note: If SSL will be enabled with https binding created for the system website in IIS Manager, type https in the URL. Besides, if CA_Verify is enabled, hostname must be specified in the URL.

Server_Key

netbrain

The key used to authenticate the connections to your NetBrain Web API Server.

Note: The Server_Key must be kept consistent with the key configured when you installed Web API Server.

LogPath

/var/log/netbrain/nbagent

The storage path for the log files of the Service Monitor Agent.

Note: Do not save the log files under any subfolders of the InstallPath.

CA_Verify

no

Set whether to authenticate the Certificate Authority (CA) of the certificates, which are used to enable SSL for the system website in IIS Manager.

Note: It is required only if https is used in Server_Url.

CA_Path

/opt/netbrain/netbrain.pem

The storage path and file name of the root or class 2 CA file used for CA authentication.

Note: It is required only if CA_Verify is enabled. Only the CA file in the Base-64 encoded X.509 (.CER) format is supported.