Uptime for a Redhat Linux based OS?

Posted on 2008-11-10
Last Modified: 2013-12-06
Is there a way that you can find the Up-time for a Redhat linux based OS? I'm actually trying to find that for VMWare ESX server which is based on redhat (Service Console)
Question by:datacomsmt
    LVL 14

    Accepted Solution

    uptime command give u that information
    on the command console type


    Open in new window


    Author Comment

    it looks like "uptime" as a command has no switchs with it, the man pages say

           uptime - Tell how long the system has been running.

           uptime [-V]

           uptime gives a one line display of the following information.  The cur-
           rent time, how long the system has been running,  how  many  users  are
           currently  logged  on,  and the system load averages for the past 1, 5,
           and 15 minutes.

           This is the same information contained in the header line displayed  by

           /var/run/utmp  information about who is currently logged on
           /proc     process information

    when I tried running just "uptime", it gave me the total uptime since the last reboot (see below), I'm looking for uptime since a specific number of days.

    16:12:15  up 17 days, 20:10,  1 user,  load average: 0.00, 0.00, 0.00
    LVL 14

    Expert Comment

    by:Deepak Kosaraju
    I have no Idea what other commands you have in linux for your requirement, except this uptime to know system uptime since last reboot.
    LVL 13

    Expert Comment

    To achieve what you want to do would require a script to use something like date to do the conversion.  The command uptime displays exactly what it should, the uptime since the server / node was booted.

    If you can explain with an example what you are looking for I can assist with writing the script for you.

    Author Comment


    what I exactly need is the total uptime in the last 30 days regardless of how many times the server was rebooted.
    i need to run this script once a month so that it gives me the uptime in the previous 30 days.

    LVL 13

    Assisted Solution

    In that case, there isn't a "command" that can be ran on Linux to provide this for you.  You will need to look at something like Nagios which has historical reporting.  You would be able to group between servers, individual servers or even ever server showing their uptime for the past day, 7 days, 30 days, 3 months or custom reporting. - Simply add all of your hosts and it will automatically monitor their uptime.  Turn off reporting and you will be ready to start "logging" for lack of a better word the uptime of these servers.

    This won't work exactly as needed if the monitoring server goes offline for any reason so I would suggest a UPS to help you through.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    Syslog limitations in vmware 4 101
    HTTPS Redirect Problem 17 57
    Elementary OS - Updates failed 3 315
    error I/O in copying in linux redhat 12 52
    In order for businesses to be compliant with certain information security laws in some countries, you need to be able to prove that a user (which user it was becomes important to the business to take action against the user after an event has occurr…
    The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now