- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: favorite sysadmin scripts you always keep arou...
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
Discussions
Discussions
Forums
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
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
тАО06-27-2003 06:36 AM
тАО06-27-2003 06:36 AM
Re: favorite sysadmin scripts you always keep around (3)
I have the following script which seems to give me what I need.
echo "PID USER CPU% MEM_SIZE COMMAND"
while true
do
UNIX95= ps -eo "pid ruser pcpu vsz=Kbytes" -o comm | grep oracleT5751
sleep 1
done
It returns something like this...
8532 ormesa 0.02 32832 oracleT5751
536 ormesa 0.02 32832 oracleT5751
524 ormesa 0.02 32832 oracleT5751
22005 ormesa 0.02 32832 oracleT5751
8536 ormesa 0.02 40128 oracleT5751
I need to graph this in excel to show the memory / cpu consumed by each pid. I'm a little confused on how to setup the graph? any ideas...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2003 06:43 AM
тАО06-27-2003 06:43 AM
Re: favorite sysadmin scripts you always keep around (3)
several examples can be found in the graph scripts included in the Statistics on https://www.beepz.com/personal/merijn/#Statistics or http://www.cmve.net/~merijn/#Statistics
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2003 11:50 AM
тАО06-27-2003 11:50 AM
Re: favorite sysadmin scripts you always keep around (3)
It uses secure shell to ll the /etc/hosts directory on each remote system. If the directory listing is successful, it assumes that the system is up and running. If not, it advises to "Update your resume'". It emails the results. We run this every day at 8 AM, so that we have no surprises at the 9 AM meeting.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2003 12:17 AM
тАО06-28-2003 12:17 AM
Re: favorite sysadmin scripts you always keep around (3)
Here is my backup script,which is invoked by cron every night.
She will check the tape first, if type is not ready, she send a mail to a certain mailbox. When this mailbox receive this special mail, it will send a message to the adminiatrator by mobile phone.
After backup, it will truncate some log files of the DB, and make a total report and send it to the administrator.
This keep the backup always done correctly!!!
-ux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2003 08:45 AM
тАО07-22-2003 08:45 AM
Re: favorite sysadmin scripts you always keep around (3)
There's been numerous times I've wanted to know which corresponding chmod command was needed to securing files and directories. Here's a script that I've created awhile back that others may want to have. Very useful for determining the chmod integer combinations. It lists the 4 digit code, security string, object type, owner:group, and filename. It has saved my rear-end multiple times and I call it from other scripts for when I may need to reset the security properties for a file or directory.
Here's an example of running the script...
# getchmod /etc/inetd.conf
0644 -rw-r--r-- file root:sys /etc/inetd.conf
And yes, it will use wildcards...
I've named the script getchmod....
jack...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2003 09:53 AM
тАО07-22-2003 09:53 AM
Re: favorite sysadmin scripts you always keep around (3)
It has a parent script, T-REX, that I'll attach if anyone is interested. This script uses secure copy to deploy diskasaurus to machines listed in a text file. It then executes it and captures its output into a larger .csv file, and does some interesting subtotals and totals of the data. The first script runs by itself nicely, but with T-REX it becomes a powerful tool to analyze multiple systems simoultaneously.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-24-2003 07:15 AM
тАО07-24-2003 07:15 AM
Re: favorite sysadmin scripts you always keep around (3)
Well suffer no longer.
restart
Let me know if the name causes problems, it is tested.
usage:
restart
It requires root $LOGNAME
It requires a single parameter
It saves me typing.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-25-2003 12:00 AM
тАО07-25-2003 12:00 AM
Re: favorite sysadmin scripts you always keep around (3)
select p.spid from v$process p, v$session s, v$mystat m
where m.sid=s.sid and s.paddr=p.addr and rownum=1;
This is used to extract the pid of the session you are connected to.
Usefull because when you generate a user_trace (like in alter database backup controlfile to trace) the output goes to user_dump_dest/ora_
I always hate to list the content and look for my file, guessing...
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2003 06:18 PM
тАО07-27-2003 06:18 PM
Re: favorite sysadmin scripts you always keep around (3)
In Linux you can stop, start and restart services with a single command.
service
service httpd restart
restarts the httpd daemon(web server)
Its nice.
As far as I know, no equivalent exists in HP-UX.
Until now.
It works just the same, taking three valid actions. It may be a bit verbose, but you can play with it to your hearts content.
attaching service.
This has been tested in all three valid modes.
If the script does not exist in /sbin/init.d/ it tells you.
WARNING: This script will not protect you from your own stupidity. If you use it to halt a critical service like NFS or the network, your system will lock up good and hard. Use at your own risk. Example: This script did not protect me from my own stupidity when I let it loose on Samba while a file transfer was going on. It is not smart enough to know if its a good idea to start/stop or restart the service, it relies on you for that part.
WARNING 2: There are probably some services that can't be stopped and started while the system is running. Once again, this script is only as smart as the person using. It does however ease the transition from Linux to HP-UX.
I'm thinking about doing chkcfg(chkconfig?) next. It actually sets up servcies to run which makes it a little harder to port.
Enjoy.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2003 06:34 PM
тАО07-27-2003 06:34 PM
Re: favorite sysadmin scripts you always keep around (3)
Reason is I promised this pup months ago.
Its a really minor modification of a slick script given to me by Jordon Bean in response to an itrc post to port my Linux buildmail script.
What this script does is it builds the sendmail databases for alisees, access (spam stopper), and such things so you can use your HP-UX box to run an NSP.
I don't know how many people actually do that, but I'm in a jam right now.
My production Linux Server is running 7.3 Red Hat. It is having hardware problems. It only booted correctly six out of the last seven times. It hung on the memory check a few hours ago, after I loused up the named database.
A few weeks ago, its built in video card took a dump. The good news is it came back and the server wasn't down for more than 10 minutes.
What I need to do is take production offline, put in a reliable add in video card, put the two hard disks on different IDE channels and rebuild the box.
Normally I'd just switch to the backup Linux box. Its been upgraded to Red Hat 9 and none of my sendmail stuff works with sendmail 8.12.
So The old D320, my learning box may be pressed into a few days of service to save my tush.
DNS, httpd(apache 2 no less) works. sendmail has to work to give me the time I need to fix the Dell Linux box.
That was long winded. Here is the script. The script itself works. The sendmail functionaility it creates, databases and such is still being tested furious as I type.
Not surprisingly I was able to bring over all my virtusertable, genericstable, tab delimited databases without modification.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com