Probably an easy AIX-SMIT question with mkroute


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Probably an easy AIX-SMIT question with mkroute
# 1  
Old 02-24-2008
Probably an easy AIX-SMIT question with mkroute

Hi All,

I am on a project and logging into about 100 servers one at a time. One of the steps I am performing is setting up a link with smit mkroute. I am using AIX versions 5.2 and 5.3

Does anyone know a quick command line to set DESTINATION ADDRESS, GATEWAY address, Network MASK, and Network Interface automatically on the command line (the Interface is always 'en0' and the others I mentioned are always the same numbers, everything else is default) I found this:

ProQuest Information and Learning - 0738423777 - IBM eServer Certification Study Guide - pSeries AIX System Administration

Which shows how you can use the *route* command instead of SMIT.
But that example is from version 4, which doesn't have all the options. And if I hit F6 for "COMMAND", I get a complex script, and not a single command line.

I could put this line into a script and it would save me tons of time, instead of going in and retyping these #s over and over- looking all over the web, but I can't seem to find an example anywhere. It's probably an easy question if you are a networker, I am mostly a programmer. Thanks if anybody knows.Smilie
# 2  
Old 02-24-2008
How to derive procedures from SMIT

Actually the "complex script" is relatively easy to decipher. Hitting <F6> makes SMIT show what it would execute. This is the case since the first AIX version i used (3.2.3) and will perhaps only change when hell freezes over. ;-))

An easy way to find out what SMIT exactly does is: fill the mask with easily distinguishable values, press <F6> and in the last line you see the real call with your values. In the script above (which is called by this line) you can now find out where and how these values go and near the end of the "cmd_to_exec" you find the real OS-level command: "chdev -l ...."

Specifically for your problem i have done it for you. How to change routes according to SMIT:

Code:
chdev -l inet0 -a route=<destination>,-hopcount,<hopcount>,-netmask,<netmask>,-if,<interface>,,,,<destination>,<gateway>

If you do not need a specific peace of information or want to use defaults you can leave that part out. For instance if you do not want to specify a hopcount replace "-hopcount,<hopcount>" with "".

By the way: if all your values are always the same you can also do the following: use SMIT do do it once on a machine. Then have a look in the file "smit.script" in your home directory. From there you can copy the function declaration along with the command to execute the function with certain values, to a separate file, name it "mychange.sh", give it execute rights and use it over and over again.

I hope this helps.

bakunin

PS: wouldn't that thread have been better placed in the AIX forum? SMIT is a very specific AIX tool, which does not exist outside AIX boxes. Just a thought.
# 3  
Old 02-24-2008
I saw a number of conditionals in that F6 command leading up to cmd_to_exec, and did not want to take any chances if I was executing this on production machines. I know it is a simple procedure, but mistake is not an option-better safe than sorry.

my SMIT F6 says:
cmd_to_exec
{
.....
}
cmd_to_exec 'net' '167.210.153.38' '130.103.18.1' '0' -m'255.255.254.0' -i'en0 Standard Network Interface' 'no' 'no' '0' '1' 'no'

Where 167... is the DESTINATION Address, 130... is the GATEWAY Address, 255... is the Network MASK, and of course en0 the Network Interface.

AIX- a good point, but to save myself from the wrath of Geek agression, I placed myself in the "Dummy forum".
Production machines tend to make you paranoid and repetetive in your explanations. In any case I will use the command-thanks much!
# 4  
Old 02-24-2008
The solution in my case:

chdev -l inet0 -a route=net,-hopcount,0,-netmask,[NETMASK],-if,en0,,,,[DESTINATION Address],[GATEWAY Address]
# 5  
Old 02-24-2008
Quote:
AIX- a good point, but to save myself from the wrath of Geek agression, I placed myself in the "Dummy forum".
Even when we use IBMs Unix we bite only rarely. ;-)

If you do that on a (or even several) production machine(s): Please try the procedure on a test machine before using it!

I really hate to damage my reputation but: i make errors. (Letting pass my carreer actually a lot of them: it is called professional experience.) So please: don't take my word without testing what i say. If you want to destroy a lot of machines with a single error please do not rely on me to provide it - make your own ones.

Regarding the "cmd_to_exec()" function out of SMIT: you don't even have to understand what it does. Copy the whole function into a file (the content of a function is - like in C - everything from "{" to "}") and the line with the function call below it. Then save the file, issue a "chmod 755 <filename>" and you have a ready-to-go script you can use on all of your machines.

Again: test it first before you go over the productive machines. SMIT is written by guys like me and they make errors too (but they bite rarely).

I hope this helps and all the best for your change.

bakunin
# 6  
Old 02-24-2008
Oh believe me I tested it. We all have to be responsible for our own actions........ Thanks 4 the advice!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

AIX 5.3 Using sudo to control smit

Does anyone have any experience using sudo to control smit on AIX 5.3? These are the smit commands that I want certain users to execute: # Cmnd alias specification Cmnd_Alias SMIT = /bin/smit hacmp, \ /bin/smit pxdam, \ /bin/smit cl_lsuser, \ /bin/smit cl_users, \ /bin/smit cl_passwd ... (5 Replies)
Discussion started by: tharrieswk
5 Replies

2. AIX

How do I killed ideal users from AIX 5.3 smit?

Hi, I'm newbee to AIX and would like to setup a process which kills 1 Hr. ideal users from smit. Please advise for making it work. :) Thanks, Sumit (2 Replies)
Discussion started by: sumit30
2 Replies

3. Shell Programming and Scripting

Using expect script with AIX's SMIT in cron

My searches turned up nothing relevant, so I apologize if this has already been looked at. I am trying to run an expect script from a Solaris machine, that ssh's into an AIX machine, and interacts with a SMIT created menu system that runs a few backups for me. The expect script runs fine when... (0 Replies)
Discussion started by: Mariognarly
0 Replies

4. Solaris

SMIT i AIX Sun Solaris ?

i now when i want use the smit in AIX is possible but a ask if you has in sun same job in sun tel me please awating supports (3 Replies)
Discussion started by: Yalmalki
3 Replies

5. AIX

Probably an easy SMIT question- "Unable to open temp file"

Hi All, Can't find any documentation on the web for this anywhere, except about three web pages that are in Chinese. When I enter SMIT on this box, I get ERROR MESSAGE: Unable to open temp file I suspected smit.log, but it is universal readable, writeable by root, and I am root.... (6 Replies)
Discussion started by: jeffpas
6 Replies

6. UNIX for Dummies Questions & Answers

easy question

Hi everybody: Could anybody tell me if I have several files which each one it has this pattern name: name1.dat name2.dat name3.dat name4.dat name10.dat name11.dat name30.dat If I would like create one like: name_total.dat If I do: paste name*.dat > name_total.dat (15 Replies)
Discussion started by: tonet
15 Replies

7. Shell Programming and Scripting

Hopefully an Easy Question

I have a file name in this format ABC_WIRE_TRANS_YYYYMMDD_00.DAT I need to cut out the _00 out of the file name everytime. It could be _00, _01,_02, etc .... How do I cut it out to look as follows? ABC_WIRE_TRANS_YYYYMMDD.DAT (6 Replies)
Discussion started by: lesstjm
6 Replies

8. What is on Your Mind?

AIX Smit menu designer. WinSmit

Hi, Please excuse me for posting an "ad" message here. Over the last few months I have created software called WinSmit, with this tool you can create your own AIX smit menus and corresponding message files. We all know the smit or smitty menus that IBM provides to maintain the system, the... (6 Replies)
Discussion started by: mimyrtek
6 Replies

9. UNIX for Dummies Questions & Answers

Another easy question

Hello Again, Ok guys. Thanks again for your help last time but I am in need of your experience again. I wrote this script: #!/bin/sh # List either files or directories in individual accounts # using 1, 2 or 3 with invalid case $1 in echo select 1 to see the FILES in your... (3 Replies)
Discussion started by: catbad
3 Replies

10. UNIX for Dummies Questions & Answers

easy question

I know the Sun Solaries versions are ( 2.3 , 2.4 , 2.5 ... 7 , 8 ) . But some times I see sun os v5.x what does it mean ?? also what is the last new machine for sun and what are its details specifications . Thanks (3 Replies)
Discussion started by: tamemi
3 Replies
Login or Register to Ask a Question