Sponsored Content
Special Forums IP Networking How to extract NIC and other info ,given Ip Post 302229144 by sysgate on Tuesday 26th of August 2008 09:04:35 AM
Old 08-26-2008
Consider using Expect - it's invaluable tool for network / system administration and automation. Else, do an SSH shot as in : ssh root@server "command to execute"
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using cut to extract info

a simple question, how can i use cut (after using grep) to extract the last four digits on a line. so say i had a string http://blabla:9020, how would I extract the port?? -Fez (4 Replies)
Discussion started by: hafhaq
4 Replies

2. AIX

need to extract info from log files

hi guys i need to extract information from log files generated by an application. log file has the following lines for each process.. ---------------------------------------------- Fri Aug 03 12:06:43 WST 2007 INFO: Running project PROJECT1 Fri Aug 03 12:06:43 WST 2007 INFO: Source Files... (7 Replies)
Discussion started by: kirantalla
7 Replies

3. AIX

Extract info

Anyone have a better idea to automate extraction of info like ... "uname" "ifconfig" "ps efl" "netstat -ao" etc. from several hundred aix, solaris, red hat boxes? without logging into each box and manually performing these tasks and dumping them to individual files? thanks for any input (1 Reply)
Discussion started by: chm0dvii
1 Replies

4. Shell Programming and Scripting

Extract info from csv

I have some input file, which contains some lines which are comma separated. Eg. a,b,id=999],d d,f,g,id=345],x x,y,x,s,id=677],y I run a loop to read the lines one by one. What i want is to extract the value on the right of id=. I cannot do it by Awk, since the column number is not fixed.... (5 Replies)
Discussion started by: indianjassi
5 Replies

5. Shell Programming and Scripting

how to extract info from a file using awk

Dear all I have a file call interfaces.txt Filename: interfaces.txt How can I extract the information at below? ABC_DB_001 hostname1 20901 ABC_DB_002 hostname2 20903 ABC_DB_003 hostname3 20905 Currently I am using a very stupid method grep ^ABC interfaces.txt > name.txt grep... (3 Replies)
Discussion started by: on9west
3 Replies

6. IP Networking

Best reference for understanding low level info on nic cards drivers and functionality

Hi, What is the best reference that gives in detail on nic cards configuration , assigning multiple ip addresses to a single interface, netlink library etc and all basic stuff at this level..? Thanks (2 Replies)
Discussion started by: Gopi Krishna P
2 Replies

7. Shell Programming and Scripting

How to extract info from pings.?

Hi guys, new to this forum. I am currently trying to extract the times from pinging a domain and list the top 3 and then also do the opposite i.e. list the bottom 3. so if I had this as a ping result (the bold part is what I want): 64 bytes from 193.120.166.90: icmp_seq=10 ttl=128 time=34.8... (5 Replies)
Discussion started by: acoding
5 Replies

8. Shell Programming and Scripting

Compare two files and extract info

Hello, I have two files which look like this File 1 Name test1 status P Gene1 0.00236753 1 1.00E-01 Gene2 0.134187 2 2.00E-01 Gene3 0.000608716 2 3.00E-01 Gene4 0.0016234 1 4.00E-01 Gene5 0.000665868 2 5.00E-01and file 2 No Pos ... (2 Replies)
Discussion started by: nans
2 Replies

9. Shell Programming and Scripting

Extract info from sar output

Hi I have an output of sarcommand which is as follows: 10:22:18 bread/s lread/s %rcache bwrit/s lwrit/s %wcache pread/s pwrit/s 10:23:18 0 398 100 5 13 64 0 0 10:24:18 0 332 100 5 15 65 0 0 10:25:18 0 ... (7 Replies)
Discussion started by: fretagi
7 Replies

10. Shell Programming and Scripting

Help with awk to extract additional info

Hi I use multipath linux command to get LUNs info and find out if any failed. # multipath -ll >/tmp/mpfail # cat /tmp/mpfail multipath.conf line 109, invalid keyword: user_friendly_names multipath.conf line 153, invalid keyword: user_friendly_names multipath.conf line 193, invalid... (4 Replies)
Discussion started by: prvnrk
4 Replies
Config::Model::IdElementReference(3pm)			User Contributed Perl Documentation		    Config::Model::IdElementReference(3pm)

NAME
Config::Model::IdElementReference - Refer to id element(s) and extract keys VERSION
version 2.021 SYNOPSIS
# synopsis shows an example of model of a network to use references use Config::Model; use Log::Log4perl qw(:easy); Log::Log4perl->easy_init($WARN); my $model = Config::Model->new; # model of several hosts with several NICs $model->create_config_class( name => 'Host', 'element' => [ ip_nic => { type => 'hash', index_type => 'string', cargo => { type => 'leaf', value_type => 'uniline', } }, ] ); # model to choose a master host and a master NIC (whatever that may be) # among configured hosts. Once these 2 are configured, the model computes # the master IP $model->create_config_class( name => "MyNetwork", element => [ host => { type => 'hash', index_type => 'string', cargo => { type => 'node', config_class_name => 'Host' }, }, # master_host is one of the configured hosts master_host => { type => 'leaf', value_type => 'reference', # provided by tConfig::Model::IdElementReference refer_to => '! host' }, # master_nic is one NIC of the master host master_nic => { type => 'leaf', value_type => 'reference', # provided by tConfig::Model::IdElementReference computed_refer_to => { # provided by Config::Model::ValueComputer formula => ' ! host:$h ip_nic ', variables => { h => '- master_host' } } }, # provided by Config::Model::ValueComputer master_ip => { type => 'leaf', value_type => 'string', compute => { formula => '$ip', variables => { h => '- master_host', nic => '- master_nic', ip => '! host:$h ip_nic:$nic' } } }, ], ); my $inst = $model->instance(root_class_name => 'MyNetwork' ); my $root = $inst->config_root ; # configure hosts on my network my $step = 'host:foo ip_nic:eth0=192.168.0.1 ip_nic:eth1=192.168.1.1 - host:bar ip_nic:eth0=192.168.0.2 ip_nic:eth1=192.168.1.2 - host:baz ip_nic:eth0=192.168.0.3 ip_nic:eth1=192.168.1.3 '; $root->load( step => $step ); print "master host can be one of ", join(' ',$root->fetch_element('master_host')->get_choice)," " ; # prints: master host can be one of bar baz foo # choose master host $root->load('master_host=bar') ; print "master NIC of master host can be one of ", join(' ',$root->fetch_element('master_nic')->get_choice)," " ; # prints: master NIC of master host can be one of eth0 eth1 # choose master nic $root->load('master_nic=eth1') ; # check what is the master IP computed by the model print "master IP is ",$root->grab_value('master_ip')," "; # prints master IP is 192.168.1.2 DESCRIPTION
This class is user by Config::Model::Value to set up an enumerated value where the possible choice depends on the key of a Config::Model::HashId or the content of a Config::Model::ListId object. This class is also used by Config::Model::CheckList to define the checklist items from the keys of another hash (or content of a list). CONSTRUCTOR
Construction is handled by the calling object (Config::Model::Node). Config class parameters refer_to "refer_to" is used to specify a hash element that will be used as a reference. "refer_to" points to an array or hash element in the configuration tree using the path syntax (See "grab" in Config::Model::Node for details). computed_refer_to When "computed_refer_to" is used, the path is computed using values from several elements in the configuration tree. "computed_refer_to" is a hash with 2 mandatory elements: "formula" and "variables". The available choice of this (computed or not) reference value is made from the available keys of the refered_to hash element or the values of the refered_to array element. The example means the the value must correspond to an existing host: value_type => 'reference', refer_to => '! host' This example means the the value must correspond to an existing lan within the host whose Id is specified by hostname: value_type => 'reference', computed_refer_to => { formula => '! host:$a lan', variables => { a => '- hostname' } } If you need to combine possibilities from several hash, use the ""+"" token to separate 2 paths: value_type => 'reference', computed_refer_to => { formula => '! host:$a lan + ! host:foobar lan', variables => { a => '- hostname' } } You can specify "refer_to" or "computed_refer_to" with a "choice" argument so the possible enum value will be the combination of the specified choice and the refered_to values. Methods reference_info Returns a human readable string with explains how is retrieved the reference. This method is mostly used to construct an error messages. AUTHOR
Dominique Dumont, (ddumont at cpan dot org) SEE ALSO
Config::Model, Config::Model::Value, Config::Model::AnyId, Config::Model::CheckList perl v5.14.2 2012-11-09 Config::Model::IdElementReference(3pm)
All times are GMT -4. The time now is 09:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy