- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- shell scripts email unix server memory utilization
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
12-20-2006 08:41 PM
12-20-2006 08:41 PM
I need to send the Server Memory Utiliztion (%) statistics.We have HP Unix Server. Glance installed.
Can we have shell script which will get the above statistics and send a mail.
thanks,
Avinash
a2avin@gmail.com
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2006 08:49 PM
12-20-2006 08:49 PM
Re: shell scripts email unix server memory utilization
Just choose one , which is best for you and add crontab entry for that script to mail results.
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2006 08:52 PM
12-20-2006 08:52 PM
Re: shell scripts email unix server memory utilization
But is there any way we can mail across..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2006 09:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2006 10:27 PM
12-20-2006 10:27 PM
Re: shell scripts email unix server memory utilization
once you have collected the desired information, you can forward it using the mail facility. e.g.
/usr/bin/uuencode $logfile "ServerMemUtil.txt"|mailx -m -s "`hostname`-Server Memory utilisation - `date`" $emailadd1
where $emailadd1=
$logfile=
hope this helps too!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2006 11:52 PM
12-20-2006 11:52 PM
Re: shell scripts email unix server memory utilization
You only need to run glance in advisor only mode.And mailx the output,
Attached the script cpumem.sh and cpumem.syn for this purpose.
Enjoy and Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2006 11:55 PM
12-20-2006 11:55 PM
Re: shell scripts email unix server memory utilization
After generating the report you can get automated email by just putting a small script in the cron , with
# uuencode logfile.txt logfile.txt | mailx -s "Server-x cpu and memory usage report for `date ` " youremail@domain.com
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2006 12:05 AM
12-21-2006 12:05 AM
Re: shell scripts email unix server memory utilization
/usr/sbin/swapinfo | grep memory | awk '{print $5}' | mailx -s "Memory Utilization from host xyz" yourid@yourdomain.com
Create above script with execute permission and update crontab.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2006 12:24 AM
12-21-2006 12:24 AM
Re: shell scripts email unix server memory utilization
Btw, which memory utilization are you looking for , Physical memory or Virtual Memory utilization ?
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2006 02:18 AM
12-21-2006 02:18 AM
Re: shell scripts email unix server memory utilization
$ /usr/local/bin/memdetail
Memory Stat total used avail %used
physical 10080.0 8445.1 1634.9 84%
active virtual 7313.6 1179.7 6133.9 16%
active real 5818.8 569.8 5248.9 10%
memory swap 7707.8 1715.5 5992.2 22%
device swap 28080.0 6852.3 21227.7 24%
Just use the native HPUX compiler to compile the attached.
Then you can run it from cron say every hour?
/usr/local/bin/memdetail | mailx -s "memdetail `/usr/bin/date`" you@yourdomain.com
Rgds...Geoff