Send myself a snapshot of the server load ?

  • Is it possible to end myself an email say hourly with my server's

    top stats, uptime, and cpu and memory load ?

    how would one do that ?


  • What command do I use to chmode it to 700? I've always used ftp for this purpose.


  • got the solution i put the following in a file and name it mymailstat in the root of my server
    #!/usr/bin/perl

    $uptimeoutput = `/usr/bin/uptime`;
    $topoutput = `/usr/bin/top -b -n1`;

    open (MAIL,"/usr/sbin/sendmail -t");
    print MAIL "From: email@mydomain.comn";
    print MAIL "To: email@mydomain.comn";
    print MAIL "Subject: Server Statsnn";
    print MAIL "$uptimeoutputn";
    print MAIL "$topoutputnn";
    close (MAIL);


    then chmod it to 700

    then create a cronfile named mycronfile

    and put in it

    0 * * * * /mymailstat

    in telnet as root

    crontab mycronfile

    and it all works nicely :D


  • Nice one :)

    You might wanna add that to your signature-list ;)


  • http://www.linuxnewbie.org

    for your linux newbie needs? :D


  • cronfile is just another file like mymailstat with a different name

    so you

    pico cronfile

    and put in the file

    0 * * * * /mymailstat





    then you issue the command


    crontab cronfile to start the timer


  • this is nice however... MRTG is your friend... :)

    http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/


  • Originally posted by Mas*Mind
    Nice one :)

    You might wanna add that to your signature-list ;) done LOL :)


  • I would like to clarify something:

    Is this how I do it:

    log in as a super user by entering:

    su -

    so that I get into root. After that, I'm supposed to create a file called mymailstat, so I

    pico mymailstat

    but what do you mean by

    then create a cronfile named mycronfile

    and put in it

    0 * * * * /mymailstat

    in telnet as root

    crontab mycronfile


  • Originally posted by theprof
    What command do I use to chmode it to 700? I've always used ftp for this purpose.

    chmod 700 cronfile







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Send myself a snapshot of the server load ? , Please add it free.