Questions tagged [uptime]
The uptime tag has no usage guidance.
82
questions
1
vote
1
answer
116
views
Get total time system has been used today - in minutes
I want to set a daily limit as to how long my computer can be on in a single day. In order to do so, I'm writing a cron script that will take appropriate action when certain milestones are reached (...
0
votes
1
answer
124
views
MT9721K wireless adapter Drivers randomly stop working on debian and ubuntu based systems
After a certain amount of uptime, the OS is irreversably unable to detect the wireless adapter (MT7921K in this case). I previously "fixed" this by restoring the original Windows 11 install ...
0
votes
6
answers
345
views
System uptime without ssh login
I have many linux servers which I would like to check uptime but I have to login to every one. Is this possible to check linux server running time without ssh login to it?
PS. My distributions are ...
1
vote
1
answer
603
views
Convert string time to seconds
I'm receiving an uptime in this format:
167h58m10.586582048s
I want to transform it to seconds and discard the fraction part.
I know awk could do that if only the received string had the same ...
0
votes
0
answers
67
views
What is the most efficient way to run a task every X hours of runtime, accumulated over all power-ons?
Let us assume that I have a machine which wakes up at 7:00, does some work, usually for 15 minutes, but sometimes for days (e.g., experiment supervision), and after the works is done, it powers ...
2
votes
2
answers
385
views
Format the output of "read_file uptime" in i3status
I'm trying to display my system uptime with i3status. This is what I have in my i3status.conf file:
read_file uptime {
format = "%title: %content"
path = "/proc/uptime"
}
...
1
vote
1
answer
433
views
Is it possible to detect that an impending shutdown (or reboot) is in progress?
I'm trying to write a script in bash that I intend to start on system startup and end on system shutdown. The idea is to create a system uptime tracker for myself.
For the purpose, I want to save the ...
3
votes
1
answer
2k
views
last reboot and who -b shows different results?
I am using the following 3 commands to check the latest time point when my computer is rebooted:
last reboot
who -b
uptime
The result for last reboot is:
wtmp begins Sat Oct 9 04:49:27 2021
The ...
3
votes
1
answer
564
views
Why jiffies/HZ does not match uptime?
System uptime is stored in /proc/uptime.
As you know, the Linux kernel has a jiffies variable which increments by each timer interrupt specified by the HZ parameter. I got the value ofHZ by the ...
0
votes
5
answers
2k
views
How to check if uptime is greater than 72h?
I need to create a script that will execute daily (cron job), calculate the uptime of the system, and if that number is greater than 72 hours, reboot the system.
I am getting lost in converting the ...
0
votes
3
answers
62
views
Unable to get the nth column data due to changing output of uptime command
Below is the output of uptime from Solaris where I am extracting the third last column:
uptime
8:30pm up 23 day(s), 17:46, 5 users, load average: **2.79**, 1.79, 1.53
I always need to get the ...
1
vote
0
answers
85
views
machine uptime is not consistent with last command
we have 3 rhel servers version 7.6 ( part of cluster with 8 machines )
on rhel server 1 machine uptime is
uptime
10:25:51 up 23:48, 1 user, load average: 0.02, 0.09, 0.13
on rhel server 2 machine ...
1
vote
1
answer
189
views
Uptime information updated in the command prompt
I want to put the uptime command information into the command prompt and have it updated every 750ms (regardless of whether I'm typing at the prompt or not).
I usually use bash but I've used zsh too, ...
0
votes
1
answer
1k
views
Get system uptime with better precision then seconds
My system is running Linux for embedded.
At the moment I didn't sync the system clock or gave the user an option to do it but it's going to change.
Different parts in my application are using ...
2
votes
0
answers
241
views
Understanding load average on Digital Ocean droplets
I apologize for this being a stupid question. I spend most of my time on stackoverflow and feel like a fish out of water over here.
I have a standard Digital Ocean droplet, paying $5 a month, and ...
0
votes
1
answer
314
views
Trying to calculate uptime and email if greater than a number of days
I need to create a script that will execute daily (cron job), calculate the uptime of the system (days only), and if that number is greater than a defined value (e.g. 30), email the system's ...
0
votes
1
answer
157
views
System Uptime of last boot
If system shutdown abruptly. Then will it be possible to tell at what time it was shut ?
Abruptly means due to power failure or due to sysrq magic keys.
If I am logging something every few seconds ...
0
votes
2
answers
2k
views
How to get server uptime of AIX server results in seconds
In Linux, I can get the server uptime results in seconds (value) by using below command
cat /proc/uptime
But in AIX, we do not have uptime in /proc. If I just type uptime, I get results in days, ...
0
votes
1
answer
120
views
no1 record in uptimed report
I have recently installed uptimed to track history of when my electricity was off. Everything is clear but there's one thing I cannot decipher.
What does the label "no1" stand for in the following ...
3
votes
1
answer
20k
views
CPU load average + how to get cpu load average for history of X hours
We all know we can get average CPU load as:
uptime
10:09:22 up 2 days, 1:44, 1 user, load average: 20.01, 20.03, 22.05
but this shows only
load average over the last 1 minute is 22.05
load ...
0
votes
1
answer
1k
views
Incorrect System Uptime
Recently, in an Oracle Linux (either 6 or 7) based virtual machine, I faced any issue where system uptime was apparently wrong.
# who -b
system boot 2019-07-24 13:21
# last reboot
reboot system ...
1
vote
0
answers
61
views
Docker container started before host?
Look at the output:
ubuntu@iBug-Server:~$ uptime -s
2019-07-07 20:33:07
ubuntu@iBug-Server:~$ docker inspect -f '{{ .State.StartedAt }}' ibot
2019-07-07T12:30:37.871925503Z
ubuntu@iBug-Server:~$ ...
3
votes
0
answers
532
views
Uptime requires sudo password
I was wondering if anyone could give me some info on why does uptime keeps requiring sudo password? Indeed uptime runs without any sudo access from my trminal.
$ id -u; uptime
1000
17:39:48 up 2:27,...
2
votes
0
answers
405
views
Why do my software RAID1 superblocks keep getting corrupted and how can I prevent this?
How might I be repeatedly corrupting my superblocks on RAID1
I have had two occasions in the past six months of RAID1 root arrays becoming unusable because of problems with the superblock. ...
0
votes
2
answers
602
views
Replacing output with awk or sed
So what I've been trying to do is replace a certain output in bash with awk. But I can't seem to get it to work. I'm trying to replace the $6 output from "uptime" to 'user' instead of 'users'. How can ...
0
votes
1
answer
417
views
Fix the output of uptime
So I've been experimenting with Bash not too long ago, and I want to manipulate the output from the "uptime" command. I managed to change the output of up x minutes to 0:05 for example if the up time ...
1
vote
0
answers
307
views
Different output from uptime command
When I use the uptime command on my linux vb, it shows its output like this before it has been on for longer than 1 hour;
13:45:25 up 40 min, 3 users, load average: 0.41, 0.37, 0.27
But after the ...
0
votes
3
answers
257
views
Why is there a single space before the output of `uptime`?
Perhaps a trivial question, but I found myself in the situation of needing to strip the leading space off the output of uptime and it got me wondering why it was there in the first place.
An example ...
1
vote
2
answers
718
views
High CPU load average; how to find the root cause?
It is hard task to find the root cause of CPU load average
many commands are used to give partial picture.
I am not sure if somewhere we can find a tool that knows how many CPU's we have on machine ...
1
vote
2
answers
1k
views
Most ironclad way to make root installation redundant and maximize uptime? RAID, ZFS or something else?
I would like to set up my desktop computer (which is actually a server for the KVM guests I do my actual work in) to have a redundant root installation. If one drive dies I want to quickly get back ...
-1
votes
3
answers
2k
views
Finding the Percentage from a grep variable
I want to display the calculation of the CPU load in percentage.
num2=$(uptime | grep "average:" | tr -d " " | cut -d ':' -f 5 | cut -d ',' -f 2)
percent=$((num2(*100)))
echo 'CPU percentage' $...
0
votes
2
answers
452
views
Find number of cores available in a given node
I need to fix the following piece of code. The code aims to determine the number of cores available in a given node.
Step 1: Get the number of cores with
TC=$(grep -c process /proc/cpuinfo)
Step 2:...
2
votes
3
answers
8k
views
Convert linux uptime to well format date
I want to convert uptime to date DD:MM:YY without the | and I want to put a string like "the computer is on since 23-feb-16"
5
votes
2
answers
1k
views
Uptime command misconception with suspend and resume states
The definition for uptime is "Tell how long the system has been running." but if you change your system power state to suspend or resume:
# uptime
09:50:33 up 8 min, 2 users, load average: 0,24, 0,...
2
votes
2
answers
3k
views
uptime Script help [closed]
I am looking to build a script that will log in to multiple servers using a host file and run uptime, hostname -I and hostname
Script so far
echo"" ;
echo "hostname:" $(ssh $HOST hostname) ;
echo "...
5
votes
1
answer
1k
views
How is the "users" field of `uptime` calculated?
For me, uptime yields 9 users, but
ps -Af | cut -f1 -d' ' | sort | uniq | wc -l yields 14.
I'm not exactly sure where the 9 is coming from.
Before I jump to conclusions though, please let me ...
3
votes
0
answers
501
views
Time of Last Power Cycle
I know how to use
uptime
To see how long the OS has been running, and
last reboot
To see a log of recent OS reboots.
Is there an easy way to see when the box was last power cycled?
The ...
0
votes
1
answer
1k
views
Is it possible to calculate CPU utilization from load average & top CPU% column
I have a file which contains 2 output of uptime load average & CPU% column like an output from top command.
So, is it possible to calculate it into CPU utilization or CPU usage at a time?
...
2
votes
1
answer
1k
views
Monit alert/exec when host is back to normal
I use Monit to quick check uptime of Elasticsearch service.
Here is my configuration:
check host [Elasticsearch]-test with address 1.2.3.4
if failed
port 9200
protocol http
...
1
vote
1
answer
2k
views
How to suppress Debian uname message when ssh'ing into the machine? Plus changing it to something else, if possible
I would love to get rid of this uname message when ssh'ing into the Debian 9 machine:
Linux backup-server 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64
This line I would like to ...
7
votes
2
answers
3k
views
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 ...
0
votes
2
answers
1k
views
Linux Output Into Table
I have a cronjob that run monthly to generate some report from our system.
However, the current output is as below:
Uptime
100
45
50
Average CPU
2.36
15.6
70.8
How can I generate the output into a ...
5
votes
1
answer
2k
views
getting uptime in Weeks, Days, Hours, Minutes
Basically I an using conky to ssh into an android tv box and get the uptime and display it on the conky screen.
I have this so far, found on net and hacked by me but it works, please amend if its ...
2
votes
2
answers
3k
views
How to display uptime in i3status bar?
I would like to display uptime in common units (so not just in minutes if it is over an hour; also not just in seconds if it is over a minute; e.g., "1:02:30" for 1 hour, 2 minutes and 30 seconds ...
2
votes
0
answers
181
views
What is the right time when linux suffer drift time?
Supose that a linux server, at startup, report the following btime:
boot btime -> 1493875000
This server is virtualized inside a busy box and the I/O load is high, in spite of have ntp running, a ...
0
votes
1
answer
2k
views
Get uptime for multiple Linux based Vms with powershell
Is there a way to find out the uptime for the Linux based Vms through powershell script. I am able to find the uptime for windows based VMs but I am unable to find uptime for the Linux based VMs.
4
votes
2
answers
2k
views
CPU and Load Average Conflict on EC2 server
I am having touble understanding what server resource is causing lag in my Java game server. In the last patch of my game server, I updated my EC2 lamp server from apache2.2, php5.3, mysql5.5 to ...
1
vote
3
answers
1k
views
How to keep an 'uptime record' log in Debian?
Currently, I have my server output my uptime to a HTML page using:
TIME=$(uptime -p)
echo ""${TIME}"!" >> /var/www/html/index.new
Which generates an output of:
up 1 day, 1 hour, 2 minutes!
...
1
vote
1
answer
2k
views
last reboot in local time zone?
Is there a way to tell this command to output the data in local time (not UTC)?
last reboot
Version:
last --version
last von util-linux 2.27.1
9
votes
2
answers
15k
views
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 ...