Questions tagged [uptime]

82 questions
69
votes
7 answers

How long has my Linux system been running?

Is there a command I can type in a terminal that will tell me the last time a machine was rebooted?
Octopus
  • 2,489
  • 6
  • 21
  • 25
57
votes
3 answers

On Linux, when does "uptime" start counting from?

My computer says: $ uptime 10:20:35 up 1:46, 3 users, load average: 0,03, 0,10, 0,13 And if I check last I see: reboot system boot 3.19.0-51-generi Tue Apr 12 08:34 - 10:20 (01:45) And then I check: $ ls -l /var/log/boot.log…
fedorqui
  • 7,603
  • 7
  • 35
  • 71
22
votes
4 answers

Bash script to detect when my server is down or offline

Background : I need to receive an alert when my server is down. When the server is down, maybe the Sysload collector will not be able to send any alert. To receive an alert when the server is down, I have an external source (server) to detect it.…
Md Mahbubur Rahman
  • 837
  • 4
  • 9
  • 21
19
votes
4 answers

Why/how does "uptime" show CPU load >1?

I have a 1 core CPU installed on my PC. Sometimes, uptime shows load >1. How is this possible and what does this mean? EDIT: The values go up to 2.4
Frantisek
  • 415
  • 2
  • 5
  • 12
18
votes
4 answers

How to reliably get timestamp at which the system booted?

I'm aware of the uptime command, but it returns seconds since booted, so if I just substract that number from current timestamp, in theory I can get a different result if second changes after I've read the uptime and current timestamp. uptime -s is…
Fluffy
  • 2,047
  • 3
  • 15
  • 18
12
votes
5 answers

Convert linux sysuptime to well format date

I want to display /proc/uptime in well format as: DD:HH:MM:SS /proc/uptime give me up time of system in seconds, is there a standard solution that convert seconds to this format?
Navid Farhadi
  • 411
  • 1
  • 7
  • 13
10
votes
3 answers

How to know why server keeps restarting?

It seems that my server keeps restarting. I want to know why. How can I know when the last time server was rebooted and why? root pts/0 139.193.156.125 Thu Aug 8 21:10 still logged in reboot system boot 2.6.32-358.11.1. Thu Aug 8…
user4951
  • 10,329
  • 28
  • 71
  • 92
9
votes
2 answers

High load average: Which processes are waiting in the queue?

I have an Ubuntu server running Redis, which suffers from a high load problem. Forensics Uptime # uptime 05:43:53 up 19 min, 1 user, load average: 2.96, 2.07, 1.52 sar # sar -q 05:24:00 AM LINUX RESTART 05:25:01 AM runq-sz plist-sz …
Adam Matan
  • 2,543
  • 6
  • 29
  • 31
9
votes
3 answers

How can I display uptime with sleep-mode time excluded?

I put my laptop to suspend mode, woke it up later, and now it shows uptime some 23 hours (with uptime), which is obviously not true. I suspect uptime simply returns the difference between the timestamp at boot and now. Is there a way to show uptime…
MightyPork
  • 1,222
  • 11
  • 21
8
votes
2 answers

Where can I find the source code for `uptime`?

I am learning Python. Till now I've been doing only basic Python coding. A day ago, I checked python implementation of tree command. Suddenly I thought of creating a Python clone for uptime. I don't have any clue about which language it is…
Dharmit
  • 4,220
  • 7
  • 28
  • 37
8
votes
1 answer

The amount of time since the system was last booted

I have used both uptime and cat /proc/uptime commands. I know the idle time in the later can be greater than running time (multiprocessors). However, when I add both running and idle times, and compare it to the uptime (5:30 hrs) they are not equal.…
Atieh
  • 223
  • 1
  • 3
  • 8
7
votes
2 answers

Total runtime of machine

Is there any way to read total running time of a linux system from BIOS or CPU? I've searched BIOS informations by dmidecode. But it gives release date which is not proper for my question. Then I've checked out /proc. But it holds uptime values just…
cumbaba
  • 73
  • 1
  • 4
6
votes
6 answers

Finding PC uptime from first day until now

I need to find PC uptime from the day of installation until now. Is this logged somewhere? Does any file log this cumulative uptime?
Chalist
  • 417
  • 4
  • 14
6
votes
5 answers

How to get a process uptime under different OS?

Under Linux I can get a process's uptime in seconds with: echo $(($(cut -d "." -f1 /proc/uptime) - $(($(cut -d " " -f22 /proc/$PID/stat)/100)))) But how can I get it under different OS? ex.: SunOS, HP-UX, AIX?
LanceBaynes
  • 39,295
  • 97
  • 250
  • 349
6
votes
2 answers

How to print kernel time from command line?

How can I convert the uptime output to seconds since epoch to compare with dmesg output? Does uptime have the same resolution as the kernel message time? Is there a way to more directly get the kernel time than from uptime? ➜ ~ echo "hi" >…
tarabyte
  • 4,166
  • 10
  • 36
  • 48
1
2 3 4 5 6