Script to automate load of Aliasconfig

Unanswered Question
Apr 19th, 2007

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

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
ironport99 Thu, 04/19/2007 - 14:49

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 Fri, 04/20/2007 - 21:53

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 Tue, 04/24/2007 - 15:58

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
usommer_ironport Mon, 05/07/2007 - 09:12

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 Tue, 05/08/2007 - 10:35

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

usommer_ironport Thu, 05/10/2007 - 12:44

daryl,

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

Thanks

Uwe Sommer

ironport99 Tue, 05/15/2007 - 10:18

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 Tue, 05/15/2007 - 10:19

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

Actions

This Discussion