Command assistance


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Command assistance
# 1  
Old 02-26-2008
Data Command assistance

Hi,

We currently use the below basic scripts to output details that the business requires for our AIX and Sun servers. I have been asked to produce the same sort of script to be used for our NCR MP-RAS UNIX and OS/2 UNIX servers but am not formilar with these forms of Unix. Would greatly appreciate if anyone can assist me with this. Smilie

AIX
#!/bin/ksh
OUT="/tmp/serverinfo_$(hostname).txt"
print "Server Info" > $OUT
print "hostname" > $OUT
hostname >>$OUT
print "\n-----------------------------------------------" >> $OUT
print "ifconfig -a " >> /$OUT
ifconfig -a >>$OUT
print "\n-----------------------------------------------" >> $OUT
print "Number of processors" >> /$OUT
lsdev -Cc processor >>$OUT
print "\n-----------------------------------------------" >> $OUT
print "lslpp -L" >> /$OUT
lslpp -L >>$OUT

Sun
touch /tmp/`uname -n`-swinv.txt
echo Server Info >>/tmp/`uname
echo =========HOSTNAME=========== >>/tmp/`uname -n`-swinv.txt
uname -n >> /tmp/`uname -n`-swinv.txt
echo >> /tmp/`uname -n`-swinv.txt
echo =========IP ADDRESSES=========== >>/tmp/`uname -n`-swinv.txt
ifconfig -a >>/tmp/`uname -n`-swinv.txt
echo >> /tmp/`uname -n`-swinv.txt
echo ===========HW/CPU INFO============== >>/tmp/`uname -n`-swinv.txt
/usr/platform/`uname -i`/sbin/prtdiag >> /tmp/`uname -n`-swinv.txt
echo >> /tmp/`uname -n`-swinv.txt
echo ==============SW INSTALLED================ >>/tmp/`uname -n`-swinv.txt
pkginfo |sed /SUNW/d|awk '{ print "pkginfo -l " $2}'>> /tmp/`uname -n`-swinv.txt
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Assistance with my Find command to identify last part of a file name and report the name found

Hello Forum, We have two bootstraps of Chef in our environment which are identified by colour: /var/chef/cache/cookbooks/bootstrap_cookbooks_version_green and /var/chef/cache/cookbooks/bootstrap_cookbooks_version_red I'm attempting to identify which version is installed based on the name... (11 Replies)
Discussion started by: greavette
11 Replies

2. UNIX for Beginners Questions & Answers

Assistance with my one line command to find all inactive kernels

Hello Forum, I'm using the following command to find all inactive kernels installed on my RHEL server: $ rpm -qa | grep '^kernel-' |grep -vE `uname -r` but the result is in two lines: kernel-3.10.0-1062.1.1.el7.x86_64 kernel-3.10.0-1062.el7.x86_64 Is there a one line command I can... (3 Replies)
Discussion started by: greavette
3 Replies

3. UNIX for Beginners Questions & Answers

Student needs grep command assistance

I am a student in a UNIX/Linux classes having hard time with grep looking for assistance on some home work I need to figure out some kind of grep command to get a out put that only gives me information from a sample file and only list the people with the first name John the sample file is named... (1 Reply)
Discussion started by: jetoutant
1 Replies

4. UNIX for Dummies Questions & Answers

Sed/command assistance

Hello, I'm attempting to play with sed commands again... I have a file named test1 with numbers...ex:5551234567 I run this sed on the file... cat test1 | sed 's/^/homeDnModify "/g' | sed 's/$/" "" 3/g' >test2 Im hoping it will look like this... homeDnModify "551235" "4567" ""... (5 Replies)
Discussion started by: jay11789
5 Replies

5. UNIX for Dummies Questions & Answers

Sed/command assistance

Hello all, I need some help and education creating a script. Basically I have a file with a list of numbers.. 2125554444 2124445555 I need to put them into a format that looks like this.... UQ-V8.1,2125554444,hdaudio UQ-V8.1,2124445555,hdaudio Any help would be greatly... (6 Replies)
Discussion started by: jay11789
6 Replies

6. UNIX for Dummies Questions & Answers

[Solved] Assistance with find command please

Trying to locate files less than xx days old, throughout all directories/subdirectories, but excluding certain types of directories and files. The directories I want to search all contain the same characteristic (dbdef, pldef, ghdef, etc), and there are subdirectories within that I need to... (2 Replies)
Discussion started by: Condmach
2 Replies

7. Shell Programming and Scripting

Grep Alerting - command or script assistance

Hello! I need some help with grep from various logs we use for monitoring transactions. The logs contain the following information (which is consistent in all of the files): 12:28:33.157 EWY D 1 (tcpip.c:282): tcpip.c: Unable to connect to x.x.x.x on port xxxx. (79) Connection refused ... (1 Reply)
Discussion started by: sbchecko
1 Replies

8. Shell Programming and Scripting

Loop assistance, getting array of random numbers and feeding to a command, how-to?

Hi all, I need a little assistance to complete the following script. I would like to take a file with a single number on each line and for each number, run it through a command. The loop will terminate once all numbers have been checked. Here is what I have thus far... COUNTER=`wc -l... (2 Replies)
Discussion started by: boolean2222
2 Replies

9. Shell Programming and Scripting

I need an assistance

I have a school project to create a shell program same as calendar i must create a txt file with celebrations with vi i know this but the problem is i don't know awk and grep. The object of object is to create a program who read a date an appear the celebration. Can you help me please !!!... (1 Reply)
Discussion started by: mytilini boy
1 Replies

10. Shell Programming and Scripting

Perl script assistance; paste word into external command

I'm attempting to create a Perl script that will: Take the contents of the usernames.tmp file (usernames.tmp is created from an awk one-liner ran against /etc/passwd) Take one line at a time and pass it to the su command as a users name. This should go on until there is no more name to... (10 Replies)
Discussion started by: bru
10 Replies
Login or Register to Ask a Question