- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- A script challange for everyone !! =)
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
09-27-2001 07:05 AM
09-27-2001 07:05 AM
A script challange for everyone !! =)
As most of you know I am a wanna be "king" script writter ! And I am working on it and getting better. But I have ran into a problem I can write scripts when I have a problem and I try to write a script. But I have not had to write a script latley. So I need a challange. I would like someone to give me a project a shell script and a perl script nothing too hard because I am still learning. But tell me what we need the script to do. Then once I have that info I will write a script to do what you have asked. And that is where the fun begins after that you can tear it up and help me correct the problems with it. Everyone who is intrested in script writting should take this challange it would be intresting to see how many differnt scripts we can come up with.
Let me know what you guys think.
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2001 07:14 AM
09-27-2001 07:14 AM
Re: A script challange for everyone !! =)
Sounds like a good idea. How about this one? All my Oracle developers have their home directories located under /home/oradev. Every so often (about once a week!) one of them will get the bright idea of copying hundreds of megabytes of files into their home directory for one reason or another. Can you write a script that will find the ten largest files in the /home/oradev directory tree, and then list the top ten disk users by directory?
(I've written a similar script here. I got tired of cleaning it up for them, so my script generates the output, which I then send to ALL of the developers. Peer pressure is a wonderful thing. When a bunch of them can't do any work because /home is full, they will go find the culprit at the top of the list. I usually don't have to do another thing!)
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2001 08:16 AM
09-27-2001 08:16 AM
Re: A script challange for everyone !! =)
I like thats thats pretty good.
Ok here is what I got so far. This command/script will list the top ten biggest files in /home and tell you what dir path they are in.
find /home/* -type f -size +10000c | xargs ll | sort -n +4.0 |
awk '{print $5,$6,$7,$8,$9}'|tail
Now when you say you want the top ten disk users by directory just in /home ? Can you give me a little bit of an idea of the output you are looking for..
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2001 08:34 AM
09-27-2001 08:34 AM
Re: A script challange for everyone !! =)
This will help you a lot in your daily routine. Most of the times, we may want to find the LVM configuration in different views.
A script that gives a quick overview of the volume groups, logical volumes, PVs, free disks. It should give the output based on the argument passed.
For ex.,
#vgview PV
PV Name LV Size Type Mount Point
c0t0d0-vg01 lvol1 200 LV /test1
lvol2 300 RAW -
FREE 2000 - -
C0t0d1-vg02 lvol1 1000 LV /mnt1
FREE 1000 - -
c0t0d2 FREE 4096 - -
#vgview lv
LV Name VG Size Type Mount Point PV
lvol1 vg01 200 LV /test1 c0t0d0
lvol2 vg01 300 RAW /test2 c0t0d0
lvol1 vg02 200 LV /mnt1 c0t0d1
#vgview vg
vg Name LV SIZE Type Mount Point PV
vg01 lvol1 200 LV /test1 c0t0d0
lvol2 300 RAW /test2 c0t0d0
lvol3 400 SWAP /test3 c0t0d5
.
What do you say?
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2001 09:10 AM
09-27-2001 09:10 AM
Re: A script challange for everyone !! =)
Here's another one (I had to write something for this, so I'll be interested in how you solve it..)
Disk Arrays often have utilities to list the hardware addresses and the vg that the disk has been assigned to. But OFTEN these utilities can not handle and thus do not report disks that are raw devices. One disk array attached to multiple servers, this can create a challenge when adding disks to any vg on any server.
So try and write a script to report the raw devices and the vg they are attached to.....Hmmmm....
Have fun !!
Rita
...I bet you love working on 10,000 piece puzzles too. ha ha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2001 09:53 AM
09-27-2001 09:53 AM
Re: A script challange for everyone !! =)
how about a pure "sh" script, which is doing
interactive dialogs to users, reacting on each
single (!) keypress (well, except for function
keys, of course ;-) and sends the collected
input via e-mail?
You will have to do this "portable", of course,
which means using "terminfo" for cursor control
and screen formatting... and you would like to
get that information in a config-file, right?
You could look into Lee Binkley's script site,
but that would not be sportive, would it?
The next (or first - as you like it) could be
DOS-like "tree" command (yes, I admit - I know
M$-DOS...), perhaps with a "-sum" option to
calculate the amount of space used *inside* a
directory? With error-checking for directries
where you do NOT have proper permissions for
reading/cd-ing ;-)
BTW, I am sure you do not play with those
10.000 pieces puzzles for some years now - they
do sell 100.000 pieces puzzles, though AFAIK...
HTH,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2001 10:22 AM
09-27-2001 10:22 AM
Re: A script challange for everyone !! =)
Here is from me.
On server1
#ps -ef
sachin 16216 15546 0 09:23:42 ttys3 0:00 remsh darwin -n rfslave 'CC(port:64475,host:server1)'
rfslave is program that creates tcp/ip port between server1 and client
on client (darwin)
sachin 2624 2523 0 09:23:44 ? 0:00 rfslave CC(port:64475,host:server1)
sachin 2523 2522 0 09:23:42 ? 0:00 csh -c rfslave 'CC(port:64475,host:server1)
* Some time remsh from server is finished but I still have rfslave running on client that is not valid now. I do want to find that and report it or kill it.
*we have 50 servers and all servers are client for another 49 sytems.
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2001 10:50 AM
09-27-2001 10:50 AM
Re: A script challange for everyone !! =)
Here is something like what I had in mind:
The top 10 disk users in /home/users are:
Blocks (1Kb) User Name
============ ===========
93792 John Poff
43191 Richard
16589 Bill Gates
14948 Larry Ellison
14265 Carly Fiorina
5583 Sridhar Bhaskarla
4645 Rita C. Workman
4505 Wodisch
3236 Sachin Patel
2925 Newbie User
Instead of just listing the account name (jpoff) you can grab the user name out of /etc/passwd so that the list makes a little more sense. (Sorry about using everybody's name from this post, but I was running out of names!)
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2001 12:07 PM
09-27-2001 12:07 PM
Re: A script challange for everyone !! =)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2001 12:28 PM
09-27-2001 12:28 PM
Re: A script challange for everyone !! =)
Larry, Carly, and Moe?
No, I won't go there. ;)
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2001 12:55 PM
09-27-2001 12:55 PM
Re: A script challange for everyone !! =)
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2001 01:03 PM
09-27-2001 01:03 PM
Re: A script challange for everyone !! =)
In my setup I have hp machines connected to same EMC box on multiple (4 to 6) fiber channels. So for each disk on EMC box we have multiple device files on server (ALT links.)
Whenever I need to add/extend file system, finding out free disk, becomes important and complex for me.
I would like to run script to get out put some thing like..
PV_Name::ALT_PV1::ALT_PV2::ALT_PV3::VG/LV/FS
c11t0d0::c9t0d0::c15t0d0::c17t0d0::vg1/lv1 /u01
c19t0d1::c22t0d0::c5t0d0::c8t0d0:: FREE
Thanks..
Prashant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2001 04:12 AM
09-28-2001 04:12 AM
Re: A script challange for everyone !! =)
Here's one you might want to try. I've been beating my brain on it for a while and still don't have a good solution, but then I don't know all the tricks that can be played with text manipulation tools.
Anyway, I have a script that is used to create all the tables and indexes in an Oracle database schema. The script consists of CREATE TABLE or CREATE INDEX statements with the STORAGE clauses all set to (initial 1M next 1M). What I need to do is change the storage clauses so the initial size is the current size of the object and the next size is 10% of the initial. The data for the initial size can be gotten by either querying Oracle's dictionary or generating a listing of sizes before processing the script.
I have tried using awk to do this but find I don't know enough about awk's capabilities (if any) of merging data from other files.
Any suggestions that can point me in the right direction would be greatly appreciated. Every time we rebuild that schema for reload it takes me upwards of 2 hours to manually edit that script with the correct sizing information and it has become a real drag.
Thanks for any assistance you can give.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2001 05:55 AM
09-28-2001 05:55 AM
Re: A script challange for everyone !! =)
I can tell you at least, how to collect a storage clause, may be you can post your script that creates the "CREATE TABLE.." statements, may be I can integrate the STORAGE part.
Volker
SVRMGR> select segment_name, segment_type, 'STORAGE ( INITAL ' || round(bytes/1024) ||
2> 'K NEXT ' || round(bytes/10240) || 'K )' from dba_segments where
3> segment_name='BNKA';
SEGMENT_NAME SEGMENT_TYPE 'STORAGE(INITAL'||ROUND(BYTES/1024)||'KNEXT'||ROUND(BYTES/10240)||'K)'
------------ ----------------- --------------------------------------------------------------------------------
BNKA TABLE STORAGE ( INITAL 5784K NEXT 578K )
1 row selected.
SVRMGR>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2001 09:06 AM
10-03-2001 09:06 AM
Re: A script challange for everyone !! =)
Fist off I want to thank everyone for your input this is a great thing for me because I can learn allot from all the projects everyone is giving me. But I am working them one by one in the order they came in. =)
John .. I have ran into a problem I dont know how to get the totals per directory. So far all I have is
du -s /home/* | more
du -s /home/*/* | more
but that is not in kb.
How about a hint here?
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2001 09:36 AM
10-03-2001 09:36 AM
Re: A script challange for everyone !! =)
-Santosh