cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2116
Views
0
Helpful
9
Replies

Script to automate load of Aliasconfig

ron.owens
Level 1
Level 1

I currently sftp my alias and masquerading files from a MSAccess database and have top load them manually via a ssh session on my C30.

Is there as Perl script or similar that I can run from my PC that will log onto the C30 and execute command to automate this process?

Thanks

9 Replies 9

ironport99
Level 1
Level 1

In a perl script you can automate the ssh and then run the remote Ironport command :-
aliasconfig import $fname; commit alias

Hope this helps. I can send you an example script if you like.

steven_geerts
Level 1
Level 1

I can send you an example script if you like


Can you post the sample code to the forum? I'm interested in the method you use for automating the SSH commands to an Ironport device.

Thank you,
Steven

shannon.hagan
Level 1
Level 1

For ssh:
echo "ironport command"|ssh -t ironportname

If you have several commands, you can create a file with the command that you want to run then do - you have to keep in mind any prompts that require a yes/no answer - before we had centralized management, we would use this method against are boxes to keep in sync. Centralized management is much nicer though:
cat filename|ssh -t ironportname

However, you will want to setup the userkeys first so you don't have to log on with username/pwd if you are running from a script such as bash.



Can you post the sample code to the forum? I'm interested in the method you use for automating the SSH commands to an Ironport device.

Thank you,
Steven

You could also use the 'expect' language to simulate a human at a keyboard.

Check out :

http://expect.nist.gov/

:)

I have tried to create a script that can use choices but i cant get it to work.
Here is an example:

userconfig new testuser testuser 1 secret

Where "1" is one of the groups (Administrators,Operators,Guests)

I always receive an error stating "unknown group name"
I have tried the group number as well as the group name.

Any help is appreciated.

ironport99
Level 1
Level 1

Uwe,

The group for administrators is "admin" (the other two are: operators and guest) so the command should be:-

userconfig new testuser testuser admin secret;commit newuser

daryl,

thanks for your answer. It works as expected.
How did you find the right groupname?

Thanks

Uwe Sommer

ironport99
Level 1
Level 1

Uwe,

If you run userconfig from the CLI the userlist that is displayed shows the groupname in brackets after the username.

e.g. 1. testuser - "testuser" (operators)

Cheers,

Daryl

ironport99
Level 1
Level 1

Uwe,

If you run userconfig from the CLI the userlist that is displayed shows the groupname in brackets after the username.

e.g. 1. testuser - "testuser" (operators)

Cheers,

Daryl

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: