View previous topic :: View next topic |
Author |
Message |
qwerty
Joined: 12 Sep 2013 Posts: 15
|
Posted: Fri Sep 20, 2013 9:23 am Post subject: Install Hostmonitor RMA on Ubuntu 12.04 |
|
|
Get RMA files
Code: |
#
mkdir -p /usr/local/src/rma
cd /usr/local/src/rma
#
wget http://www.hostmonitor.biz/download/rma/rma129_lin_x64.tgz
#
tar -xzf rma129_lin_x64.tgz
#
|
Copy RMA files to appropriate location
Code: |
#
mkdir /usr/local/etc/rma
mkdir /usr/local/etc/rma/docs
#
#
cp rma /usr/bin
#
cp rma.ini /usr/local/etc/rma
#
cp cpu.sh /usr/local/etc/rma
cp proccnt.sh /usr/local/etc/rma
cp proclist.sh /usr/local/etc/rma
#
cp INSTALL /usr/local/etc/rma/docs
cp LICENSE /usr/local/etc/rma/docs
cp README /usr/local/etc/rma/docs
#
|
Edit Agent ini file
Code: |
sudo vi /usr/local/etc/rma/rma.ini
|
Code: |
RmaPath = /usr/bin/rma
Password=*******
CPUUsageScript=/usr/local/etc/rma/cpu.sh
ProcCntScript=/usr/local/etc/rma/proccnt.sh
ProcListScript=/usr/local/etc/rma/proclist.sh
|
Create startup script
Code: |
sudo touch /etc/init.d/rma
|
Edit startup script
Code: |
sudo vi /etc/init.d/rma
|
Code: |
#! /bin/sh
### BEGIN INIT INFO
# Provides: Host Monitor RMA
# Required-Start: $local_fs $syslog
# Required-Stop: $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Host Monitor RMA
### END INIT INFO
# Author: ***** <*****@****.***>
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESCRIPTION="Host Monitor RMA"
NAME=rma
RMA_INI_FILE=/usr/local/etc/rma/rma.ini
DAEMON=/usr/bin/$NAME
DAEMON_ARGS="-d $RMA_INI_FILE"
PIDFILE=$PIDNAME.pid
PIDSPATH=/var/run
PIDFILE=$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
RUNAS=root #user to run as
SCRIPT_OK=0 #ala error codes
SCRIPT_ERROR=1 #ala error codes
TRUE=1 #boolean
FALSE=0 #boolean
#------------------------------------------------------------------------------
# Simple Tests
#------------------------------------------------------------------------------
# Test if rma is a file and executable
[ -x "$DAEMON" ] || exit 0
# Include rma defaults if available
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
. /lib/init/vars.sh
. /lib/lsb/init-functions
#------------------------------------------------------------------------------
# Functions
#------------------------------------------------------------------------------
setFilePerms(){
if [ -f $PIDSPATH/$PIDFILE ]; then
chmod 400 $PIDSPATH/$PIDFILE
fi
}
isRunning() {
if [ $1 ]; then
pidof_daemon $1
PID=$?
if [ $PID -gt 0 ]; then
return 1
else
return 0
fi
else
pidof_daemon
PID=$?
if [ $PID -gt 0 ]; then
return 1
else
return 0
fi
fi
}
wait_for_pid () {
try=0
while test $try -lt 35 ; do
case "$1" in
'created')
if [ -f "$2" ] ; then
try=''
break
fi
;;
'removed')
if [ ! -f "$2" ] ; then
try=''
break
fi
;;
esac
echo -n .
try=`expr $try + 1`
sleep 1
done
}
status(){
isRunning
isAlive=$?
if [ "${isAlive}" -eq $TRUE ]; then
echo "$DESCRIPTION found running with processes: `pidof $NAME`"
else
echo "$DESCRIPTION is NOT running."
fi
}
removePIDFile(){
if [ $1 ]; then
if [ -f $1 ]; then
rm -f $1
fi
else
#Do default removal
if [ -f $PIDSPATH/$PIDFILE ]; then
rm -f $PIDSPATH/$PIDFILE
fi
fi
}
start() {
log_daemon_msg "Starting $DESCRIPTION"
isRunning
isAlive=$?
if [ "${isAlive}" -eq $TRUE ]; then
log_end_msg $SCRIPT_ERROR
else
start-stop-daemon --start --verbose --pidfile $PIDSPATH/$PIDFILE --exec $DAEMON -- $DAEMON_ARGS
pidof $NAME >$PIDSPATH/$PIDFILE
setFilePerms
log_end_msg $SCRIPT_OK
fi
}
stop() {
log_daemon_msg "Stopping $DESCRIPTION"
isRunning
isAlive=$?
if [ "${isAlive}" -eq $TRUE ]; then
start-stop-daemon --stop --quiet --pidfile $PIDSPATH/$PIDFILE
# wait_for_pid 'removed' $PIDSPATH/$PIDFILE
# if [ -n "$try" ] ; then
# log_end_msg $SCRIPT_ERROR
# else
removePIDFile
log_end_msg $SCRIPT_OK
# fi
else
log_end_msg $SCRIPT_ERROR
fi
}
reload() {
log_daemon_msg "Reloading (via HUP) $DESCRIPTION"
isRunning
if [ $? -eq $TRUE ]; then
kill -HUP `cat $PIDSPATH/$PIDFILE`
log_end_msg $SCRIPT_OK
else
log_end_msg $SCRIPT_ERROR
fi
}
destroy() {
log_daemon_msg "Force terminating and may include self (via KILLALL) $DESCRIPTION"
killall $NAME -q >> /dev/null 2>&1
log_end_msg $SCRIPT_OK
}
pidof_daemon() {
PIDS=`pidof $NAME`
[ -e $PIDSPATH/$PIDFILE ] && PIDS2=`cat $PIDSPATH/$PIDFILE`
for i in $PIDS; do
if [ "$i" = "$PIDS2" ]; then
return 1
fi
done
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 1
start
;;
reload)
$1
;;
status)
status
;;
destroy)
$1
;;
*)
echo "Usage: service $NAME {start|stop|restart|reload|destroy}"
echo " The 'destroy' command should only be used as a last resort."
exit 1
;;
esac
exit 0
|
Make the script executable
Code: |
sudo chmod +x /etc/init.d/rma
|
Add the script to the boot sequence
Code: |
sudo update-rc.d rma defaults
|
Start installed agent
Code: |
sudo service rma start
|
|
|
Back to top |
|
 |
gulbahar
Joined: 24 Apr 2014 Posts: 2
|
Posted: Thu Apr 24, 2014 7:27 am Post subject: Exec error |
|
|
Hi.
I said the same applies but I am getting error.
Error :
*Starting Host Monitor RMA
Starting /usr/bin/rma...
Start-stop-deamon: unable to start /usr/bin/rma (exec format error)
Please help me |
|
Back to top |
|
 |
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
|
Back to top |
|
 |
gulbahar
Joined: 24 Apr 2014 Posts: 2
|
Posted: Fri Apr 25, 2014 1:07 am Post subject: RMA start error |
|
|
Hi,
I already use manually but agent give me same error.
I already insttall and extract RMA files manually. |
|
Back to top |
|
 |
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
|
Back to top |
|
 |
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Fri Apr 25, 2014 8:44 am Post subject: |
|
|
This error can be caused by incompatible CPU architecture.
What CPU is installed on your system? |
|
Back to top |
|
 |
eddymicro
Joined: 13 Nov 2002 Posts: 95
|
Posted: Wed Oct 01, 2014 2:25 pm Post subject: Password Error |
|
|
Alex
I have been trying to install the agent, I followed these directions and I get a password error, I did create a new password and put it in the rma.ini file
-------------------------------------------------------------
Application: RMA (Remote Monitoring Agent for HostMonitor)
Version: 1.29 for Linux (Red Hat, Mandrake, SuSE)
Copyright: 2004 - 2010 Alexander Kozlov
web: http://www.ks-soft.net
e-mail: support@ks-soft.net
-------------------------------------------------------------
Command line checking .. Ok
Settings checking .. Error
Password is not specified!
Full path to the agent is not specified!
Please check '/usr/local/etc/rma/rma.ini' file
kiosk@nuc-01-0001 ~ $ |
|
Back to top |
|
 |
eddymicro
Joined: 13 Nov 2002 Posts: 95
|
Posted: Wed Oct 01, 2014 3:00 pm Post subject: Password Error is fixed |
|
|
Alex,
I figured it out and the agent is running. But I cannot get most of the tests to work. I get an error on the CPU test: Error 301 cannot get script results. |
|
Back to top |
|
 |
eddymicro
Joined: 13 Nov 2002 Posts: 95
|
Posted: Wed Oct 01, 2014 3:05 pm Post subject: Errors for Process Test |
|
|
Alex,
Both errors are probably related. On the process test I get this error:RMA 301 ProcCnt script doesn't exist |
|
Back to top |
|
 |
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Wed Oct 01, 2014 3:17 pm Post subject: |
|
|
rma folder should contain the following .sh files:
proccnt.sh
proclist.sh
cpu.sh
All these files should have executive permission. |
|
Back to top |
|
 |
eddymicro
Joined: 13 Nov 2002 Posts: 95
|
Posted: Thu Oct 02, 2014 5:40 am Post subject: Execute Permissions |
|
|
Alex,
I added execute and restarted the RMA.Now I get the follwwing error: RMA 301: Cannot get script results |
|
Back to top |
|
 |
eddymicro
Joined: 13 Nov 2002 Posts: 95
|
Posted: Thu Oct 02, 2014 6:00 am Post subject: Now Working |
|
|
Alex,
When I started the RMA as a service, It works.
We could really use more features for Linux !
Are you considering adding more tests to the Linux RMA?
We use Ubuntu and Mint (this version appears to work on both Mint and Ubuntu)  |
|
Back to top |
|
 |
KS-Soft
Joined: 03 Apr 2002 Posts: 12649 Location: USA
|
Posted: Thu Oct 02, 2014 9:56 am Post subject: |
|
|
What exactly fuatures do you need?
Regards
Alex |
|
Back to top |
|
 |
|