In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use tuptime tools to view the history and statistics of startup time of Linux server system". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use tuptime tools to view the history and statistics of startup time of Linux server system".
You can use the following tools to see how long Linux or Unix-like systems have been running:
◆ uptime: tells you how long the server has been running.
◆ lastt: displays the restart and shutdown times.
◆ tuptime: reports the uptime history and elapsed time statistics of the system, which refers to the elapsed time between restarts. Similar to the uptime command, but the output is more interesting.
Find out the time and date of the last restart of the system
You can use the following command to get the last restart and shutdown time and date of the Linux operating system (also available on OSX/ Unix systems):
# display system restart and shutdown time who-blast rebootlast shutdown### boot information uptimecat / proc/uptimeawk'{print "up" $1 / 60 "minutes"}'/ proc/uptimew
Sample output:
Figure 1: multiple Linux commands to find out when the server starts up
Say hello to tuptime.
The tuptime command line tool can report the following information on Linux-based systems:
Statistics of startup times of ◆ system
◆ registration * startup time (i.e. installation time)
Statistics of ◆ normal shutdown and accidental shutdown
Average start-up time and failure downtime of ◆
Current boot time of ◆
Start-up and failure downtime rates since ◆ *
◆ cumulative system startup time, failure downtime and total
◆ reports each startup, boot time, shutdown, and failure downtime
Installation
Enter the following command to clone the git repository into the Linux system:
$cd / tmp$ git clone https://github.com/rfrail3/tuptime.git$ ls$ cd tuptime$ ls
Sample output:
Figure 2: clone git repository
Make sure you have Python v2.7 with sys,optparse,os,re,string,sqlite3,datetime,disutils and locale modules installed.
You can install it as follows:
$sudo tuptime-install.sh
Alternatively, you can install it manually (based on systemd or non-systemd):
$sudo cp / tmp/tuptime/latest/cron.d/tuptime / etc/cron.d/tuptime
"if the system is systemd, copy the service file and enable:"
$sudo cp / tmp/tuptime/latest/systemd/tuptime.service / lib/systemd/system/$ sudo systemctl enable tuptime.service
If the system is not systemd, copy the initialization file:
$sudo cp / tmp/tuptime/latest/init.d/tuptime.init.d-debian7 / etc/init.d/tuptime$ sudo update-rc.d tuptime defaults run
Simply enter the following command:
$sudo tuptime
Sample output:
Figure 3:tuptime working
After updating the kernel once, I rebooted the system and entered the same command again:
Sudo tuptimeSystem startups: 2 since 03:52:16 PM 08/21/2015System shutdowns: 1 ok-0 badAverage uptime: 7 days, 16 hours, 48 minutes and 3 secondsAverage downtime: 2 hours, 30 minutes and 5 secondsCurrent uptime: 5 minutes and 28 seconds since 06:23:06 AM 09/06/2015Uptime rate: 98.66% Downtime rate: 1.34% System uptime: 15 days, 9 hours, 36 minutes and 7 secondsSystem downtime: 5 hours 0 minutes and 11 secondsSystem life: 15 days, 14 hours, 36 minutes and 18 seconds
You can modify the date and time format as follows:
$sudo tuptime-d'% H:%M:%S% mmi% dmi% Y'
Sample output:
System startups: 1 since 15:52:16 08-21-2015System shutdowns: 0 ok-0 badAverage uptime: 15 days, 9 hours, 21 minutes and 19 secondsAverage downtime: 0 secondsCurrent uptime: 15 days, 9 hours, 21 minutes and 19 seconds since 15:52:16 08-21-2015Uptime rate: 100.0 Downtime rate: 0.0% System uptime: 15 days, 9 hours, 21 minutes and 19 secondsSystem downtime: 0 secondsSystem life: 15 days, 9 hours 21 minutes and 19 seconds
Calculate each startup, boot time, shutdown and failure downtime:
$sudo tuptime-e
Sample output:
Startup: 1 at 03:52:16 PM 08/21/2015Uptime: 15 days, 9 hours, 22 minutes and 33 seconds System startups: 1 since 03:52:16 PM 08/21/2015System shutdowns: 0 ok-0 badAverage uptime: 15 days, 9 hours, 22 minutes and 33 secondsAverage downtime: 0 secondsCurrent uptime: 15 days, 9 hours 22 minutes and 33 seconds since 03:52:16 PM 08/21/2015Uptime rate: 100.0 Downtime rate: 0.0% System uptime: 15 days, 9 hours, 22 minutes and 33 secondsSystem downtime: 0 secondsSystem life: 15 days, 9 hours, 22 minutes and 33 seconds Thank you for reading The above is the content of "how to use tuptime tools to view the history and statistics of Linux server system startup time". After the study of this article, I believe you have a deeper understanding of how to use tuptime tools to view the history and statistics of Linux server system startup time. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.