Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
tuptime.init.d-redhat | 2011-08-08 | 1.5 kB | |
tuptime.init.d-debian | 2011-08-08 | 1.3 kB | |
tuptime.pl | 2011-08-08 | 15.1 kB | |
README | 2011-08-08 | 4.0 kB | |
changelog | 2011-08-08 | 991 Bytes | |
Totals: 5 Items | 23.0 kB | 0 |
=============== == tuptime == =============== Report how long the system or other components has been running, count it between restarts. == Version ----------------- tuptime 1.4.0 == Requirements ----------------- * perl 5.10 - with module "Time::Duration" and "Sys::Syslog" == Install ------------ All this commands with privileged user (root). Copy the tuptime file in /usr/bin and give it execution permission: # cp tuptime.pl /usr/bin/tuptime # chmod 755 /usr/bin/tuptime Execute it with the -i option for initialize the files: # /usr/bin/tuptime -i Put the init.d script (Debian or RedHat) for udate the counters each time the system starts, restart or stop: In Debian: # cp tuptime.debian /etc/init.d/tuptime # chmod 755 /etc/init.d/tuptime # update-rc.d tuptime defaults In RedHat: # cp tuptime.redhat /etc/rc.d/init.d/tuptime # chmod 755 /etc/rc.d/init.d/tuptime # chkconfig --add tuptime Execute this command for add the line to /etc/crontab file wich automatically update and save the count time every five minutes: # echo '5 * * * * root /usr/bin/tuptime -u' >> /etc/crontab NOTES to RedHat Systems: Install the "perl-Time-Duration" package for avoid errors, is not recommended the use of CPAN for install it because alert some warnings. This package isn't int the official repositories, but in other yes (like http://packages.sw.be/perl-Time-Duration/). NOTES to Debian System: Install the perl modules from CPAN or with the pacakge manager, Sys::Syslog is in the Perl package core and Time::Duration is in libtime-duration-perl package. == Update -------------- Replace only the /usr/bin/tuptime file, all the configuration files will work. # cp new_tuptime.pl /usr/bin/tuptime == Uninstall -------------- Remove the init files and links: In Debian: # rm /etc/init.d/tuptime # update-rc.d tuptime remove In RedHat: # chkconfig --del tuptime # rm /etc/rc.d/init.d/tuptime Remove the complete directory: # rm -rf /var/lib/tuptime # rm -rf /etc/tuptime Remove the line in the crontab with this command or manually: # sed -i '/\/usr\/bin\/tuptime/d' /etc/crontab Remove the script: # rm /usr/bin/tuptime == Using tuptime ------------------ Print the default value "System" in human readable style, any user can do it: # tuptime or: # tuptime -p or, value only in minutes: # tuptime -m Update counts values, only root user: # tuptime -u Configure your preferred values in the conf file (/etc/tuptime/tuptime.conf), one per line, like next example. All of them have the same time value: System Monitor Mouse You can add a time value in minutes which decrease of increase the final time, like this: System Monitor:+52630 Mouse:-1526 If you add hardware to a running system, you can use (# tuptime -m) to read the time in minutes that the system was running and put the difference time with the new component, like this: # tuptime -m System Time: 1931 minutes And now add in /etc/tuptime/tuptime.conf: NewHardWare:-1931 If you put a used hardware, you cand add time to it, like the example: (5000 minutes from used hardware - 1931 from system = value to put) like this: UsedHardware:+3069 If you remove hardware and want a historically print of how many time was running, you can add this special line: #REPLACEAT:ReplacedHardware:12345 The special line starts with a '#' followed by 'REPLACEAT' wich indicates that this is a removed hardware, followed by the name and the time in minutes wich this hardware has been running. In this case, only print the value, not increase or decrease it. == Options ------------ Usage: tuptime [OPTION...] # tuptime -i Initialize the files which uses. # tuptime -p Print the values in human readable style. # tuptime Print the values in human readable style. # tuptime -m Print the values in minutes. # tuptime -u Update and save the values to disk. # tuptime -v Verbose output. # tuptime -h Display this help. # tuptime -V Version information. == Contributors ----------------- * Ricardo F <rikr_@hotmail.com> - 2011