- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Scripting
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
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
02-27-2002 07:04 PM
02-27-2002 07:04 PM
Scripting
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2002 07:21 PM
02-27-2002 07:21 PM
Re: Scripting
In the below posting there was some ideas and scripts actually attached. You could without cheating use the ideas and write you own, without looking at the attachments....
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x026250011d20d6118ff40090279cd0f9,00.html
The ideas are just about endless.
-Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2002 07:35 PM
02-27-2002 07:35 PM
Re: Scripting
Say you've got a test box that has HP-UX 11.0 on one disk and HP-UX 11i on another.
What I want is a script that will reset my primary boot disk for whichever version of HP-UX I want so that I don't have to interrupt the boot process if I want to reboot into the other version.
I realize that this will differ based on the hardware paths for the disks on different machines, but those could be set as command line options or variables within the script.
What do you think?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2002 07:58 PM
02-27-2002 07:58 PM
Re: Scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2002 08:00 PM
02-27-2002 08:00 PM
Re: Scripting
You couldn't give Paul something easier for a
beginner?
How about writing a simple menu based program
for operators that they could actually do
certain functions, like kill print jobs, users
query directories for downloads, check whether
databases are up.
-Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2002 08:03 PM
02-27-2002 08:03 PM
Re: Scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2002 08:13 PM
02-27-2002 08:13 PM
Re: Scripting
Have been dabling with basic menus and stuff, I have attached an example, suppose I just want to walk before I can crawl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2002 09:08 PM
02-27-2002 09:08 PM
Re: Scripting
That's not a bad attempt at all. Certainly the
framework is there. I have two further suggestions for you which I don't believe were in the link I gave you before.
Write a script that monitors essential processes that are supposed to be running on your system.
e.g. inetd, vhand, statdaemon, lpsched, others
that you may need for your applications. You
could start this script once out of inittab
and have it wake every x minutes to run again.
The second one is more for security, where you
could monitor certain files for changes, set a
baseline, tell you what the changes are and
e-mail you the differences. These files could
include, passwd, group, inetd, services,
resolv.conf, sudoers (if used).
HTH
-Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2002 09:16 PM
02-27-2002 09:16 PM
Re: Scripting
Thanks for advice, will get cracking. One of the problems I have is that I do not really get a chance to do scripting as it is done by others. And thing such as inetd etc have already been done. Will plug on though and see where this get me.
Thanks
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2002 09:21 PM
02-27-2002 09:21 PM
Re: Scripting
What about scripts that would aid investigation with regard to application support?
You could look at some of the investigations performed by the helpdesk and simplify these
with the use of a script, looking in log files, C-ISAM files for entries errors etc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2002 11:36 PM
02-27-2002 11:36 PM
Re: Scripting
Great Examples
http://www.introcomp.co.uk/examples/index.html
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2002 06:00 AM
02-28-2002 06:00 AM
Re: Scripting
If you've got all the required modules installed, cp the three files to /tmp and
/tmp # xamen -m.
Since the quest was for scripting, I guess you're not interested in the C program :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2002 06:16 AM
02-28-2002 06:16 AM
Re: Scripting
If you want something to get your teeth in why not take a look at cfg2html.
http://members.tripod.com/rose_swe/cfg/cfg.html
You could see if you could do something similar without taking a look at the script.
You could also write a script for a basic system monitoring that would mail the sys admin, say for example when filesystems fill up or if the cpu is at 100%, etc.
Have fun
George
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2002 06:31 AM
02-28-2002 06:31 AM
Re: Scripting
Here is a useful idea and it will also teach you a valuable concept:
Given a list of Process ID's (pids) supplied on the command line, your script should kill each one BUT using this method:
Send kill -15, -1, -2, -3, and kill -11 in that order and testing via kill -0 pid with a brief sleep to see if the kill succeeded.
The idea is that you would send -kill -15, sleep a bit, and test to see if the process still exists before trying kill -1. If and only if a -k is supplied to your script would you finally send a kill -9.
Your script should use getopts to process the command line. You should study why kill -9 is a very bad idea though it is taught as a routine practice in many Kindergarten Admin classes. You should man getopts and kill for details. You will actually find that this will become a very valuable addition to your sysadmin toolbox.
Food for thought, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2002 06:32 AM
02-28-2002 06:32 AM
Re: Scripting
The best way to learn is to see how other people tackled issues. Having access to sample scripts is the most helpful thing a sysadmin could have. You should also contemplate learning perl, along with the standard sh and ksh scripts.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2002 06:33 AM
02-28-2002 06:33 AM
Re: Scripting
How about a script to schedule a make_tape_recovery backup with the "at" command?
-validate "at" arguments passed to the script
-accept and validate "tape drive to use" argument
-verify a tape is in the drive - if not, tell the user and ask if he wants to continue
-verify args are entered and provide a "usage" message if not
-add to a log file a message that this script ran, by whom, when, and when the make_tape_recovery is scheduled for
I use a script like this now as well as a few others to "schedule" things I do infrequently and don't want to have to remember the syntax.
Darrell