shell script to collect information from current and remote unix boxes


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting shell script to collect information from current and remote unix boxes
# 8  
Old 02-03-2012
Quote:
Originally Posted by amir07
the above script works fine when I logged as a root. the only problem I have
I dont want the heading for each boxes. As you can see "Hostname Modelname SerialID
" is repeating

Hostname Modelname SerialID
AIXMC01 IBM,7026-B80 IBM,0110BBA1F
Hostname Modelname SerialID
AIXMC02 IBM,7026-H50 IBM,0110BBA56
Hostname Modelname SerialID
AIXMC03 IBM,7026-H50 IBM,0110BBARR
Hostname Modelname SerialID
AIXMC04 IBM,7026-B80 IBM,0110BBA43
If you don't want it to print the heading, don't print the heading... Print it yourself, before the loop, in the shell.
# 9  
Old 02-03-2012
basically I need sort to numeerically
sort -n | uniq in the script.
# 10  
Old 02-03-2012
Sort what numerically? None of those columns are numerals...
# 11  
Old 02-06-2012
sort hostname in numerically:
Code:
Hostname   Modelname      SerialID 
AIXMC01    IBM,7026-B80   IBM,0110BBA1F
AIXMC02    IBM,7026-H50   IBM,0110BBA56
AIXMC03    IBM,7026-H50   IBM,0110BBARR
AIXMC04    IBM,7026-B80   IBM,0110BBA43

after running the script I can sort them; I have to take another steps.
All I need to sort hostname numerically and not to repeat the heading.

Thanks.
# 12  
Old 02-07-2012
Print the header separately, then pipe the code block producing this output through sort...
# 13  
Old 02-07-2012
Quote:
Originally Posted by amir07
As I mentioned passwordless ssh already in place.

the above script works fine when I logged as a root. the only problem I have
I dont want the heading for each boxes. As you can see "Hostname Modelname SerialID
" is repeating
Code:
Hostname   Modelname      SerialID 
AIXMC01    IBM,7026-B80   IBM,0110BBA1F
Hostname   Modelname      SerialID
AIXMC02    IBM,7026-H50   IBM,0110BBA56
Hostname   Modelname      SerialID
AIXMC03    IBM,7026-H50   IBM,0110BBARR
Hostname   Modelname      SerialID
AIXMC04    IBM,7026-B80   IBM,0110BBA43

OMG!!!! Really???
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. SuSE

How to filter SYSLOG data to collect meaningful information only?

Dear users, SUSE 10 sp3 and SUSE 11. I made configuration changes in '/etc/syslog-ng/syslog-ng.conf' to move SYSLOG content to LogRhythm. This is what I changed in the file. Un-comment out the following lines #Enable this and admop IP to send log messages to... (10 Replies)
Discussion started by: JDBA
10 Replies

2. Shell Programming and Scripting

Triggering remote UNIX shell script from Remote desktop

I m trying to run a batch script in remote desktop which executes unix commands on the unix server...the problem is i wnt the output in HTML format.so in my batch script i m giving the cmd like ssh hostname path ksh HC_Report.ksh>out.html ...but it generates the HTML file in remote desktop .i... (2 Replies)
Discussion started by: navsan
2 Replies

3. UNIX for Dummies Questions & Answers

Shell script to collect inbound connections

Hi Kindly provide me shell script on server to collect inbound connections, using port number on Linux. (4 Replies)
Discussion started by: adminhelp
4 Replies

4. Shell Programming and Scripting

script to collect all db information

hi all I am looking for shell script ,by which i need to gather all the DB information in Sybase server . Thanks in advance :) (3 Replies)
Discussion started by: mvsramarao
3 Replies

5. Shell Programming and Scripting

Collect information from switches

Hi All , In my environment we have 12 SAN switches .Culd u pls help me for below queries . would like to telnet to all switches and collect information in daily basis with "switchstatus" command and store the output under /tmp/ folder on systemA . To keep passwords of 12switches in a... (1 Reply)
Discussion started by: chinni-script
1 Replies

6. UNIX for Dummies Questions & Answers

Enable a shell to collect data from unix, return to windows

hi I am very new to UNIX. I need to retrieve data from a unix system and store it and display as output on a windows system. Initiation of procedure is through JAVASCRIPT-based buttons on a HTML page. This should cause a set of commands to run which colllect data from a unix based server and... (1 Reply)
Discussion started by: rossalyn_maxter
1 Replies

7. Shell Programming and Scripting

How can my unix shell script automatically connect to remote host?

How can my unix shell script automatically connect to remote host? Assume that there is a remote host called "rhost". When I connect to that host i give the command "telnet rhost". It then asks me for my id and password. Once i give it connects there. I want to automate these steps. I want... (8 Replies)
Discussion started by: digdarshan
8 Replies

8. Solaris

Planning for DR, I have to collect information

Dear All, We are going for Disaster Recovery project, the vendor asked for more details about how much is the daily data changes only. using sar / iostat can any one help me to collect this ?! Note: only I need the changed data size not the daily increasing data. this is to know how much... (1 Reply)
Discussion started by: adel8483
1 Replies

9. Programming

text boxes, radio buttons , check boxes in c++ on unix

Hi ! Please tell me how to get radio buttons, text boxes , check boxes , option buttons , pull down menus in C++ on Unix. I think it would be done using curses.h ..but that's all i know. TIA, Devyani. (3 Replies)
Discussion started by: devy8
3 Replies
Login or Register to Ask a Question