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

How to I get RMA scripts to run?

 
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX
View previous topic :: View next topic  
Author Message
bilbo007



Joined: 19 Jun 2009
Posts: 6

PostPosted: Fri Jun 19, 2009 3:49 am    Post subject: How to I get RMA scripts to run? Reply with quote

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
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Fri Jun 19, 2009 4:22 am    Post subject: Re: How to I get RMA scripts to run? Reply with quote

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:
chmod a+x *.sh

Regards,
Max
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bilbo007



Joined: 19 Jun 2009
Posts: 6

PostPosted: Mon Jul 06, 2009 5:44 pm    Post subject: Reply with quote

Thanks very much for your help Max, that resolved the problem.
Back to top
View user's profile Send private message
timn



Joined: 20 Nov 2003
Posts: 184
Location: United States

PostPosted: Fri Jul 17, 2009 9:14 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Fri Jul 17, 2009 12:14 pm    Post subject: Reply with quote

I assume RMA does not have right to create file
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
Back to top
View user's profile Send private message Visit poster's website
timn



Joined: 20 Nov 2003
Posts: 184
Location: United States

PostPosted: Wed Aug 19, 2009 2:55 pm    Post subject: Still no luck Reply with quote

Alex,

I still have this permissions problem. Let's review

In my RMA.INI file, I have TmpDir set as follows:

Quote:
TmpDir=/tmp/rma


The tmp directory itself (/tmp/rma) has the wide open permissions:

Quote:
drwxrwxrwx 2 root root 4096 Aug 19 15:41 rma


The directory where rma (/usr/sbin) is installed is also currently wide open:

Quote:
drwxrwxrwx 2 root root 4096 Aug 19 10:07 rma


And the files within that directory are also open:

Quote:
$ 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.

Quote:

$ ./proccnt.sh httpd
14
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Wed Aug 19, 2009 8:34 pm    Post subject: Reply with quote

Quote:
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
Back to top
View user's profile Send private message Visit poster's website
timn



Joined: 20 Nov 2003
Posts: 184
Location: United States

PostPosted: Thu Aug 20, 2009 6:19 am    Post subject: Reply with quote

Thanks, Alex. That did it! What I actually ended up doing was leaving my TmpDir setting (in RMA.INI) empty:

Quote:
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:

Quote:
# 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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX 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