Monitor CPU and send output to file

Hello
I want to monitor my CPU usage and my idea was this:
1. Use Top (/usr/bin/top –n 1|head –n 3| tail –n 1|awk ’{print $2}’)
2. Send output to file
3. crontab it
My problem is now that my top command (see above) works fine in terminal, it will give me a short and clean answer; 10.5%
But when sending this to a file the output looks more like: 10.5%^^8fewfwe[]€]]@£]@£[f9@£[]^^E^Efewfwef23 (Yes i just hit my keyboard but its alot of randoms characters)
How can i fix this?
Do you have any easier solution to monitor my CPU usage, i want it to be quite often, send cpu usage to file for at least every minute, then i can import this to excel and make nice diagram.
I dont want to install any extra program so ill have to work with whats there already. Im using RHEL 4.
Thanks in advance, Johan

A better way to do it is using "sar"
man sarIt's already builtin and there are plenty of docs on the net.
kido

Similar Messages

  • How to calculate averages and send to a file?(source code)

    Having trouble the book isn't very clear on how to use averages.............could some give me an example of a program..................that gets averages and send to a file..........?

    From Deitel and Deitels monster 'How to Program' :
    import javax.swing.JOptionPane;
    public class Average {
    public static void main ( String args[] )
    int total, gradeCounter, gradeValue, average;
    Swing grade;
    total = 0;
    gradeCounter = 1;
    while ( gradeCounter <= 10 ) {      //assuming 10 values
    grade = JOption.showInputDialog ( "Enter grade: " ) ;
    gradeValue = Integer.parseInt ( grade );
    total += gradeValue;
    gradeCounter = gradeCounter + 1;
    average = total / 10;
    JOptionPane.showMessageDialog (
    null, "Class Average is" + average, "Class Average",
    JOptionPane.INFORMATIOIN_MESSAGE );
    System.exit ( 0 );
    Import package java.io
    Three stream objects are created when you execute , System.in, System.out, System.err
    System.out can be directed to send it's output to a file or disk.

  • How to calculates averages and send to a file?(source code)

    how to calculates averages and send to a file?(source code) I need to get started but I don't know where to begin...........the book I have doesn't really say how to handle averages and send to a file.................anybody got suggestions on how to get started? I am a newbie so place in layman's terms.............thanx

    To calculate an average: add all of the numbers together and divide by how many numbers you added together.
    ex: (1 + 2 + 3 + 10)/4 = 4 (4 is the average)
    As for writing them to a file, look over the API for random or sequential access files.

  • Monitor database and CPU and send events

    Hi.
    I would like to monitor the Oracle instance and the CPU and when something happens I want to send an event(e-mail or SMS). Is this possible using Oracle Enterprise Manager alone? Or do I need a third-party product like "Big brother"(http://www.bb4.com/). I have generated an event in OEM but I can't see where I am supposed to handle the event that it generates.
    /Christer Nordvik

    works perfectly,
    CPUID 0x10676
    Revision C0
    Mobil Intel Core 2 Duo T9400 Penryn
    1592mhz (265.33 x 6.0) <--- this is actually really exciting cause it shows that powerstepping is now functioning in windows.
    Socket 478
    CPU temps wile posting this in windows xp
    CPU #0
    Core #0 - 69*C
    Core #1 - 66*C
    This software uses the new temperature probe on newer cpu's not the older messed up thermal diode on P4D's and earlier.

  • SAP BW data in ODS to XML and sending this XML file to 3rd Party

    Hi Gurus,
    We are having a scenario in which we have to convert our data in ODS to XML and need to provide this XML file to our clients so that they can use this XML file in their 3rd party system.
    Now the issue is that i have created ABAP program for converting into XML.
    If I execute this program, since i have given path as my Desktop, the converted XML file gets saved on my Desktop.
    But the problem is how i can provide this XML file to the client.
    Is there any way of converting this XML file to html and send them the URL ......
    plz suggest me.... what can be done......
    my ABAP code u can see in the following link
    Extract SAP BW Data into XML
    thanks and regards,
    P.Madhusudhan Raju

    Hi,
    Pls go through the link below it may help you
    http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417100)ID1537206350DB01670597797729934632End?rid=/library/uuid/8c10aa90-0201-0010-98a0-f071394bc9ae&overridelayout=true
    Regards,
    Marasa.

  • Is there a VI to monitor CPU and memory usage on wINDOWS 2000 system ?

    I want to monitor CPU usage and available memory for Windows 2000 computer. Is there a VI that can call the task mngr. via a DLL to provide this information in real time ?

    There was a nice example using .NET technology, but it seems the link has changed and I cannot find it anymore. See this older thread for some clues.
    Does anyone know what happened to the target of the original link in my old post?
    Edit: Found it here.Message Edited by altenbach on 04-29-2005 12:42 PM
    LabVIEW Champion . Do more with less code and in less time .

  • Generate and send Excel format file by mail in bakground.

    Hi fellows, i have a requirement, which is to generate an excel file in background and send it attached by e-mail. This file have many characteristics like Freeze pane, Auto filters, and some other format characteristics, One of the ways for achieving this kind of characteristics is using OLE or Desktop Office Integration, but both run in foreground. Other way i found is formatting the excel using XML and then at the moment of sending it by mail, changing extension for xls, but the problem is that it occupies too much space, i imagine cause it is raw xml, for example for a file for 1,000 records and 14 columns generates a file of 1.6Mb which is not like generating the same file using OLE or DOI (24Kb).
    I would like to know if there is a way to use an excel component or another way that takes less space for generating the file with format and also send it by e-mail in background??
    Thanks.
    Noe.

    is 1.6 MB the smallest size you can generate, did you remove every optional tag?
    XLSX format is a compressed XML format valid since office 2007. Maybe you can try to generate it? (I don't exactly know which ZIP algorithm it requires, SAP can compress using the ZLIB Compression Library)
    You may also attach a Windows server to SAP via RFC. You should create an RFC server. You may have a look at this [sdn article - Communication to Presentation Server in Background Mode|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2] for some clues about running an RFC server. I guess you could use a VB script on the server.
    For sending emails, this is a separate question, you may have a look at wiki: sending mails - home page.

  • Script to monitor database and send email alerts

    Dear Gurus,
    We have databases running on WIN2000 server. Can anyone provide me with a script (VBScript) or a batch file script which can check the database status and send an email alert depending upon the status of the database. Thanks in advance for the help!!

    Hi,
    I don't think this is the right forum for this.
    The Oracle Scheduler can certainly schedule such a script to run regularly but the issue of creating such a script is more to do with general database maintenance. It seems as though a web search should reveal some similar scripts that can be used as a base.
    Thanks,
    Ravi.

  • Attaching and sending a pdf file to hr admin through workflow

    Dear all,
             I am new to workflows and working on time management module in HR .I have to work on an leave request issue where in ESS the employee should  'attach the medical certificate' if the sick leave is more than 2 days.
            The workflow is already been created but the one thing i need to work on is attaching the medical certificate and send it to the Hr admin.
            I am checking for the condition whether it is sick leave or/not then sending the mail to hr admin to approve.
            In the mail the object type that i have declared is selfitem and the method is  SENDTASKDESCRIPTION .
            The object type given as SOFM in the resulttype tab in the above method .
           How to attach?And in what way the file can be attached?
          Kindly send me the solution in steps.
           please do the needful.
    Regards,
    bhavani

    Hi Karri
    Thanks for the input regarding the newer version. I'll work on it.
    Yes, I am using the SAp_WAPIATTACHMENTADD to attach the PDF into an workitem, through a custom BO method i have created for the requirement.
    But issue is with  how to attach a PDF to the workflow at the instance of WF trigger, so that i can pass it on to the WI through the BO method.
    Regards
    /Arun

  • How do I create and send a zip file? I have Lion and I'm working in Word for mac

    To show you how little I know about any of this, I don't even know if this is the correct forum in which to ask this question. I'm a copywriter. I have a client in France. I have 15 word documents, 15 of the same documents in PDFs and a small Excel document to send him. Simple, mutlipage Word docs. Short two-page Excell sheet. I want to create a zip file for them to send to him. Can I do it? How? I have unzipped zip files other people have sent to me, but I've never created or sent one myself. I'm working in Word for Mac 2011. I have Lion. I'm using Mac's email. Please don't assume I know anything. I need very, very simple, play by play instructions. You are all very helpful, so I have high hopes.
    Nancy

    Visit:
    http://download.cnet.com/MacZip/3000-2250_4-10025248.html
    You will be able to both zip and unzip. If the recipient of your zipped file does not have zip, he/she will need to get it, or you could send him/her the above address so that he/she can unzip his/her file.
    (I wish the English language could settle on the use of something less clumsy that he/she him/her etc.)
    BTW, I think that you can zip only folders, not separate files, so put even one file into a folder before zipping).
    Message was edited by: SteveKir Added BTW

  • How to create a service to UPLOAD / DOWNLOAD and send emails with files?

    Good afternoon!
    I need to create a service that sends files via email or FTP, and a service to upload / download files on a server.
    I see on the internet does not have much aid to make it in the ADF.
    Could someone send me some links, documentation, so I can get the job done?
    Thank you,
    Lewis.

    "I see on the internet does not have much aid to make it in the ADF."  - You are kidding - do you?!
    1) Google: ADF Faces file upload
    2) Google: ADF Faces image download
    3) Google: ADF send mail
    I get all the relevant hits (documentation and blog entries) by using these 3 queries in Google.
    If you mean "Web Service" by "Service" then better - just Google for Web Service and image handling to find information on this. You don't use ADF to build Web Services, which is why you need to express your search criteria different
    Frank

  • Software to Monitor CPU and Fans

    I have an MSI 785G-E53 with a Phenom II x2 (with all 4 cores unlocked).
    What program can I use to monitor the CPU core temps, fans, maybe even the hard drives too?
    I tried both speedfan and coretemp and neither looked like they pulled the CPU core temps, but maybe I was doing something wrong.
    Should those work?  Is there a better utility to use?

    Quote from: lexluthor on 11-December-10, 21:18:02
    Is that because I have the cores enabled?  Are you saying that if I didn't do the core unlock, those apps would work?  There's something about unlocking the cores that's "breaking" those apps?
    Yep, exactly that. I had the same thing when I unlocked my Athlon II X3 440. I don't know what it is exactly but unlocking the cores stops the sensor from picking up the core temps.

  • Monitoring JMS and Sending Alerts

    I am currently using OEM 10.2.0.5 to monitor an Oracle Service Bus (OSB) instance. That OSB instance contains a JMS Server, which is used to receive JMS messages at various queues. I would like to be able to monitor the message input on these queues. For example, I would like to know if I don't receive any messages over a certain period of time.
    In the OEM admin console, I select the Oracle WebLogic Managed Server, then I select "Metrics and Policy Settings". I don't see any options to set threshold values for anything JMS related. However, if I select "All Metics", I see JMS Server related metrics, but they don't have threshold levels set.
    How do I set threshold values for JMS related metrics so I can send alerts?
    -TJ

    Am in the same boat man. Using WebLogic 10.1.
    What I found from Oracle was that JMS metrics are NON-THRESHOLDABLE. I was like...what the **#@$$ ?!?!
    What is the point in collecting so much metrics data when you cannot put thresholds on them and map them to notification rules.
    For management & monitoring of middleware components like WebLogic, OSB/ALSB, ALDSP,etc EM 10g sucks man.
    Cheers-
    Amit

  • Schedule ME2L in background and send output to email address

    Hi,
    Our Client has a requirement to schedule ME2L (particular variant) in background.
    The report should run every day in background and output should get emailed to particular email address.
    Any ideas??? Pleae let me know.

    Thanks for the information. Very useful.
    I am just facing one road block at the moment.
    I am now able to schedule the ME2L Report and email it as attachment.
    But, we have created a particular layout for this report, which we want should get emailed.
    But when we schedule the report in the background (or run it in background manually), it only picks the standard layout!
    I cannot find any layout option in ME2L Selection Screen as well. (I could have saved it in the variant then)
    Can you help?

  • Crate XML file and send that XML file from R3 to SIBEL

    Hi Friends,
              Is SAP provided any idoc type and Message type for Goods Receipt (MIGO)??
    My requirement is to create XML file having 4 fields from MIGO then that XML file to be display in SIBEL system. Can anybody help me how can I do this.

    Hi Mohanty,
    hope it can help you.
    http://www.sapfans.com/sapfans/forum/intface/messages/4062.html
    Try cl_xml_document class, and also look at cl_ixml class factory.
    Regards,
    David

Maybe you are looking for