Re: AUTOACTION in Policy data file failed in OMU9.0 (106 Views)
Reply
Frequent Advisor
Prak5192
Posts: 53
Registered: ‎10-30-2013
Message 1 of 7 (143 Views)
Accepted Solution

AUTOACTION in Policy data file failed in OMU9.0

Hi everyone,

I am facing a problem where i want to create a file in the AUTOACTION part of the policy data file. 

when I am using a bash command "touch test.txt", the file is getting created successfully as a auto action part, but when i am using a perl script to do the same thing thing, its getting failed.  I have exported the perl path and successfully in /etc/profile and ~/.bash_profile file. The perl script is running on command line with no problem. 

Is there any dependeny of perl in HPOM. How can I debug the auto action part. 

 

Please help me in dubugging this issue.. 

Thank You All

Honored Contributor
Goran Koruga
Posts: 1,298
Registered: ‎12-05-2002
Message 2 of 7 (135 Views)

Re: AUTOACTION in Policy data file failed in OMU9.0

Hello.

 

How does your auto action command look like?  What's the first line in the script itself?

 

How to debug it depends on system where this runs on.

 

Regards,

    Goran

Frequent Advisor
Prak5192
Posts: 53
Registered: ‎10-30-2013
Message 3 of 7 (126 Views)

Re: AUTOACTION in Policy data file failed in OMU9.0

Hi Goran,

Thank You for your response and time. 

I have a script named test.pl in path /usr/local/test

What I have done is exported the path /usr/local/test in my /etc/profile and  ~/.bash_profile file and source it. After that I am using just test .pl command to execute the test.pl file. It has execution (777) permission. This file is running successfully from bash shell command line, But when I am putting the same test.pl command as a AUTORUN command in policy data file, it is getting failed. 

 

This is the test file content.

 

#!/usr/bin/perl
use Cwd;
use strict;
use warnings;
my $file = "temp.txt";
open (FILE, '>'.$file );
print FILE "Hello theren";
print FILE "How are you?n";
close FILE;

 

I am using RHEL 5.5 

 

Thank You 

Honored Contributor
Goran Koruga
Posts: 1,298
Registered: ‎12-05-2002
Message 4 of 7 (115 Views)

Re: AUTOACTION in Policy data file failed in OMU9.0

Specify the command as "/usr/local/test/test/pl".

 

Goran

Frequent Advisor
Prak5192
Posts: 53
Registered: ‎10-30-2013
Message 5 of 7 (109 Views)

Re: AUTOACTION in Policy data file failed in OMU9.0

HI Goran,

Yes  you are right. I have already tested like you mentioned to use it as /usr/local/test/test.pl.

But is there any way to that I can export this this "/usr/local/test/" and then run only test.pl as a command like we are doing in bash shell. There should be some envoirnment variavle in HPOM too which we can set and use only test.pl as a command.

 

Thank You

 

Honored Contributor
Goran Koruga
Posts: 1,298
Registered: ‎12-05-2002
Message 6 of 7 (106 Views)

Re: AUTOACTION in Policy data file failed in OMU9.0

If you set it in shell and restart 'ovcd', it shall work.  But keep in mind this won't work when processes get started at boot using an init script - check "/etc/init.d/OVCtrl" for that.

 

     Goran

Frequent Advisor
Prak5192
Posts: 53
Registered: ‎10-30-2013
Message 7 of 7 (101 Views)

Re: AUTOACTION in Policy data file failed in OMU9.0

[ Edited ]

Hi Goran,

  

Editing  "/etc/init.d/OVCtrl" and restarting works. 

How can I restart "ovcd". I searched in forum but didn't get it. Can you please give me the command.

 

Thank You for all your help and suggestions. 

 

 

Thank You.

 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.