====== Утилита uptimed ======
Программа (демон) uptimed ведет статистику о времени работы машины.
The uptime daemon tracks a system's highest uptimes via boot IDs, using the system boot time to keep sessions apart from each other. It features a console program to display statistics, and can send mail if a milestone or a new record is reached.
Старая домашняя страница - https://podgorny.cz/Uptimed\\
Сейчас код доступен на github - https://github.com/rpodgorny/uptimed/
===== Debian =====
Устанавливаем пакет uptimed
# apt-get install uptimed
На всякий случай проверяем наш uptime
# uptime
14:40:50 up 300 days, 21:52, 1 user, load average: 0.41, 0.21, 0.16
Проверяем теперь вывод uptimed
# uprecords
# Uptime | System Boot up
----------------------------+---------------------------------------------------
-> 1 300 days, 21:53:17 | Linux 3.16.0-4-amd64 Thu Jan 5 16:48:34 2017
----------------------------+---------------------------------------------------
NewRec 300 days, 21:53:16 | since Thu Jan 5 16:48:33 2017
up 300 days, 21:53:17 | since Thu Jan 5 16:48:34 2017
down 0 days, 00:00:00 | since Thu Jan 5 16:48:34 2017
%up 100.000 | since Thu Jan 5 16:48:34 2017
С консолью всё ясно. Но есть ещё ''uprecords.cgi''. Как использовать описано в [[https://github.com/rpodgorny/uptimed/blob/master/INSTALL.cgi|INSTALL.cgi]]
Установка пакета
# apt-get install uprecords-cgi
Нужен [[https://www.nginx.com/resources/wiki/start/topics/examples/fcgiwrap/|fcgiwrap]] для работы с CGI в nginx. Для Apache есть mod_cgi.
Как это выглядит в итоге
{{:linux:uprecords_cgi.png?nolink|}}
===== CentOS =====
Для CentOS 7 есть готовый RPM пакет
# yum install uptimed
Для CentOS 6 есть только обходные пути - https://gist.github.com/asimzeeshan/8370050
#!/bin/bash
############################################################
# Author: Asim
# Bash script created Jan 11, 2014
#
# TODO
# 1) Add interactivity
# 2) Check from CDN for latest file updates
# 3) Install dependancies
# 4) Convert it into a REAL bash script
############################################################
wget https://github.com/downloads/genebean/uptimed/uptimed-0.3.17-0.2.tar.gz
tar -vxf uptimed-0.3.17-0.2.tar.gz
cd uptimed-0.3.17-0.2
./configure
gmake
make install
uptimed -b
uprecords