- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to get email in excel format or macro?
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
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
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
тАО11-06-2006 07:02 PM
тАО11-06-2006 07:02 PM
I am using one scripts for the cpu / memory logs of last 24 hours using glance utility.
1. vi cpumem.sh
cd /opt/cpu_mem/cpumem_logs
touch cpumem.log
echo "CPU & Memory Utilization logs for last 24 Hours of Server " >> cpumem.log
echo "" >> cpumem.log
echo "----------------------------------------------------------------------------------" >> cpumem.log
echo " Date: Time: (%)CPU Used: (%)Memory Used: " >> cpumem.log
echo "----------------------------------------------------------------------------------" >> cpumem.log
cd /opt/cpu_mem/cpumem_logs
/opt/perf/bin/glance -adviser_only -j 600 -iterations 144 -syntax /opt/cpu_mem/cpumem.syn >> cpumem.log
echo " " >> cpumem.log
echo "----------------------------------------------------------------------------------" >> cpumem.log
echo "Monitoring of CPU and Memory done at `date` . " >> cpumem.log
echo "UPTIME= `uptime ` " >> cpumem.log
echo "----------------------------------------------------------------------------------" >> cpumem.log
mv cpumem.log cpumem.`date +%m%d%y`.log
cat /opt/cpu_mem/cpumem_logs/cpumem.`date +%m%d%y`.log | mailx -s "CPU/Mem logs" praveen@company.com
2. #vi cpumem.syn
print gbl_statdate, " ", gbl_stattime, " ", gbl_cpu_total_util, " ", gbl_mem_util
this mail is text formatted,
at present, output of this script is like....
CPU & Memory Utilization logs for last 24 Hours of Server
----------------------------------------------------------------------------------
Date: Time: (%)CPU Used: (%)Memory Used:
----------------------------------------------------------------------------------
08/20/2006 00:00:04 2.2 28.8
08/20/2006 00:10:04 4.9 28.8
08/20/2006 00:20:04 4.5 28.8
08/20/2006 00:30:04 4.7 28.8
08/20/2006 00:40:04 5.5 28.8
08/20/2006 00:50:04 5.7 28.8
08/20/2006 01:00:04 6.1 28.8
08/20/2006 01:10:04 6.1 28.8
08/20/2006 01:20:04 5.4 28.8
08/20/2006 01:30:04 5.4 28.8
08/20/2006 01:40:04 8.4 28.8
08/20/2006 01:50:04 8.4 28.8
:::::::::::::::::::::::::
:::::::::::::::::::::::::
:::::::::::::::::::::::::........
can i get all the logs in excel format , if yes, please help me ......
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2006 07:10 PM
тАО11-06-2006 07:10 PM
Re: how to get email in excel format or macro?
excel uses an internal format for full spreadsheets. The closest to 'excel format' in your case is probably CSV.
Write the output of your glance command to a temporary file and substitute spaces with commas (See "man tr"). You can then use this new file to load into excel, as long as it has a .csv filename extension.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2006 11:08 PM
тАО11-06-2006 11:08 PM
Re: how to get email in excel format or macro?
# tr -cs test.log test.csv
But could not get the desired output
Please suggest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2006 11:26 PM
тАО11-06-2006 11:26 PM
Re: how to get email in excel format or macro?
excel will import ascii files with appropiate field delimters.
I put say | between every field, make sure the columns balance and when it hits excel import it comes out reasonable.
If you trust it, excel can be programmed to ssh onto the system and run the reports and capture the output.
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
тАО11-06-2006 11:43 PM
тАО11-06-2006 11:43 PM
Re: how to get email in excel format or macro?
# cat c
08/20/2006 00:00:04 2.2 28.8
08/20/2006 00:10:04 4.9 28.8
08/20/2006 00:20:04 4.5 28.8
08/20/2006 00:30:04 4.7 28.8
08/20/2006 00:40:04 5.5 28.8
# tr " " "," < c > d.csv
# cat d.csv
08/20/2006,00:00:04,2.2,28.8
08/20/2006,00:10:04,4.9,28.8
08/20/2006,00:20:04,4.5,28.8
08/20/2006,00:30:04,4.7,28.8
08/20/2006,00:40:04,5.5,28.8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2006 08:12 PM
тАО11-07-2006 08:12 PM
Solution1. check in your Xcel setup what's the separtor. Usually it should be ;
2. chnage the script cpumem.syn so:
print gbl_statdate, " ", gbl_stattime, ";", gbl_cpu_total_util, ";", gbl_mem_util
to obtain:
08/20/2006 00:00:04;2.2;28.8
3. change name of teh log file from .log to .csv
4. remove the comment header or change from:
----------------------------------------------------------------------------------
Date: Time: (%)CPU Used: (%)Memory Used:
----------------------------------------------------------------------------------
to:
Date;(%)CPU Used; (%)Memory Used
That's all.
N.B> Take care to use the same separtor defined in Xcell. In my example is ';'.
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-08-2006 11:15 PM
тАО11-08-2006 11:15 PM
Re: how to get email in excel format or macro?
Thanks for your help