2
KSysGuard, the KDE System Guard
4
Copyright (c) 2010 David Naylor <naylor.b.david@gmail.com>
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of version 2 or later of the GNU General Public
8
License as published by the Free Software Foundation.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
#include "ksysguardd.h"
29
void initUptime( struct SensorModul* sm ) {
30
registerMonitor( "system/uptime", "float", printUptime, printUptimeInfo, sm );
33
void exitUptime( void ) {
34
removeMonitor("system/uptime");
37
void printUptime( const char* cmd ) {
41
if (clock_gettime(CLOCK_UPTIME, &tp) != -1)
42
uptime = tp.tv_nsec / 1000000000.0 + tp.tv_sec;
43
fprintf( CurrentClient, "%f\n", uptime);
46
void printUptimeInfo( const char* cmd ) {
47
fprintf( CurrentClient, "System uptime\t0\t0\ts\n" );