Installing NetForest for Linux System

Overview

This is the installation manual for Cavisson Monitoring Agent (CMON) + NetForest (NF) agent for Linux environment.

Prerequisites

  1. JDK 1.8 or later is required. RPM installation auto detects Java and set JAVA_HOME.
  2. For RPM installation, user needs root / sudo access.

Installation using RPM

Install RPM using following command:

rpm -ivh “cmon-nf-4.1.8-20.x86_64.rpm”

By default, CMON+NF Agent is installed in ‘/opt/cavisson’ directory. To install in a different directory, use prefix argument of RPM:

rpm -ivh –prefix=/opt/cavisson ” cmon-nf-4.1.8-20.x86_64.rpm”

In this document, CAV_MON_HOME variable is used. It denotes the path where machine agent is installed. For example: /opt/cavisson/monitors

Validating the Installation

Step – 1: Check RPM Installed
rpm -qa | grep cmon-nf

Output of command

cmon-nf-4.1.8-20.x86_64
Step – 2: Check CMON and NF Instance Running
ps -ef | grep cmon

Output of command

The output after successful installation in displayed as below:

java -DPKG=cmon -DCAV_MON_HOME=/opt/cavisson/cavisson/monitors 
-Djffi.boot.library.path=/opt/cavisson/cavisson/monitors/nf/nfagent/vendor/jruby/lib/jni 
-Xbootclasspath/a:/opt/cavisson/cavisson/monitors/nf/nfagent/vendor/jruby/lib/jruby.jar 
-Djruby.home=/opt/cavisson/cavisson/monitors/nf/nfagent/vendor/jruby 
-Djruby.lib=/opt/cavisson/cavisson/monitors/nf/nfagent/vendor/jruby/lib 
-Djruby.script=jruby -Djruby.shell=/bin/sh 
-DCLASSPATH=:/opt/cavisson/cavisson/monitors/lib/jruby.jar:
.:/opt/cavisson/cavisson/monitors/lib/java-getopt-1.0.9.jar:
/opt/cavisson/cavisson/monitors/bin:/opt/cavisson/cavisson/monitors/custom:
/opt/cavisson/cavisson/monitors/bin/CavMonAgent.jar:
/opt/cavisson/cavisson/monitors/lib/CmonLib.jar:
/opt/cavisson/cavisson/monitors/lib/gcviewer-1.29.jar:
/opt/cavisson/cavisson/monitors/lib/asm-all-4.0.jar:
/opt/cavisson/cavisson/monitors/lib/base64.jar:
/opt/cavisson/cavisson/monitors/lib/json_simple-1.1.jar:
/opt/cavisson/cavisson/monitors/lib/jedis-2.6.0.jar:
/opt/cavisson/cavisson/monitors/lib/mongo-java-driver-3.4.2.jar:
/opt/cavisson/cavisson/monitors/lib/bcprov-jdk15on-156.jar:
/opt/cavisson/cavisson/monitors/lib/bcpkix-jdk15on-1.48.jar:
/opt/cavisson/cavisson/monitors/lib/commons-net-3.0.1.jar:
/opt/cavisson/cavisson/monitors/lib/mysql-connector-java-5.1.37.jar 
-DPATH=/opt/cavisson/cavisson/monitors/bin:
/opt/cavisson/cavisson/monitors/custom:/usr/java/jdk1.8.0_131/bin:
/sbin:/usr/sbin:/bin:/usr/bin -DJAVA_HOME=/usr/java/jdk1.8.0_131 CavMonAgent -d -F 1
Step – 3: Check CMON and NF Added in Service or Not
service cmon start/stop/restart/show/status OR /etc/init.d/cmon start/stop/restart/show/status

Output of start cmon command:

[root@netstorm bin]# service cmon start
Starting cmon:
cmon is started with pid(13372).
UID        PID  PPID  C STIME TTY          TIME CMD
root     13372 13307  8 18:59 pts/4    00:00:00 java -DPKG=cmon -DCAV_MON_HOME=/opt/cavisson/monitors -DCLASSPATH=/opt/cavisson

Output of stop command:

[root@netstorm bin]# service cmon stop
Stoping cmon:
Stopping CavMonAgent with pid(12586)
cmon is stopped.
Removing running_tests directory

Output of restart command:

[root@netstorm bin]# service cmon restart
Restarting cmon:
Stoping cmon:
Stopping CavMonAgent with pid(13372)
cmon is stopped.
Removing running_tests directory
Starting cmon:
cmon is started with pid(13838).
UID        PID  PPID  C STIME TTY          TIME CMD
root     13838 13604  9 19:03 pts/4    00:00:00 java -DPKG=cmon -DCAV_MON_HOME=/opt/cavisson/monitors -DCLASSPATH=/opt/cavisson

Output of show command:

root@netstorm bin]# service cmon show
cmon is running with pid(12586).
UID        PID  PPID  C STIME TTY          TIME CMD
root     12586     1  0 18:48 pts/4    00:00:00 java -DPKG=cmon -DCAV_MON_HOME=/opt/cavisson/monitors -DCLASSPATH=/opt/cavisson

Output of status command:

[root@netstorm bin]# service cmon status
cmon is running with pid(12586).
UID        PID  PPID  C STIME TTY          TIME CMD
root     12586     1  0 18:48 pts/4    00:00:00 java -DPKG=cmon -DCAV_MON_HOME=/opt/cavisson/monitors -DCLASSPATH=/opt/cavisson
 NoteStarting/stopping/restarting of CMON also start/stop/restart NFAgent

CMON + NF Agent Configuration

Make changes in the configuration details within the following file: $CAV_MON_HOME/sys/cmon.env

Auto Registration Configuration (Optional)

Tier Name: Configure Tier Name as following:

Tier=<Tier Name>

If the tier name is not defined, then the server will be the part of ‘Default’ tier.

JVM Configuration

Add following for Heap size setting and enabling JMX port of Machine Agent in CMON_OPTS.

"-Xms512m -Xmx512m -Dcom.sun.management.jmxremote.port=7991 
-Dcom.sun.management.jmxremote.authenticate=false”
Sample cmon.env file contents
CMON_USER=cavisson
JAVA_HOME=/apps/java/jdk1.8.0_131
CAV_MON_AGENT_OPTS="-F 1"
CMON_OPTS="-Xms512m -Xmx512m -Dcom.sun.management.jmxremote.port=7991 
-Dcom.sun.management.jmxremote.authenticate=false 
-Djffi.boot.library.path=/export/cavisson/monitors/nf/nfagent/vendor/jruby/lib/jni 
-Xbootclasspath/a:/export/cavisson/monitors/nf/nfagent/vendor/jruby/lib/jruby.jar 
-Djruby.home=/export/cavisson/monitors/nf/nfagent/vendor/jruby 
-Djruby.lib=/export/cavisson/monitors/nf/nfagent/vendor/jruby/lib 
-Djruby.script=jruby -Djruby.shell=/bin/sh"

CLASSPATH=$CLASSPATH:/export/cavisson/monitors/lib/jruby.jar:.

#NDE Controller Host and Port
CONTROLLER=10.10.40.13:7891

#Tier and Server
TIER=WebStore
SERVER=<ip address or host name of server>
Sample nf.properties file contents

NFAgent considers the config directory provided in nf.properties file under nfConfigDir. Default is conf.d.journald, change it to conf.d.files where we are reading logs from log files.

With new version of NF, update 5.0.2 with new version.

Example

nfEnv=nf/nfagent/lib/bootstrap/environment.rb
nfVersion=--1.9
nfConfigDir=nf/nfagent/config/conf.d.journald/
nfRunner=nf/nfagent/logstash-core/lib/nfagent/runner.rb
restart cmon

NetForest Configuration

Reading NFAgent Configuration (parser) from NFDB (Default)

To read configuration from NFDB, we have to provide NFDB URL in $CAV_MON_HOME/nf/nfagent/config/nfagent.yml file.

config.store.nfdb: true
config.hosts: ["localhost:9200"]

Note:

  1. If store.nfdb is false, configuration are read from files (see below section).
  2. hosts can have comma separated host list in case of multinode clusters.

For example: config.hosts: [“localhost:9200”, “10.10.10.1:9200”]

Reading NFAgent Configuration (parser) From Files
config.store.nfdb: false

File configurations are stored in $CAV_MON_HOME/nf/nfagent/config/conf.d.files.

Note:

In case of failures i.e. NFAgent is unable to connect NFDB for configuration or configuration index is not present etc., it takes configurations from files as fallback.

Add environment specific information in $CAV_MON_HOME/sys/nf.env file.

SERVER=<server>
DC=<dc>
ENV=<env>
INDEX_PREFIX=<prefix>
# If it's false only OUTPUT_HOST1 and OUTPUT_PORT1 is considered
OUTPUT_MULTINODE=false
OUTPUT_HOST1=<host1>
OUTPUT_PORT1=<port1>

Note:

  1. TIER is taken from cmon.env.
  2. In case of cloud installations, SERVER and ENV is taken from Journald not from nf.env.
  3. In case OUTPUT_MULTINODE is false (i.e. nfdb cluster has only one node), OUTPUT_HOST1 and OUTPUT_PORT1 is considered, and rest are ignored.
  4. Server is optional for cloud environment. It takes hostname as server.

Reload NFAgent

In case of any changes in nf.env or in NFDB configuration index, reload NFAgent config.

Use below steps to reload NFAgent:

  1. nc <ND Machine Agent ip> <ND Machine Agent port> (set port to 7891)
  2. START_SESSION
  3. NetForestCMD:RELOAD
  4. STOP_SESSION

This concludes the successful installation of CMON+NF Agent.