How to I get RMA scripts to run?

Remote Monitoring Agent for Linux, FreeBSD, and other UNIX-like platforms.
Post Reply
bilbo007
Posts: 6
Joined: Fri Jun 19, 2009 3:38 am

How to I get RMA scripts to run?

Post by bilbo007 »

Hi,

I'm running Ubuntu server 8.10 and have installed the latest linux rma. I have configured the rma.ini file and started the rma process. I can connect to the RMA from hostmon and can check UNC paths however cannot get any of the scripts to execute.

The error in Hostmon when I have created a new test states there is a RMA: 301 - Script Error, it also says permission denied.

Does anyone have any ideas what it going on?

Thanks
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Re: How to I get RMA scripts to run?

Post by KS-Soft Europe »

bilbo007 wrote:The error in Hostmon when I have created a new test states there is a RMA: 301 - Script Error, it also says permission denied.
You just have to add executive permissions for all *.sh files in rma folder.
You may use chmod command for such a purpose, e.g.

Code: Select all

chmod a+x *.sh
Regards,
Max
bilbo007
Posts: 6
Joined: Fri Jun 19, 2009 3:38 am

Post by bilbo007 »

Thanks very much for your help Max, that resolved the problem.
timn
Posts: 184
Joined: Thu Nov 20, 2003 9:57 am
Location: United States

Post by timn »

Alex,

I'm having the same issue, but after following instructions
you gave above, I still get the error message:

"RMA: 301 - Script execution error: exec error: Permission denied"

What other permissions could I have wrong? See test particulars below:


Method = ShellScript
;--- Common properties ---
;DestFolder = Root\C3 Tech Services\Web Services\Rackspace Web 02\
RMAgent = Rackspace Web02
Title = RS-WEB02 - Free Memory
Comment = SYSTEM: Mem Free: 1024
RelatedURL =
CmntPattern = %path%: %object%
ScheduleMode= Regular
Schedule = 7 Days, 24 Hours
Interval = 600
Alerts = Low Memory
ReverseAlert= No
UnknownIsBad= No
WarningIsBad= No
UseCommonLog= Yes
PrivLogMode = Default
CommLogMode = Default
;--- Test specific properties ---
Script = SYSTEM: Mem Free||AIX/BSD/Linux/Solaris
Params = 1024
Timeout = 15
UseMacros = Yes



RMA Agent version is rma128_lin_x64


I start RMA with the following line in rc.local:
/usr/sbin/rma/rma /usr/sbin/rma/rma.ini



Here are current permissions in rma folder:

$ ls -l /usr/sbin/rma
total 460
-rwxrwxrwx 1 root root 807 Jul 17 09:38 cpu.sh
-rwxrwxrwx 1 root root 12987 Jul 17 09:38 INSTALL
-rwxrwxrwx 1 root root 4641 Jul 17 09:38 LICENSE
-rw-r--r-- 1 root root 78604 Jul 17 09:56 log_verbose.txt
-rwxrwxrwx 1 root root 787 Jul 17 09:38 proccnt.sh
-rwxrwxrwx 1 root root 543 Jul 17 09:38 proclist.sh
-rwxrwxrwx 1 root root 299 Jul 17 09:38 qnx_cpu.sh
-rwxrwxrwx 1 root root 2996 Jul 17 09:38 README
-rwxrwxrwx 1 root root 229175 Jul 17 09:38 rma
-rwxrwxrwx 1 root root 7627 Apr 21 07:26 rma.ini


and permission on the rma folder itself:
drwxrwxrwx 2 root root 4096 Apr 23 03:11 rma


and process info:
$ ps -eF | grep rma
root 22210 1 0 8594 1000 0 09:39 ? 00:00:02 /usr/sbin/rma/rma -d -v /usr/sbin/rma/rma.ini

When I run script manually, it appears to work:
$ cat /proc/meminfo | awk '$1=="MemFree:"{print $2;exit}'
430300


Maybe MEMINFO itself is the problem?
$ ls -l /proc/meminfo
-r--r--r-- 1 root root 0 Jul 17 10:22 /proc/meminfo

Finally, system is:
$ uname -a
Linux 986717-web2.www.mycorp.com 2.6.18-128.1.1.el5 #1 SMP Mon Jan 26 13:58:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
KS-Soft
Posts: 12869
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I assume RMA does not have right to create file :roll:
Try to setup path to temp folder using TmpDir parameter (rma.ini file)
=================
; 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
=================

Regards
Alex
timn
Posts: 184
Joined: Thu Nov 20, 2003 9:57 am
Location: United States

Still no luck

Post by timn »

Alex,

I still have this permissions problem. Let's review

In my RMA.INI file, I have TmpDir set as follows:
TmpDir=/tmp/rma
The tmp directory itself (/tmp/rma) has the wide open permissions:
drwxrwxrwx 2 root root 4096 Aug 19 15:41 rma
The directory where rma (/usr/sbin) is installed is also currently wide open:
drwxrwxrwx 2 root root 4096 Aug 19 10:07 rma
And the files within that directory are also open:
$ ls -l
total 616
-rwxrwxrwx 1 root root 807 Apr 24 12:26 cpu.sh
-rwxrwxrwx 1 root root 12987 Apr 5 23:15 INSTALL
-rwxrwxrwx 1 root root 4641 Apr 5 23:15 LICENSE
-rw-r--r-- 1 root root 322224 Aug 19 15:53 log_verbose.txt
-rwxrwxrwx 1 root root 787 Feb 21 2007 proccnt.sh
-rwxrwxrwx 1 root root 543 Feb 21 2007 proclist.sh
-rwxrwxrwx 1 root root 299 Feb 12 2007 qnx_cpu.sh
-rwxrwxrwx 1 root root 2996 May 21 03:48 README
-rwxrwxrwx 1 root root 234079 May 22 09:34 rma
-rwxrwxrwx 1 root root 7614 Aug 19 10:06 rma.ini
Still getting "RMA: 301 - Script execution error: exec error: Permisission denied"

Any thoughts about what else to check?

Here is odd thing: CPU Usage test works great, as does Folder/File Size, and Process (count), but no Shell Script will work (for example "SYSTEM: # of processes (total)"

Shell script works fine manually from command line, i.e.
$ ./proccnt.sh httpd
14
KS-Soft
Posts: 12869
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Here is odd thing: CPU Usage test works great, as does Folder/File Size, and Process (count), but no Shell Script will work (for example "SYSTEM: # of processes (total)"
We don't know what the problem is :(
If standard scripts work fine, lets try to point TmpDir to the same folder (/usr/sbin/rma?)

Regards
Alex
timn
Posts: 184
Joined: Thu Nov 20, 2003 9:57 am
Location: United States

Post by timn »

Thanks, Alex. That did it! What I actually ended up doing was leaving my TmpDir setting (in RMA.INI) empty:
TmpDir=
Shell Scripts now work fine!. Not sure why pointing this to /tmp/rma did not work. I'm not even close to a Linux expert and don't pretend to be one. Since it is now working, there is no need for you to spend any more time on this. Thanks for pointing me in the right direction!

But if any of you Linux-types out there see an obvious error in my original setup, I'd appreciate the education. FWIW, this server is hosted at Rackspace and here is version info:
# uname -a
Linux 238010-web3.www.company.com 2.6.18-128.4.1.el5 #1 SMP Thu Jul 23 19:59:19 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
Post Reply