Update of /cvsroot/perfparse/_perfparse/cgi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10332/cgi
Modified Files:
perfgant.c
Log Message:
in the middle of a conversion
Index: perfgant.c
===================================================================
RCS file: /cvsroot/perfparse/_perfparse/cgi/perfgant.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** perfgant.c 27 Apr 2007 21:25:45 -0000 1.4
--- perfgant.c 6 Jun 2007 13:26:43 -0000 1.5
***************
*** 3,7 ****
* perfgant.c - Displays a gant chart of state changes
*
! * Copyright (c) 2004 Ben Clewett
* $Id$
*
--- 3,8 ----
* perfgant.c - Displays a gant chart of state changes
*
! * Copyright (c) 2004-2007 Ben Clewett, Florian Gleixner
! *
* $Id$
*
***************
*** 59,62 ****
--- 60,64 ----
char *sService;
char *sFrom, *sTo;
+ int iServiceId;
time_t tFrom, tTo, tFromMidnight, tToMidnight;
***************
*** 213,223 ****
time_t t0 = 0, t1 = 0;
#ifdef USE_DB_MYSQL
! g_string_printf(s_SQL, "SELECT ctime, txt_data, nagios_status, UNIX_TIMESTAMP(ctime) FROM perfdata_service_raw WHERE host_name = '%s'", sHost);
#elif defined USE_DB_POSTGRESQL
! g_string_printf(s_SQL, "SELECT ctime, txt_data, nagios_status FROM perfdata_service_raw WHERE host_name = '%s'", sHost);
#endif
! g_string_append_printf(s_SQL, " AND service_description = '%s'", sService);
! g_string_append_printf(s_SQL, " AND ctime BETWEEN '%s' AND '%s'", sFrom, sTo);
! g_string_append_printf(s_SQL, " ORDER BY perfdata_service_raw.ctime");
query(s_SQL->str);
--- 215,224 ----
time_t t0 = 0, t1 = 0;
#ifdef USE_DB_MYSQL
! g_string_printf(s_SQL, "SELECT ctime, txt_data, nagios_status FROM perfdata_service_raw WHERE service_id = %d", iServiceId);
#elif defined USE_DB_POSTGRESQL
! g_string_printf(s_SQL, "SELECT ctime, txt_data, nagios_status FROM perfdata_service_raw WHERE service_id = %d", iServiceId);
#endif
! g_string_append_printf(s_SQL, " AND ctime BETWEEN %d AND %d", tFrom, tTo);
! g_string_append_printf(s_SQL, " ORDER BY ctime");
query(s_SQL->str);
***************
*** 418,421 ****
--- 419,424 ----
sService = strdup(scgi("service"));
+ iServiceId = atoi(scgi("service_id"));
+
sFrom = strdup(scgi("from"));
sTo = strdup(scgi("to"));
|