- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need a script to execute in HPUX machine
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2010 07:01 AM
05-02-2010 07:01 AM
1.uptime
2.cmviewcl -v
3.dmesg
4.tail -500 /var/opt/resmon/log/eventlog
5.Lvdisplay -v
6.lanscan -q
7.bdf
etc
please help me for this, otherwise each time i need to execute this commands and check it.Which is boring and difficult.
So Please get some script or give some solution.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2010 08:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2010 09:49 AM
05-02-2010 09:49 AM
Re: Need a script to execute in HPUX machine
It should store in the Desktop which i am logging through it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2010 12:49 PM
05-02-2010 12:49 PM
Re: Need a script to execute in HPUX machine
In plain English (as opposed to Developerese), that would be "Why didn't you say so in the first place???"
Formatting the file into HTML is not going to make any difference in the task of moving the file from the HPUX system(s) to your workstation: most file transfer methods don't care what's inside the file, they just move it. So is the HTML format a real requirement, or something you thought might help?
Actually, moving the file to your workstation might be the most complicated part of the script.
The first big question is, what file transfer methods are available in your environment? What file transfer protocols are available both on the HPUX machines and on your workstation? Or can you install something into your workstation?
When the transfer method is selected, the next big question is, can the file be "pushed" from the HPUX machine(s) to your workstation, or must you do something (e.g. run another script on the workstation) to "pull" the files from the HPUX machine(s)?
For example, if your workstation had a SSH server software running in it, and all your HPUX servers had the free HP Secure Shell product installed it would be easy to modify James's script to write its output to a file, then push the file to your workstation using the scp command.
If you can only set up a writeable Windows network share on your workstation, and all the HPUX machines have a CIFS client installed, you could perhaps use that in the script to push the output file to the network share of your workstation.
If your site has a firewall between your workstation and the HPUX machines and it's configured to stop all connections from HPUX to workstation (but not vice versa), then you need to "pull" the files to you by doing something at your workstation. If the HPUX systems have the above-mentioned HP Secure Shell product installed, you could install PuTTY (a free SSH client that includes some scriptable command-line tools), and use its "plink" command to run the data collection script on a HPUX machine, then use "pscp" command to pull the output file from the HPUX machine to you.
You could even write a script (a .bat or .cmd in a Windows environment) to do this automatically for all your systems at once.
If SSH is not available, you might do something similar with telnet/rlogin and FTP, although that would not be secure at all.
...But listing all these possible methods without knowing anything about your environment is really boring and difficult and won't help you much. So please, answer these two questions:
1.) What file transfer protocols are available between your workstation and the HPUX machines?
2.) Is it possible to "push" data to your workstation from the HPUX side?
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2010 12:50 PM
05-02-2010 12:50 PM
Re: Need a script to execute in HPUX machine
For HTML format,
This is what you need:
CFG2HTML, nice tool:
cfg2html_hpux_4.69-20100419-24165.depot cfg2html 4.69 for HP-UX 11.11-11.31 (hppa+ia64)
Check this out
http://www.cfg2html.com/
- Download the .depot file. --> ftp to the server.
- Install the depot , with swinstall
- Run the command # ./cfg2html
- The output will be .html and .txt as well.
- ftp back to your PC.
- you can open with browser and see all the data.
- Done.
Cheers, Have fun!.
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2010 04:41 AM
05-03-2010 04:41 AM
Re: Need a script to execute in HPUX machine
but I am working as RE in customer Site so there are 59 HPUX servers. so i can't keep on logging and push the output file to the desktop..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2010 08:28 AM
05-03-2010 08:28 AM
Re: Need a script to execute in HPUX machine
my suggestion is generate ssh keys and use the below script.
----------------------------------
for i add all ur hostname(urs is 59 servers)
do
echo "======================================================================================================================================"
echo " "
echo " $i "
ssh $i /usr/local/bin/sudo /usr/sbin/cmviewcl
done
echo "======================================================================================================================================"
regards
MC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2010 08:31 AM
05-03-2010 08:31 AM
Re: Need a script to execute in HPUX machine
for generating ssh keys
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1424116
refer to this post
regards
MC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2010 12:42 PM
05-03-2010 12:42 PM
Re: Need a script to execute in HPUX machine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2010 12:48 PM
05-03-2010 12:48 PM
Re: Need a script to execute in HPUX machine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2010 01:46 PM
05-03-2010 01:46 PM
Re: Need a script to execute in HPUX machine
Here is an example of a script:
From your putty session, I hope you have access (transparent access) to all 59 unix systems:
# cat myscript.sh
#!/usr/bin/sh
cd $HOME
mkdir myscript
cd $HOME/myscript/
uptime > uptime.txt
cmviewcl -v > cmviewcl_v.txt
dmesg > dmesg.txt
tail -500 /var/opt/resmon/log/eventlog > event.log_500.txt
lvdisplay -v > lvdisplay_v.txt
lanscan -q > lanscan_q.txt
bdf > bdf.txt
tar -cvf $HOME/myscript/myscript.`hostname`.tar *.txt
ls -l $HOME/myscript/myscript.`hostname`.tar *.txt
##########-----End_of_script ################
1. copy the script to each server under your home dir. Can be done with scp to all server. Have execute permission set before copy..
2. run it using ssh
# ssh servername:/YOURHOMEDIR/myscript/myscript.sh
# It will generate the tar file of the command output under servername:/YOURHOMEDIR/myscript/
3. Copy the file to your local unix system.
# scp $servername:/YOURHOMEDIR/myscript/myscript.$servername.tar .
##Where $servername is your servername ( 1to 59th) , can be run with a loop with the hostnames list.
4. Move all [ myscript.$servername.tar ] files to your windows system. using windows ftp.
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2010 01:52 PM
05-03-2010 01:52 PM
Re: Need a script to execute in HPUX machine
I'll try it but still have a doubt about looping all the servers.
Let me try...
i'll get back to you
Thanks...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2010 02:35 PM
05-03-2010 02:35 PM
Re: Need a script to execute in HPUX machine
-- Copy the file to your local unix system.
# scp $servername:/YOURHOMEDIR/myscript/myscript.$servername.tar .
##Where $servername is your servername ( 1to 59th) , can be run with a loop with the hostnames list.
The above step can be done : using a loop to all your 59 host:
1. Suppose you have executed the script and all the tar file is ready on the respective server to copy.
2. From your local unix host: from where you are doing putty ssh :to the unix system , use a loop to copy the 59 files all in one command:
- generate the server list file:
# vi my59_servers.list
#Add all the host name.
host1
host2
..
..
host59
- scp it using a loop: # scp will not prompt for password if transparent ssh is enabled.
############ execute the command like this:
# for i in `cat my59_servers.list`
do
scp $i:/YOURHOMEDIR/myscript/myscript.$i.tar .
done
# ls -l
# you will see all the 59 tar file with server name. Then you can tar them up to a single file, and move to the windows desktop.
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2010 02:57 PM
05-03-2010 02:57 PM
Re: Need a script to execute in HPUX machine
But do u think its very complicated to do all this...its easy only but...
just run one script in one UNIX system and get all the required info from all the servers and FTP back to my Desktop and i can fill the checklist and send to the customer..
And the Scenario is different hostname and diff passwords...and my desktop is windows..
and main problem is i do't know scripting about HPux....just know how to operate....like DOS...and HPux is like C++...
so i'm finding difficulty....
so i'm feeling very complicated to check in each server..
Anyway thank very much for the help...i'll try the things and get back to u for your suggestions...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2010 03:43 PM
05-03-2010 03:43 PM
Re: Need a script to execute in HPUX machine
well, if you are familiar with DOS batch programming , shell script is not very difficult to understand,
Here is a nice and simple steps:
It will run the script: myscript.sh , and then scp the file to the local unix host.
Prior to this the script myscript.sh , has to be in the server in that location.
TEST for one server manually: and check if the script is working and generating the tar file:
# ssh host1:/YOURHOMEDIR/myscript/myscript.sh
# scp host1:/YOURHOMEDIR/myscript/myscript.host1.tar .
- Run for all server in loop: from your local unix box: (Type below commands,)
for i in `cat my59_servers.list`
do
ssh $i:/YOURHOMEDIR/myscript/myscript.sh
# You will see some output of the script run. and it will generate the .tar file in the server.
# next command below will copy that tar file to the local unix host.
scp $i:/YOURHOMEDIR/myscript/myscript.$i.tar .
done
#----End----
Good luck and hope this helps..
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2010 08:01 PM
05-03-2010 08:01 PM
Re: Need a script to execute in HPUX machine
y do u want to use ftp ,, before running this script u can capture the screen and u can get the output in printable format.
regards
MC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2010 04:36 AM
06-03-2010 04:36 AM
Re: Need a script to execute in HPUX machine
Once you can ssh from the management server to each of the systems, then you'll need to write a script that first determines if the system is running (ie, ping check) and will allow a simple ssh command like: ssh server23 pwd
Now you can run the remote commands from a local script and store the results on your local system. At that point, you can ftp or use sftp to pull the files to your PC. Or you can run Apache on your management server and by storing the files in the Apache htdocs directory structure, anyone can open a browser window and select the server's file and look at the results.
The complete solution is to download and copy cfg2html to all your servers. That will be the data collection script. It stores all the information in a full HTML file set, complete with links to dozens of listings (10 times more than your list above).
If you think that this is a big project, you are correct, but it is the only sane way to manage multiple systems. Whether you have 10 systems or 250 systems, the task is the same. Once you have a centralized data collection method in place, it is fairly easy to create system administrator login trees to automate remote logins (PuTTY and the PuTTY Session Manager).
I will be describing and demonstrating all these tools next month at the HP Tech Forum conference in Las Vegas:
http://h30406.www3.hp.com/campaigns/2010/events/hptechforum/index.php
My session is HP-UX Summer Camp to be held on Monday as a pre-conference seminar and part of the worldwide user group Connect. I will also be giving an advanced scripting seminar on Thursday.
Bill Hassell, sysadmin