76{
77 BOOL atleastone_active;
79 char str[80], path[256];
82 char strtmp[256];
83
84
85 for (
int jj = 0; jj <
MAX_LINE; jj++) {
87 }
88
90
91
92 {
93
95 char cs[80], stt[80], spt[80], ex[80], rev[256], rev1[256];
97
98 size = sizeof(rs);
101 strcpy(cs, "Running");
103 strcpy(cs, "Paused ");
105 strcpy(cs, "Stopped");
108 size = sizeof(stt);
110 size = sizeof(spt);
112 size = sizeof(tb);
114 size = sizeof(tsb);
116 size = sizeof(rt);
118
119
120 size = sizeof(ex);
122
123 {
124 time_t full_time;
125 time(&full_time);
126 assert(
sizeof(
str) >= 32);
127 ctime_r(&full_time,
str);
129 }
130
131
132
133
134 {
136 strcpy(rev, strstr(rev1, "midas"));
137 xststr[
j++] =
msprintf(
"*- MIDAS Status Page -%s ----------------------------*",
str);
139 }
140
143
144
145
149 else {
152 else
154 }
155 } else {
158 else
160 }
161
163
164
170 xststr[
j++] =
msprintf(
"Run time: %02d:%02d:%02d", difftime / 3600, difftime % 3600 / 60, difftime % 60);
171 else
172 xststr[
j++] =
msprintf(
"Run time: %02d:%02d:%02d", difftime / 3600, difftime % 3600 / 60, difftime % 60);
173
177 if (tsb < tb)
178 difftime = 0;
179 else
180 difftime = tsb - tb;
182 xststr[
j++] =
msprintf(
"Full Run time: %02d:%02d:%02d", difftime / 3600, difftime % 3600 / 60, difftime % 60);
183 else
184 xststr[
j++] =
msprintf(
"Full Run time: %02d:%02d:%02d", difftime / 3600, difftime % 3600 / 60, difftime % 60);
185
188 }
190 }
191
192
193 {
194 double equevtsend;
195 double equevtpsec;
196 char equclient[256];
197 char equnode[256];
198 double equkbpsec;
200
202 atleastone_active =
FALSE;
203
205 xststr[
j++] =
"FE Equip. Node Evts Taken Evt Rate[/s] Data Rate[Kb/s]";
209 break;
212 ((strstr(
key.
name,
"ODB")) == NULL) &&
213 ((strstr(
key.
name,
"BOR")) == NULL) &&
214 ((strstr(
key.
name,
"EOR")) == NULL)) {
215
216
217 size = sizeof(equclient);
218 sprintf(strtmp,
"/equipment/%s/common/Frontend name",
key.
name);
220
222 atleastone_active =
TRUE;
223 size = sizeof(equenabled);
224 sprintf(strtmp,
"/equipment/%s/common/enabled",
key.
name);
226
227 size = sizeof(equevtsend);
228 sprintf(strtmp,
"/equipment/%s/statistics/events sent",
key.
name);
230
231 size = sizeof(equevtpsec);
232 sprintf(strtmp,
"/equipment/%s/statistics/events per sec.",
key.
name);
234
235 size = sizeof(equkbpsec);
236 sprintf(strtmp,
"/equipment/%s/statistics/kBytes per sec.",
key.
name);
238
239 size = sizeof(equnode);
240 sprintf(strtmp,
"/equipment/%s/common/Frontend host",
key.
name);
242 {
243 char *pp, sdummy[257];
244 memset(sdummy, 0, 64);
246 pp = strchr(equnode, '.');
247 if (pp != NULL)
248 xststr[
j] +=
msprintf(
"%-18s", strncpy(sdummy, equnode, pp - equnode));
249 else
250 xststr[
j] +=
msprintf(
"%-18s", strncpy(sdummy, equnode,
sizeof(sdummy)-1));
251
252 if (equevtsend > 1E9)
254 else if (equevtsend > 1E6)
256 else
258
260
261 if (equenabled) {
266 } else {
270 }
271 } else {
275 }
277 }
278 }
279 }
280 }
281 }
282
283 if (!atleastone_active) {
284 xststr[
j++] =
"... No Front-End currently running...";
285 }
286 }
287
288
289
292 char datadir[256];
294 char lpath[256];
295 char ltype[64];
296 char lstate[64];
297 double levt;
298 double lbyt;
299
300
302 size = sizeof(datadir);
304 std::string mesfile;
306 size = sizeof(wd);
312
313
315 xststr[
j++] =
"Chan. Active Type Filename Events Taken KBytes Taken";
319 break;
322 size = sizeof(lactive);
323 sprintf(strtmp,
"/logger/channels/%s/settings/active",
key.
name);
325 sprintf(lstate, "No");
326 if (lactive)
327 sprintf(lstate, "Yes");
328 size = sizeof(lpath);
329 sprintf(strtmp,
"/logger/channels/%s/settings/Filename",
key.
name);
331
332
335 if (strchr(
str,
'%'))
336 sprintf(path,
str,
rn);
337 else
339 strcpy(lpath, path);
340
341 size = sizeof(ltype);
342 sprintf(strtmp,
"/logger/channels/%s/settings/type",
key.
name);
344
345 size = sizeof(levt);
346 sprintf(strtmp,
"/logger/channels/%s/statistics/Events written",
key.
name);
348
349 size = sizeof(lbyt);
350 sprintf(strtmp,
"/logger/channels/%s/statistics/Bytes written",
key.
name);
352 lbyt /= 1024;
353 if (lactive) {
356 } else {
358 }
360 if (wd == 1)
362 else
372 } else {
375 if (wd == 1)
377 else
387 }
389 }
390 }
391 }
392 } else {
394 }
395
396
397
398
399 {
400 float cr, bs;
402 char bn[128],
tl[128];
405
408 return;
409
411
415 break;
416
418
419 size = sizeof(client_name);
421 client_name[4] = 0;
423 sprintf(
str,
"/Lazy/%s", &client_name[5]);
429 sprintf(
tl,
"<empty>");
430 size = sizeof(cr);
432 size = sizeof(nf);
434 size = sizeof(bs);
436 size = sizeof(bn);
438
441
442 xststr[
j] =
msprintf(
"%s %15s %25s %45s %60s",
"Lazy Label",
"Progress",
"File name",
"#files",
"Total");
443 }
446 }
447 }
448 }
449 }
450 }
451
453
454
455
457 char clientn[256], clienth[256];
458 char *pp, sdummy[64];
459
461 for (
int i = 0;;
i++) {
464 break;
466
467 memset(strtmp, 0, sizeof(strtmp));
468 size = sizeof(clientn);
469 sprintf(strtmp, "name");
471 memset(strtmp, 0, sizeof(strtmp));
472 size = sizeof(clienth);
473 sprintf(strtmp, "host");
475 memset(sdummy, 0, 64);
476 pp = strchr(clienth, '.');
477 if (pp != NULL)
478 xststr[
j] +=
msprintf(
" %s/%s", clientn, strncpy(sdummy, clienth, pp - clienth));
479 else
481 }
483 }
484
486 xststr[
j++] =
msprintf(
"*- [!] to Exit ------- [R] to Refresh ---------------------- Delay:%2.i [sec]-*",
delta_time / 1000);
487 } else {
488 xststr[
j++] =
"*---------------------------------------------------------------------------*";
489 }
490
492
494
495
496
497 return;
498}
const char * cm_get_revision()
INT cm_exist(const char *name, BOOL bUnique)
#define DB_NO_MORE_SUBKEYS
void cm_msg_get_logfile(const char *fac, time_t t, std::string *filename, std::string *linkname, std::string *linktarget)
BOOL equal_ustring(const char *str1, const char *str2)
INT db_get_value(HNDLE hDB, HNDLE hKeyRoot, const char *key_name, void *data, INT *buf_size, DWORD type, BOOL create)
INT db_get_key(HNDLE hDB, HNDLE hKey, KEY *key)
INT db_find_key(HNDLE hDB, HNDLE hKey, const char *key_name, HNDLE *subhKey)
INT db_enum_key(HNDLE hDB, HNDLE hKey, INT idx, HNDLE *subkey_handle)
std::string msprintf(const char *format,...)
std::string xststr[MAX_LINE]