KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Step by Step install Linux Agent + put it on startup

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Library
View previous topic :: View next topic  
Author Message
Rosetta_itgroup



Joined: 09 Aug 2014
Posts: 13

PostPosted: Thu Jan 29, 2015 5:52 pm    Post subject: Step by Step install Linux Agent + put it on startup Reply with quote

Hi guys, I've put together a step by step guide that I have assembled (parts from KS-soft knowledge base and parts from the web).
i was searching on the web for a full installation guide for this and i couldn't find any.
This works 100%. Tested on several Linux servers.

*note, - i have bolded the settings that needs to be changed in the script file below.

How to install Hostmonitor RMA Linux agent
1. Create a folder under the path: /usr/sbin/rma/ using the cli:
mkdir /usr/sbin/rma/

2. Type: cd /usr/sbin/rma/
3. Download hostmonitor RMA using cli:
wget http://www.hostmonitor.biz/download/rma/rma129_lin_x64.tgz
*note, if it doesn’t work just download wgent using cli: yum –y install wget
4. tar -xzf rma129_lin_x64.tgz
5. vi /usr/sbin/rma/rma.ini
6. type this code in:
; ==========================================================================
;
; RMA (Remote Monitoring Agent) for FreeBSD/Linux/Solaris
; Configuration file
;
; Note:
; - any line which starts with a ; (semi-colon) or a # (hash) is a comment
; and is ignored
; - parameters are case insensitive
;
; BTW:
; To configure single agent or huge arrays of remote agents installed in
; different networks you may use RMA Manager. It allows you to change
; settings for hundreds of agents installed on remote systems at one time
; and from one comfortable location.
; http://www.ks-soft.net/hostmon.eng/rma-manager/index.htm
;
; ==========================================================================


;---------------------------------------------------------------------------

[Basic]

; RmaPath
; Obligatory parameter. Full path to the agent. UNIX does not have common
; method that allows to retrieve module name and path.
; Without this parameter agent will not be able to upgrade and restart itself.

RmaPath = /usr/sbin/rma/rma

; TmpDir
; Parameter is optional. For some tests (CPU, Process and Shell Script) agent
; creates temporary files. RMA searches for temporary directory in the
; following order:
; - directory that specified by this option (TMPDIR)
; - directory that specified by "TMPDIR" environment variable
; - directory that specified by "TMP" environment variable
; - if non of these parameters specified or specified directory doesn't
; exist, RMA uses current directory

TmpDir =/usr/sbin/rma

; Optional PID file
; A PID-File is a file containing the process identification number (pid) that
; allows other programs to find out the pid of a running agent.
; RMA started in interactive mode ignores this parameter.

; PidFile = /var/run/rma.pid

; Comment - here you may specify a comment (actually you may type any text
; here, it could be a simple recognizable name or an identifier for this
; agent). This helps to identify agents easier.

Comment=RMA for FreeBSD/Linux/Solaris

;------------------------- Connection parameters -------------------------

; Optional parameter. Can be useul when system has several network interfaces.

Host=

; Port - specifies the TCP port number which RMA utilizes to listen for
; incoming connections. Default setting is #1055.

Port=1055

; Timeout - the maximum amount of time (in miliseconds) that agent will keep
; waiting for the complete request packet from HostMonitor (after initial
; TCP connection established) before dropping the connection.

Timeout=5000

; Password - minimum six character length password. Using of an empty password
; is not permitted. The password is required for every communication session
; between RMA and HostMonitor or RMA and RMA Manager. All traffic between RMA
; and HostMonitor or RMA and RMA Manager is encrypted and the password itself
; is never transmitted through the network without encryption.

Password=<your password here>

;-------------------------------- Logging --------------------------------

[Logging]

; Successful audit log
; here you may specify a log file where agent will store information about
; successfully accepted connections. This log has no use when everything
; works well (it then just takes space on the hard drive), but you may found
; it really helpful when a sophisticated network problem has to be fixed.
; If you specify just the name of the file (without a full path), an agent
; will store a log in the same directory where configuration file located.

LogSuccess=0
OkLogFile=log.txt

; Failure audit log
; you may specify another log file where an agent will store information about
; rejected requests. E.g.: connections from an IP addresses that are not
; allowed or connections with invalid password, etc. Log file is a simple
; text file that contains date of the event, remote IP address from which
; an attempt of connection has occurred and information about the error.
; If you specify just the file name (without path), an agent will store it
; in the same directory where configuration file located.

LogFails=1
BadLogFile=log.txt

; Verbose Log
; This log is used when you start RMA with -v command line parameter. In
; this case RMA will store various information about each connection.

VerboseLogFile=log_verbose.txt

;--------------------------- Security settings ---------------------------

[IncomeFilter]

; Enable or disable accepting connections from any IP address
; FilterActive=0 will allow RMA to accept control commands from any IP
; address (as long as the incoming connection provides correct password)
; Set FilterActive=1 and RMA will accept connections only from the addresses
; that specified in by FilterList parameter (password is required as always).

FilterActive=0
FilterList=127.0.0.1 192.168.1.10 192.168.1.12 192.168.1.101 192.168.1.102
FilterMarks=11111


[RemoteManagment]

; Enable remote updates from address
; this option allows remote updates of the RMA code (e.g. when a new version
; is available) from the IP address being provided. To upgrade an array of
; remote agents you may use RMA Manager. Of course all operations with agents
; are encrypted and password protected but this option increases security
; even more.
; Note: Instead of single IP address you may specify a list and/or a range of
; IP addresses. IP addresses in the list should be separated by comma. Dash
; is used to define a range of addresses.
; Example: "UpdateAddr=127.0.0.1, 192.168.13.10 - 192.168.13.99"

AllowUpdates=1
UpdateAddr=<your hostmonitor server ip address here or entire LAN>

; Enable remote management from address
; this option sets the IP address from which it is allowed to control and
; manage RMA. Using RMA Manager installed on the system with that IP address
; you will be able to change agent's settings remotely, also you will be
; able to restart and terminate an agent.
; Note: Instead of single IP address you may specify a list and/or a range of
; IP addresses. IP addresses in the list should be separated by comma. Dash
; is used to define a range of addresses.
; Example: "ManageAddr=127.0.0.1, 192.168.13.10 - 192.168.13.99"

AllowManage=1
UpdateAddr=<your hostmonitor server ip address here or entire LAN>


[EnabledTests]
; specifies the list of tests methods allowed for execution by this RMA.
; To enable the test assign 1 to the parameter, to disable the test assign 0
; to the parameter

Ping=1
TCP=1
UDP=1
UNC=1
FolderSize=1
CountFiles=1
FileExists=1
TextLog=1
FileCRC=1
CompareFiles=1
Process=1
CPUUsage=1
Script=1
External=1
ODBC=1
SNMP=1
ShellScript=1

[EnabledActions]
; specifies the list of action methods allowed for execution by this RMA.
; To enable the action assign '1' to the parameter, to disable the action
; assign '0' to the parameter

ExecuteAction=0
TcpUdpAction=1
SyslogAction=1

[Tests]
; Following parametrs provide the path to specialized scripts that RMA needs
; to perform some tests (such as CPU Usage and Process tests). These tests
; were implemented as external scripts to simplify customization for various
; systems. You may easily modify scripts using any text editor.
; If you specify just the name of the file (without a full path), an agent
; will assume that script is located in the same directory where the agent is

; Provides the path to a script that returns current CPU Usage
CPUUsageScript=cpu.sh

; Provides the path to a script that returns current number of running
; instances of the specified process
ProcCntScript=proccnt.sh

; Provides the path to a script that returns list of started processes.
ProcListScript=proclist.sh

; ==========================================================================
; end of ini file



7. Save it using this cli: “:wq!”



Put Hostmonitor RMA linux agent on startup

1. Create a file under the path: /etc/init.d/rma using this cli:
vi /etc/init.d/rma

2. Past this code in the “rma” file:
#! /bin/bash
#
# Hostmonitor RMA Bring up/down
#
# chkconfig: 345 20 80
# description: Starts and stops the Hostmonitor RMA
#
# /etc/rc.d/init.d/rma
# See how we were called.

RMA_PWD="/usr/sbin/rma/"
RMA_BIN="${RMA_PWD}/rma"
RMA_INI="${RMA_PWD}/rma.ini"

case "${1}" in
start)
echo -n "Starting Hostmonitor RMA: "
${RMA_BIN} -d ${RMA_INI} &>/dev/null
echo "done"
;;
stop)
echo -n "Stopping Hostmonitor RMA: "
PID="$(ps ax | grep ${RMA_BIN} | grep -v grep | awk '{print $1}')"
if [ x"${PID}" != x"" ]; then
kill ${PID} &>/dev/null
sleep 1
kill -9 ${PID} &>/dev/null
fi
echo "done"
;;
restart)
${0} stop
sleep 1
${0} start
;;
*)
echo "Usage: `basename ${0}` <start|stop|restart>"
exit 1
;;
esac
exit 0

3. Save it using this cli: “:wq!
4. Make it runnable:

chmod +x /etc/init.d/rma
chown 744 /etc/init.d/rma
5. Put it on startup using: chkconfig --add rma
6. Type this : chkconfig --level 35 rma on
7. That’s it, the RMA will run on startup, You can also use the following
cli commands:
service rma (start|stop|restart)
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Library All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index