Data Backup and Recovery

SnapCreator 3.4.0 Pre & Post Clone

cferbrache
6,438 Views

When trying to run a pre & post clone command I get the following error:

########## PRE CLONE COMMANDS ##########
[Fri Jul 15 22:15:10 2011] INFO: Running pre clone command PRE_CLONE_CREATE_CMD01 [/usr/local/scAgent3.4.0/config/preclone_cmd_v2.sh]
[Fri Jul 15 22:15:10 2011] DEBUG: Executing command [/usr/local/scAgent3.4.0/config/preclone_cmd_v2.sh]
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Command [/usr/local/scAgent3.4.0/config/preclone_cmd_v2.sh] finished with
exit code: [1]
stdout: []
stderr: [At least one command is not allowed to be executed remotely]
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Reloading configuration from /usr/local/scAgent3.4.0/config/agent.conf
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Reloading configuration finished with
exit code: [0]
stdout: []
stderr: []
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Adding [/bin/echo] to the allowed regex pattern
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Adding [/bin/date] to the allowed regex pattern
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Adding [/etc/init.d/iscsi] to the allowed regex pattern
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Adding [/bin/sleep] to the allowed regex pattern
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Adding [/sbin/pvscan] to the allowed regex pattern
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Adding [/sbin/vgscan] to the allowed regex pattern
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Adding [/sbin/vgchange] to the allowed regex pattern
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Adding [/usr/sbin/lvscan] to the allowed regex pattern
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Adding [/bin/mount] to the allowed regex pattern
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Adding [/bin/service] to the allowed regex pattern
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Adding [/usr/local/scAgent3.4.0/config/postclone_cmd_v2.sh] to the allowed regex pattern
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Adding [*] to the allowed regex pattern
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Wildcard "*" found, allowing all commands
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] DEBUG: Validating command/sequence [/usr/local/scAgent3.4.0/config/preclone_cmd_v2.sh]
[Fri Jul 15 22:15:10 2011] [leo:9090(3.4.0.1)] ERROR: [agt-00011] Command [/usr/local/scAgent3.4.0/config/preclone_cmd_v2.sh] is not allowed
[Fri Jul 15 22:15:10 2011] ERROR: [scf-00103] Running pre clone command [/usr/local/scAgent3.4.0/config/preclone_cmd_v2.sh] failed with exit code [1] and message [At least one command is not allowed to be executed remotely]

########## PRE CLONE COMMANDS FINISHED WITH FAILURES ##########

########## PRE EXIT COMMANDS ##########
[Fri Jul 15 22:15:10 2011] INFO: No commands defined

########## PRE EXIT COMMANDS FINISHED SUCCESSFULLY ##########

1 ACCEPTED SOLUTION

ktenzer
6,436 Views

Can you please try moving your script to temp

/usr/local/scAgent3.4.0/config/postclone_cmd_v2.sh

so

/tmp/postclone_cmd_v2.sh

Then updating config file to go to /tmp/postclone_cmd_v2.sh and tryining again? I think we dont allow anything to run under scAgent3.4.0 directory for security reasons.

This does work believe me, just need to find out what is issue in your env

Also if you could send me agent.conf that would be helpful, the way it is now and Snap Creator config file?

Keith

View solution in original post

12 REPLIES 12

ktenzer
6,412 Views

You need to allow the script or any scripts/cmds on agent please edit the scAgent3.4.0/config/agent.conf

Add following:

comnand: preclone_cmd_v2.sh

Regards,

Keith

cferbrache
6,412 Views

I will give that a try. I have the full path in there currently. Do you also need all the commands that are used within the script?

ktenzer
6,412 Views

No just the script command: preclone_cmd_v2.sh

cferbrache
6,412 Views

Here is my agent.conf. It still didn't work.

############################################

### SnapCreator Agent Configuration File ###

############################################

######################################################################

### Command to allow or wildcard "*" can be used to allow anything ###

######################################################################

host: scServer@10.0.4.125

command: /bin/echo

command: /bin/date

command: /etc/init.d/iscsi

command: /bin/sleep

command: /sbin/pvscan

command: /sbin/vgscan

command: /sbin/vgchange

command: /usr/sbin/lvscan

command: /bin/mount

command: /bin/service

command: preclone_cmd_v2.sh

command: postclone_cmd_v2.sh

command: *

ktenzer
6,412 Views

Try changing agent.conf to:

host: scServer@*

command: *

Regards,

Keith

cferbrache
6,412 Views

I changed the agent.conf as you suggested. Still same issue.

########## POST CREATE COMMANDS ##########
[Mon Jul 18 07:05:21 2011] INFO: Running post create command POST_CLONE_CREATE_CMD01 [/usr/local/scAgent3.4.0/config/postclone_cmd_v2.sh]
[Mon Jul 18 07:05:21 2011] DEBUG: Executing command [/usr/local/scAgent3.4.0/config/postclone_cmd_v2.sh]
[Mon Jul 18 07:05:21 2011] [leo:9090(3.4.0.1)] DEBUG: Command [/usr/local/scAgent3.4.0/config/postclone_cmd_v2.sh] finished with
exit code: [1]
stdout: []
stderr: [At least one command is not allowed to be executed remotely]
[Mon Jul 18 07:05:20 2011] [leo:9090(3.4.0.1)] DEBUG: Reloading configuration from /usr/local/scAgent3.4.0/config/agent.conf
[Mon Jul 18 07:05:20 2011] [leo:9090(3.4.0.1)] DEBUG: Reloading configuration finished with
exit code: [0]
stdout: []
stderr: []
[Mon Jul 18 07:05:20 2011] [leo:9090(3.4.0.1)] DEBUG: Adding [*] to the allowed regex pattern
[Mon Jul 18 07:05:20 2011] [leo:9090(3.4.0.1)] DEBUG: Wildcard "*" found, allowing all commands
[Mon Jul 18 07:05:20 2011] [leo:9090(3.4.0.1)] DEBUG: Validating command/sequence [/usr/local/scAgent3.4.0/config/postclone_cmd_v2.sh]
[Mon Jul 18 07:05:20 2011] [leo:9090(3.4.0.1)] ERROR: [agt-00011] Command [/usr/local/scAgent3.4.0/config/postclone_cmd_v2.sh] is not allowed
[Mon Jul 18 07:05:21 2011] ERROR: [scf-00103] Running post create command [/usr/local/scAgent3.4.0/config/postclone_cmd_v2.sh] failed with exit code [1] and message [At least one command is not allowed to be executed remotely]

########## POST CREATE COMMANDS FINISHED WITH FAILURES ##########

ktenzer
6,437 Views

Can you please try moving your script to temp

/usr/local/scAgent3.4.0/config/postclone_cmd_v2.sh

so

/tmp/postclone_cmd_v2.sh

Then updating config file to go to /tmp/postclone_cmd_v2.sh and tryining again? I think we dont allow anything to run under scAgent3.4.0 directory for security reasons.

This does work believe me, just need to find out what is issue in your env

Also if you could send me agent.conf that would be helpful, the way it is now and Snap Creator config file?

Keith

cferbrache
6,412 Views

I just tried it with the postclone_cmd_v2.sh in /tmp and it worked just fine.

ktenzer
6,412 Views

Ok yeah sorry about that, I forgot we disable any script to run under scAgent3.4.0 directory (I think just under config directory), this is for security reasons. You can run and setup scripts anywhere else just not under that directory.

Also did you have NGS case for this? Engineering got an escalation for something that sounded very similar?

Case number is 2002360879, please let us know and NGS if this is your case that you have solution. NGS will want to capture this for any future cases

Regards,

Keith

cferbrache
5,333 Views

Yes there is a case. I have updated it with this information. Thanks again for you help in resolving this.

ktenzer
5,333 Views

I just checked again

Any script or command located under scAgent3.4.0 will be refused, anywhere else is allowed as long as you specify command in agent.conf

command: * - This allows everything

command: postclone_cmd_v2.sh - just would allow your script as long as * insnt also set

Regards,

Keith

cferbrache
5,333 Views

Good to know. This probabaly needs to be added to the documentation.

Public