278 |
"<tr><td width=\"40%\"><b>Parameter</b></td>" |
"<tr><td width=\"40%\"><b>Parameter</b></td>" |
279 |
"<td width=\"60%\"><b>Value</b></td></tr>"); |
"<td width=\"60%\"><b>Value</b></td></tr>"); |
280 |
out_print(res, |
out_print(res, |
281 |
"<tr><td>Host</a></td><td>%s</td></tr>", |
"<tr><td>Host</td><td>%s</td></tr>", |
282 |
Run.localhostname); |
Run.localhostname); |
283 |
out_print(res, |
out_print(res, |
284 |
"<tr><td>Process id</a></td><td>%d</td></tr>", pid); |
"<tr><td>Process id</td><td>%d</td></tr>", pid); |
285 |
out_print(res, |
out_print(res, |
286 |
"<tr><td>Effective user running monit</a></td>" |
"<tr><td>Effective user running monit</td>" |
287 |
"<td>%s</td></tr>", Run.Env.user); |
"<td>%s</td></tr>", Run.Env.user); |
288 |
out_print(res, |
out_print(res, |
289 |
"<tr><td>Controlfile</a></td><td>%s</td></tr>", Run.controlfile); |
"<tr><td>Controlfile</td><td>%s</td></tr>", Run.controlfile); |
290 |
if(Run.logfile) |
if(Run.logfile) |
291 |
out_print(res, |
out_print(res, |
292 |
"<tr><td>Logfile</a></td><td>%s</td></tr>", Run.logfile); |
"<tr><td>Logfile</td><td>%s</td></tr>", Run.logfile); |
293 |
out_print(res, |
out_print(res, |
294 |
"<tr><td>Pidfile</a></td><td>%s</td></tr>", Run.pidfile); |
"<tr><td>Pidfile</td><td>%s</td></tr>", Run.pidfile); |
295 |
out_print(res, |
out_print(res, |
296 |
"<tr><td>Debug</a></td><td>%s</td></tr>", |
"<tr><td>Debug</td><td>%s</td></tr>", |
297 |
Run.debug?"True":"False"); |
Run.debug?"True":"False"); |
298 |
out_print(res, |
out_print(res, |
299 |
"<tr><td>Log</a></td><td>%s</td></tr>", Run.dolog?"True":"False"); |
"<tr><td>Log</td><td>%s</td></tr>", Run.dolog?"True":"False"); |
300 |
out_print(res, |
out_print(res, |
301 |
"<tr><td>Use syslog</a></td><td>%s</td></tr>", |
"<tr><td>Use syslog</td><td>%s</td></tr>", |
302 |
Run.use_syslog?"True":"False"); |
Run.use_syslog?"True":"False"); |
303 |
if(Run.mailserver) |
if(Run.mailserver) |
304 |
out_print(res, |
out_print(res, |
305 |
"<tr><td>Mail server</a></td><td>%s</td></tr>", Run.mailserver); |
"<tr><td>Mail server</td><td>%s</td></tr>", Run.mailserver); |
306 |
if(Run.MailFormat.from) |
if(Run.MailFormat.from) |
307 |
out_print(res, |
out_print(res, |
308 |
"<tr><td>Default mail from</a></td><td>%s</td></tr>", |
"<tr><td>Default mail from</td><td>%s</td></tr>", |
309 |
Run.MailFormat.from); |
Run.MailFormat.from); |
310 |
if(Run.MailFormat.subject) |
if(Run.MailFormat.subject) |
311 |
out_print(res, |
out_print(res, |
312 |
"<tr><td>Default mail subject</a></td><td>%s</td></tr>", |
"<tr><td>Default mail subject</td><td>%s</td></tr>", |
313 |
Run.MailFormat.subject); |
Run.MailFormat.subject); |
314 |
if(Run.MailFormat.message) |
if(Run.MailFormat.message) |
315 |
out_print(res, |
out_print(res, |
316 |
"<tr><td>Default mail message</a></td><td>%s</td></tr>", |
"<tr><td>Default mail message</td><td>%s</td></tr>", |
317 |
Run.MailFormat.message); |
Run.MailFormat.message); |
318 |
out_print(res, |
out_print(res, |
319 |
"<tr><td>Poll time</a></td><td>%d seconds</td></tr>", |
"<tr><td>Poll time</td><td>%d seconds</td></tr>", |
320 |
Run.polltime); |
Run.polltime); |
321 |
out_print(res, |
out_print(res, |
322 |
"<tr><td>httpd bind address</a>" |
"<tr><td>httpd bind address</td><td>%s</td></tr>", |
323 |
"</td><td>%s</td></tr>", Run.bind_addr?Run.bind_addr:"Any/All"); |
Run.bind_addr?Run.bind_addr:"Any/All"); |
324 |
out_print(res, |
out_print(res, |
325 |
"<tr><td>httpd portnumber</a>" |
"<tr><td>httpd portnumber</td><td>%d</td></tr>", Run.httpdport); |
|
"</td><td>%d</td></tr>", Run.httpdport); |
|
326 |
out_print(res, |
out_print(res, |
327 |
"<tr><td>Use ssl encryption</a>" |
"<tr><td>Use ssl encryption</td><td>%s</td></tr>", |
328 |
"</td><td>%s</td></tr>", Run.httpdssl?"True":"False"); |
Run.httpdssl?"True":"False"); |
329 |
if (Run.httpdssl) { |
if (Run.httpdssl) { |
330 |
out_print(res, |
out_print(res, |
331 |
"<tr><td>PEM key/certificate file</a>" |
"<tr><td>PEM key/certificate file</td><td>%s</td></tr>", |
332 |
"</td><td>%s</td></tr>", Run.httpsslpem); |
Run.httpsslpem); |
333 |
|
|
334 |
if (Run.httpsslclientpem!=NULL) { |
if (Run.httpsslclientpem!=NULL) { |
335 |
out_print(res, |
out_print(res, |
336 |
"<tr><td>Client PEM key/certification</a>" |
"<tr><td>Client PEM key/certification" |
337 |
"</td><td>%s</td></tr>", "Enabled"); |
"</td><td>%s</td></tr>", "Enabled"); |
338 |
out_print(res, |
out_print(res, |
339 |
"<tr><td>Client PEM key/certificate file</a>" |
"<tr><td>Client PEM key/certificate file" |
340 |
"</td><td>%s</td></tr>", Run.httpsslclientpem); |
"</td><td>%s</td></tr>", Run.httpsslclientpem); |
341 |
} else { |
} else { |
342 |
out_print(res, |
out_print(res, |
343 |
"<tr><td>Client PEM key/certification</a>" |
"<tr><td>Client PEM key/certification" |
344 |
"</td><td>%s</td></tr>", "Disabled"); |
"</td><td>%s</td></tr>", "Disabled"); |
345 |
} |
} |
346 |
out_print(res, |
out_print(res, |
347 |
"<tr><td>Allow self certified certificates </a>" |
"<tr><td>Allow self certified certificates " |
348 |
"</td><td>%s</td></tr>", Run.allowselfcert?"True":"False"); |
"</td><td>%s</td></tr>", Run.allowselfcert?"True":"False"); |
349 |
} |
} |
350 |
|
|
351 |
out_print(res, |
out_print(res, |
352 |
"<tr><td>httpd auth. style</a></td><td>%s</td></tr>", |
"<tr><td>httpd auth. style</td><td>%s</td></tr>", |
353 |
Run.Auth.defined&&has_hosts_allow()? |
Run.Auth.defined&&has_hosts_allow()? |
354 |
"Basic Authentication and Host allow list": |
"Basic Authentication and Host allow list": |
355 |
Run.Auth.defined?"Basic Authentication": |
Run.Auth.defined?"Basic Authentication": |
1253 |
"<tr><td width=\"30%\"><b>Parameter</b></td><td width=\"70%\">" |
"<tr><td width=\"30%\"><b>Parameter</b></td><td width=\"70%\">" |
1254 |
"<b>Value</b></td></tr>"); |
"<b>Value</b></td></tr>"); |
1255 |
out_print(res, |
out_print(res, |
1256 |
"<tr><td>Name</a></td><td>%s</td></tr>", s->name); |
"<tr><td>Name</td><td>%s</td></tr>", s->name); |
1257 |
if(s->group) |
if(s->group) |
1258 |
out_print(res, |
out_print(res, |
1259 |
"<tr><td>Group</a></td><td><font color='#0000ff'>%s" |
"<tr><td>Group</td><td><font color='#0000ff'>%s" |
1260 |
"</font></td></tr>", s->group); |
"</font></td></tr>", s->group); |
1261 |
out_print(res, |
out_print(res, |
1262 |
"<tr><td>Device status</a></td><td>%s</td></tr>", |
"<tr><td>Device status</td><td>%s</td></tr>", |
1263 |
(s->perm&&s->perm->has_error)? |
(s->perm&&s->perm->has_error)? |
1264 |
"<font color='#ff0000'>Permission error</font>": |
"<font color='#ff0000'>Permission error</font>": |
1265 |
(s->uid&&s->uid->has_error)? |
(s->uid&&s->uid->has_error)? |
1270 |
"<font color='#00ff00'>Accessible</font>": |
"<font color='#00ff00'>Accessible</font>": |
1271 |
"<font color='#ff0000'>Not Accessible</font>"); |
"<font color='#ff0000'>Not Accessible</font>"); |
1272 |
out_print(res, |
out_print(res, |
1273 |
"<tr><td>Path</a></td><td>%s</td></tr>", |
"<tr><td>Path</td><td>%s</td></tr>", |
1274 |
s->path); |
s->path); |
1275 |
out_print(res, |
out_print(res, |
1276 |
"<tr><td>Monitoring mode</a></td><td>%s</td></tr>", |
"<tr><td>Monitoring mode</td><td>%s</td></tr>", |
1277 |
modenames[s->mode]); |
modenames[s->mode]); |
1278 |
out_print(res, |
out_print(res, |
1279 |
"<tr><td>Monitoring status</a></td><td><font color='#ff8800'>%s" |
"<tr><td>Monitoring status</td><td><font color='#ff8800'>%s" |
1280 |
"</font></td></tr>", |
"</font></td></tr>", |
1281 |
statusnames[s->do_monitor]); |
statusnames[s->do_monitor]); |
1282 |
if(s->start) { |
if(s->start) { |
1283 |
int i = 0; |
int i = 0; |
1284 |
|
|
1285 |
out_print(res, "<tr><td>Start program</a></td><td>"); |
out_print(res, "<tr><td>Start program</td><td>"); |
1286 |
while(s->start->arg[i]) |
while(s->start->arg[i]) |
1287 |
out_print(res, "%s ", s->start->arg[i++]); |
out_print(res, "%s ", s->start->arg[i++]); |
1288 |
printf("</td></tr>"); |
out_print(res, "</td></tr>"); |
1289 |
} |
} |
1290 |
if(s->stop) { |
if(s->stop) { |
1291 |
int i = 0; |
int i = 0; |
1292 |
|
|
1293 |
out_print(res, "<tr><td>Stop program</a></td><td>"); |
out_print(res, "<tr><td>Stop program</td><td>"); |
1294 |
while(s->stop->arg[i]) |
while(s->stop->arg[i]) |
1295 |
out_print(res, "%s ", s->stop->arg[i++]); |
out_print(res, "%s ", s->stop->arg[i++]); |
1296 |
printf("</td></tr>"); |
out_print(res, "</td></tr>"); |
1297 |
} |
} |
1298 |
if(s->perm) |
if(s->perm) |
1299 |
out_print(res, "<tr><td>Associated permission</a></td><td>if failed %o then %s</td></tr>", |
out_print(res, "<tr><td>Associated permission</td><td>if failed %o then %s</td></tr>", |
1300 |
s->perm->perm, actionnames[s->perm->action]); |
s->perm->perm, actionnames[s->perm->action]); |
1301 |
if(s->uid) |
if(s->uid) |
1302 |
out_print(res, "<tr><td>Associated UID</a></td><td>if failed %d then %s</td></tr>", |
out_print(res, "<tr><td>Associated UID</td><td>if failed %d then %s</td></tr>", |
1303 |
(int)s->uid->uid, actionnames[s->uid->action]); |
(int)s->uid->uid, actionnames[s->uid->action]); |
1304 |
if(s->gid) |
if(s->gid) |
1305 |
out_print(res, "<tr><td>Associated GID</a></td><td>if failed %d then %s</td></tr>", |
out_print(res, "<tr><td>Associated GID</td><td>if failed %d then %s</td></tr>", |
1306 |
(int)s->gid->gid, actionnames[s->gid->action]); |
(int)s->gid->gid, actionnames[s->gid->action]); |
1307 |
out_print(res, |
out_print(res, |
1308 |
"<tr><td>Permission</a></td><td>%s%o</font></td></tr>", |
"<tr><td>Permission</td><td>%s%o</font></td></tr>", |
1309 |
(s->perm&&s->perm->has_error)? |
(s->perm&&s->perm->has_error)? |
1310 |
"<font color='#ff0000'>": |
"<font color='#ff0000'>": |
1311 |
"<font>", |
"<font>", |
1312 |
stat_buf.st_mode & 07777); |
stat_buf.st_mode & 07777); |
1313 |
out_print(res, |
out_print(res, |
1314 |
"<tr><td>UID</a></td><td>%s%d</font></td></tr>", |
"<tr><td>UID</td><td>%s%d</font></td></tr>", |
1315 |
(s->uid&&s->uid->has_error)? |
(s->uid&&s->uid->has_error)? |
1316 |
"<font color='#ff0000'>": |
"<font color='#ff0000'>": |
1317 |
"<font>", |
"<font>", |
1318 |
(int)stat_buf.st_uid); |
(int)stat_buf.st_uid); |
1319 |
out_print(res, |
out_print(res, |
1320 |
"<tr><td>GID</a></td><td>%s%d</font></td></tr>", |
"<tr><td>GID</td><td>%s%d</font></td></tr>", |
1321 |
(s->gid&&s->gid->has_error)? |
(s->gid&&s->gid->has_error)? |
1322 |
"<font color='#ff0000'>": |
"<font color='#ff0000'>": |
1323 |
"<font>", |
"<font>", |
1327 |
|
|
1328 |
for(d= s->dependantlist; d; d= d->next) { |
for(d= s->dependantlist; d; d= d->next) { |
1329 |
if(d->dependant != NULL) { |
if(d->dependant != NULL) { |
1330 |
out_print(res,"<tr><td>Depends on service </a></td>" |
out_print(res,"<tr><td>Depends on service </td>" |
1331 |
"<td> <a href=%s> %s </a></td></tr>", |
"<td> <a href=%s> %s </a></td></tr>", |
1332 |
d->dependant, d->dependant); |
d->dependant, d->dependant); |
1333 |
} |
} |
1334 |
} |
} |
1335 |
} |
} |
1336 |
out_print(res, |
out_print(res, |
1337 |
"<tr><td>Check service</a></td><td>Every %d cycle</td></tr>", |
"<tr><td>Check service</td><td>Every %d cycle</td></tr>", |
1338 |
s->every?s->every:1); |
s->every?s->every:1); |
1339 |
if(s->def_timeout) { |
if(s->def_timeout) { |
1340 |
out_print(res, |
out_print(res, |
1341 |
"<tr><td>Timeout</a></td><td>" |
"<tr><td>Timeout</td><td>" |
1342 |
"Timeout if %d restart within %d cycles</td></tr>", |
"Timeout if %d restart within %d cycles</td></tr>", |
1343 |
s->to_start, s->to_cycle); |
s->to_start, s->to_cycle); |
1344 |
} |
} |
1353 |
if(dl->resource == RESOURCE_ID_INODE) { |
if(dl->resource == RESOURCE_ID_INODE) { |
1354 |
|
|
1355 |
out_print(res, |
out_print(res, |
1356 |
"<tr><td>Inodes usage limit</a></td><td>if %s %ld %s " |
"<tr><td>Inodes usage limit</td><td>if %s %ld %s " |
1357 |
"then %s</td></tr>", operatornames[dl->operator], |
"then %s</td></tr>", operatornames[dl->operator], |
1358 |
(dl->limit_absolute > -1)? |
(dl->limit_absolute > -1)? |
1359 |
dl->limit_absolute:dl->limit_percent, |
dl->limit_absolute:dl->limit_percent, |
1363 |
} else if(dl->resource == RESOURCE_ID_SPACE) { |
} else if(dl->resource == RESOURCE_ID_SPACE) { |
1364 |
|
|
1365 |
out_print(res, |
out_print(res, |
1366 |
"<tr><td>Space usage limit</a></td><td>if %s %ld %s " |
"<tr><td>Space usage limit</td><td>if %s %ld %s " |
1367 |
"then %s</td></tr>", operatornames[dl->operator], |
"then %s</td></tr>", operatornames[dl->operator], |
1368 |
(dl->limit_absolute > -1)? |
(dl->limit_absolute > -1)? |
1369 |
dl->limit_absolute:dl->limit_percent, |
dl->limit_absolute:dl->limit_percent, |
1377 |
|
|
1378 |
if(state) { |
if(state) { |
1379 |
out_print(res, |
out_print(res, |
1380 |
"<tr><td>Blocks total</a></td><td>%ld [%.1f MB]</td></tr>", |
"<tr><td>Blocks total</td><td>%ld [%.1f MB]</td></tr>", |
1381 |
s->devinfo->f_blocks, |
s->devinfo->f_blocks, |
1382 |
(float) s->devinfo->f_blocks / 1048576 * s->devinfo->f_bsize); |
(float) s->devinfo->f_blocks / 1048576 * s->devinfo->f_bsize); |
1383 |
out_print(res, |
out_print(res, |
1384 |
"<tr><td>Blocks free for non superuser</a></td>" |
"<tr><td>Blocks free for non superuser</td>" |
1385 |
"<td>%ld [%.1f MB] [%.1f%%]</font></td></tr>", |
"<td>%ld [%.1f MB] [%.1f%%]</font></td></tr>", |
1386 |
s->devinfo->f_blocksfree, |
s->devinfo->f_blocksfree, |
1387 |
(float) s->devinfo->f_blocksfree / |
(float) s->devinfo->f_blocksfree / |
1388 |
1048576 * s->devinfo->f_bsize, |
1048576 * s->devinfo->f_bsize, |
1389 |
(float) 100 * s->devinfo->f_blocksfree / s->devinfo->f_blocks); |
(float) 100 * s->devinfo->f_blocksfree / s->devinfo->f_blocks); |
1390 |
out_print(res, |
out_print(res, |
1391 |
"<tr><td>Blocks free total</a></td><td>%ld [%.1f MB] [%.1f%%]" |
"<tr><td>Blocks free total</td><td>%ld [%.1f MB] [%.1f%%]" |
1392 |
"</td></tr>", s->devinfo->f_blocksfreetotal, |
"</td></tr>", s->devinfo->f_blocksfreetotal, |
1393 |
(float) s->devinfo->f_blocksfreetotal / |
(float) s->devinfo->f_blocksfreetotal / |
1394 |
1048576 * s->devinfo->f_bsize, |
1048576 * s->devinfo->f_bsize, |
1395 |
(float) 100 * s->devinfo->f_blocksfreetotal / |
(float) 100 * s->devinfo->f_blocksfreetotal / |
1396 |
s->devinfo->f_blocks); |
s->devinfo->f_blocks); |
1397 |
out_print(res, |
out_print(res, |
1398 |
"<tr><td>Block size</a></td><td>%ld B</td></tr>", |
"<tr><td>Block size</td><td>%ld B</td></tr>", |
1399 |
s->devinfo->f_bsize); |
s->devinfo->f_bsize); |
1400 |
if(s->devinfo->f_files > 0) { |
if(s->devinfo->f_files > 0) { |
1401 |
out_print(res, |
out_print(res, |
1402 |
"<tr><td>Inodes total</a></td><td>%ld</td></tr>", |
"<tr><td>Inodes total</td><td>%ld</td></tr>", |
1403 |
s->devinfo->f_files); |
s->devinfo->f_files); |
1404 |
out_print(res, |
out_print(res, |
1405 |
"<tr><td>Inodes free</a></td><td>%ld [%.1f%%]</font>" |
"<tr><td>Inodes free</td><td>%ld [%.1f%%]</font>" |
1406 |
"</td></tr>", s->devinfo->f_filesfree, |
"</td></tr>", s->devinfo->f_filesfree, |
1407 |
(float) 100 * s->devinfo->f_filesfree / s->devinfo->f_files); |
(float) 100 * s->devinfo->f_filesfree / s->devinfo->f_files); |
1408 |
} |
} |
1409 |
} else { |
} else { |
1410 |
out_print(res, |
out_print(res, |
1411 |
"<tr><td>Blocks total</a></td><td>-</td></tr>"); |
"<tr><td>Blocks total</td><td>-</td></tr>"); |
1412 |
out_print(res, |
out_print(res, |
1413 |
"<tr><td>Blocks free for non superuser</a></td>" |
"<tr><td>Blocks free for non superuser</td>" |
1414 |
"<td>-</font></td></tr>"); |
"<td>-</font></td></tr>"); |
1415 |
out_print(res, |
out_print(res, |
1416 |
"<tr><td>Blocks free total</a></td><td>-</td></tr>"); |
"<tr><td>Blocks free total</td><td>-</td></tr>"); |
1417 |
out_print(res, |
out_print(res, |
1418 |
"<tr><td>Block size</a></td><td>-</td></tr>"); |
"<tr><td>Block size</td><td>-</td></tr>"); |
1419 |
out_print(res, |
out_print(res, |
1420 |
"<tr><td>Inodes total</a></td><td>-</td></tr>"); |
"<tr><td>Inodes total</td><td>-</td></tr>"); |
1421 |
out_print(res, |
out_print(res, |
1422 |
"<tr><td>Inodes free</a></td><td>-</font></td></tr>"); |
"<tr><td>Inodes free</td><td>-</font></td></tr>"); |
1423 |
} |
} |
1424 |
} |
} |
1425 |
{ |
{ |
1426 |
Mail_T r; |
Mail_T r; |
1427 |
for(r= s->maillist; r; r= r->next) { |
for(r= s->maillist; r; r= r->next) { |
1428 |
out_print(res, |
out_print(res, |
1429 |
"<tr bgcolor=\"#EFEFEF\"><td>Alert mail to</a></td>" |
"<tr bgcolor=\"#EFEFEF\"><td>Alert mail to</td>" |
1430 |
"<td>%s</td></tr>", r->to?r->to:""); |
"<td>%s</td></tr>", r->to?r->to:""); |
|
out_print(res, |
|
|
"<tr><td>Alert from</a></td><td>%s</td></tr>", |
|
|
r->from?r->from:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert subject</a></td><td>%s</td></tr>", |
|
|
r->subject?r->subject:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert message</a></td><td>%s</td></tr>", |
|
|
r->message?r->message:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on start</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_START)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on stop</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_STOP)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on restart</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_RESTART)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on checksum</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_CHECKSUM)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on exceeded resource</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_RESOURCE)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on timeout</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_TIMEOUT)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on timestamp</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_TIMESTAMP)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on connection</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_CONNECTION)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on size</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_SIZE)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on permission</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_PERMISSION)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on uid</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_UID)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on gid</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_GID)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on unmonitor</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_UNMONITOR)?"yes":"no"); |
|
1431 |
} |
} |
1432 |
} |
} |
1433 |
out_print(res, "</table>"); |
out_print(res, "</table>"); |
1480 |
"<tr><td width=\"30%\"><b>Parameter</b></td>" |
"<tr><td width=\"30%\"><b>Parameter</b></td>" |
1481 |
"<td width=\"70%\"><b>Value</b></td></tr>"); |
"<td width=\"70%\"><b>Value</b></td></tr>"); |
1482 |
out_print(res, |
out_print(res, |
1483 |
"<tr><td>Name</a></td><td>%s</td></tr>", s->name); |
"<tr><td>Name</td><td>%s</td></tr>", s->name); |
1484 |
if(s->group) |
if(s->group) |
1485 |
out_print(res, |
out_print(res, |
1486 |
"<tr><td>Group</a></td><td><font color='#0000ff'>%s" |
"<tr><td>Group</td><td><font color='#0000ff'>%s" |
1487 |
"</font></td></tr>", s->group); |
"</font></td></tr>", s->group); |
1488 |
out_print(res, |
out_print(res, |
1489 |
"<tr><td>Directory status</a></td><td>%s</td></tr>", |
"<tr><td>Directory status</td><td>%s</td></tr>", |
1490 |
(s->perm&&s->perm->has_error)? |
(s->perm&&s->perm->has_error)? |
1491 |
"<font color='#ff0000'>Permission Error</font>": |
"<font color='#ff0000'>Permission Error</font>": |
1492 |
(s->uid&&s->uid->has_error)? |
(s->uid&&s->uid->has_error)? |
1497 |
"<font color='#00ff00'>Exist</font>": |
"<font color='#00ff00'>Exist</font>": |
1498 |
"<font color='#ff0000'>Doesn't Exist</font>"); |
"<font color='#ff0000'>Doesn't Exist</font>"); |
1499 |
out_print(res, |
out_print(res, |
1500 |
"<tr><td>Path</a></td><td>%s</td></tr>", |
"<tr><td>Path</td><td>%s</td></tr>", |
1501 |
s->path); |
s->path); |
1502 |
out_print(res, |
out_print(res, |
1503 |
"<tr><td>Monitoring mode</a></td><td>%s</td></tr>", |
"<tr><td>Monitoring mode</td><td>%s</td></tr>", |
1504 |
modenames[s->mode]); |
modenames[s->mode]); |
1505 |
out_print(res, |
out_print(res, |
1506 |
"<tr><td>Monitoring status</a></td><td><font color='#ff8800'>%s" |
"<tr><td>Monitoring status</td><td><font color='#ff8800'>%s" |
1507 |
"</font></td></tr>", |
"</font></td></tr>", |
1508 |
statusnames[s->do_monitor]); |
statusnames[s->do_monitor]); |
1509 |
if(s->start) { |
if(s->start) { |
1510 |
int i = 0; |
int i = 0; |
1511 |
|
|
1512 |
out_print(res, "<tr><td>Start program</a></td><td>"); |
out_print(res, "<tr><td>Start program</td><td>"); |
1513 |
while(s->start->arg[i]) |
while(s->start->arg[i]) |
1514 |
out_print(res, "%s ", s->start->arg[i++]); |
out_print(res, "%s ", s->start->arg[i++]); |
1515 |
printf("</td></tr>"); |
out_print(res, "</td></tr>"); |
1516 |
} |
} |
1517 |
if(s->stop) { |
if(s->stop) { |
1518 |
int i = 0; |
int i = 0; |
1519 |
|
|
1520 |
out_print(res, "<tr><td>Stop program</a></td><td>"); |
out_print(res, "<tr><td>Stop program</td><td>"); |
1521 |
while(s->stop->arg[i]) |
while(s->stop->arg[i]) |
1522 |
out_print(res, "%s ", s->stop->arg[i++]); |
out_print(res, "%s ", s->stop->arg[i++]); |
1523 |
printf("</td></tr>"); |
out_print(res, "</td></tr>"); |
1524 |
} |
} |
1525 |
{ |
{ |
1526 |
Dependant_T d; |
Dependant_T d; |
1527 |
|
|
1528 |
for(d= s->dependantlist; d; d= d->next) { |
for(d= s->dependantlist; d; d= d->next) { |
1529 |
if(d->dependant != NULL) { |
if(d->dependant != NULL) { |
1530 |
out_print(res,"<tr><td>Depends on service </a></td>" |
out_print(res,"<tr><td>Depends on service </td>" |
1531 |
"<td> <a href=%s> %s </a></td></tr>", |
"<td> <a href=%s> %s </a></td></tr>", |
1532 |
d->dependant, d->dependant); |
d->dependant, d->dependant); |
1533 |
} |
} |
1538 |
for(t= s->timestamplist; t; t= t->next) { |
for(t= s->timestamplist; t; t= t->next) { |
1539 |
if(t->test_changes) { |
if(t->test_changes) { |
1540 |
out_print(res, |
out_print(res, |
1541 |
"<tr><td>Associated timestamp</a></td>" |
"<tr><td>Associated timestamp</td>" |
1542 |
"<td>If changed then %s</td></tr>", |
"<td>If changed then %s</td></tr>", |
1543 |
actionnames[t->action]); |
actionnames[t->action]); |
1544 |
} else { |
} else { |
1545 |
out_print(res, |
out_print(res, |
1546 |
"<tr><td>Associated timestamp</a></td>" |
"<tr><td>Associated timestamp</td>" |
1547 |
"<td>If %s %d second(s) then %s</td></tr>", |
"<td>If %s %d second(s) then %s</td></tr>", |
1548 |
operatornames[t->operator], |
operatornames[t->operator], |
1549 |
t->time, actionnames[t->action]); |
t->time, actionnames[t->action]); |
1552 |
} |
} |
1553 |
if(s->perm) |
if(s->perm) |
1554 |
out_print(res, |
out_print(res, |
1555 |
"<tr><td>Associated permission</a></td><td>" |
"<tr><td>Associated permission</td><td>" |
1556 |
"if failed %o then %s</td></tr>", |
"if failed %o then %s</td></tr>", |
1557 |
s->perm->perm, actionnames[s->perm->action]); |
s->perm->perm, actionnames[s->perm->action]); |
1558 |
if(s->uid) |
if(s->uid) |
1559 |
out_print(res, "<tr><td>Associated UID</a></td><td>" |
out_print(res, "<tr><td>Associated UID</td><td>" |
1560 |
"if failed %d then %s</td></tr>", |
"if failed %d then %s</td></tr>", |
1561 |
(int)s->uid->uid, actionnames[s->uid->action]); |
(int)s->uid->uid, actionnames[s->uid->action]); |
1562 |
if(s->gid) |
if(s->gid) |
1563 |
out_print(res, "<tr><td>Associated GID</a></td><td>" |
out_print(res, "<tr><td>Associated GID</td><td>" |
1564 |
"if failed %d then %s</td></tr>", |
"if failed %d then %s</td></tr>", |
1565 |
(int)s->gid->gid, actionnames[s->gid->action]); |
(int)s->gid->gid, actionnames[s->gid->action]); |
1566 |
out_print(res, |
out_print(res, |
1567 |
"<tr><td>Check service</a></td><td>Every %d cycle</td></tr>", |
"<tr><td>Check service</td><td>Every %d cycle</td></tr>", |
1568 |
s->every?s->every:1); |
s->every?s->every:1); |
1569 |
if(s->def_timeout) { |
if(s->def_timeout) { |
1570 |
out_print(res, |
out_print(res, |
1571 |
"<tr><td>Timeout</a></td><td>" |
"<tr><td>Timeout</td><td>" |
1572 |
"Timeout if %d restart within %d cycles</td></tr>", |
"Timeout if %d restart within %d cycles</td></tr>", |
1573 |
s->to_start, s->to_cycle); |
s->to_start, s->to_cycle); |
1574 |
} |
} |
1575 |
out_print(res, |
out_print(res, |
1576 |
"<tr><td>Permission</a></td><td>%s%o</font></td></tr>", |
"<tr><td>Permission</td><td>%s%o</font></td></tr>", |
1577 |
(s->perm&&s->perm->has_error)? |
(s->perm&&s->perm->has_error)? |
1578 |
"<font color='#ff0000'>": |
"<font color='#ff0000'>": |
1579 |
"<font>", |
"<font>", |
1580 |
stat_buf.st_mode & 07777); |
stat_buf.st_mode & 07777); |
1581 |
out_print(res, |
out_print(res, |
1582 |
"<tr><td>UID</a></td><td>%s%d</font></td></tr>", |
"<tr><td>UID</td><td>%s%d</font></td></tr>", |
1583 |
(s->uid&&s->uid->has_error)? |
(s->uid&&s->uid->has_error)? |
1584 |
"<font color='#ff0000'>": |
"<font color='#ff0000'>": |
1585 |
"<font>", |
"<font>", |
1586 |
(int)stat_buf.st_uid); |
(int)stat_buf.st_uid); |
1587 |
out_print(res, |
out_print(res, |
1588 |
"<tr><td>GID</a></td><td>%s%d</font></td></tr>", |
"<tr><td>GID</td><td>%s%d</font></td></tr>", |
1589 |
(s->gid&&s->gid->has_error)? |
(s->gid&&s->gid->has_error)? |
1590 |
"<font color='#ff0000'>": |
"<font color='#ff0000'>": |
1591 |
"<font>", |
"<font>", |
1594 |
Mail_T r; |
Mail_T r; |
1595 |
for(r= s->maillist; r; r= r->next) { |
for(r= s->maillist; r; r= r->next) { |
1596 |
out_print(res, |
out_print(res, |
1597 |
"<tr bgcolor=\"#EFEFEF\"><td>Alert mail to</a></td>" |
"<tr bgcolor=\"#EFEFEF\"><td>Alert mail to</td>" |
1598 |
"<td>%s</td></tr>", r->to?r->to:""); |
"<td>%s</td></tr>", r->to?r->to:""); |
|
out_print(res, |
|
|
"<tr><td>Alert from</a></td><td>%s</td></tr>", |
|
|
r->from?r->from:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert subject</a></td><td>%s</td></tr>", |
|
|
r->subject?r->subject:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert message</a></td><td>%s</td></tr>", |
|
|
r->message?r->message:"(default)"); |
|
|
|
|
|
out_print(res, |
|
|
"<tr><td>Alert on start</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_START)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on stop</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_STOP)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on restart</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_RESTART)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on checksum</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_CHECKSUM)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on exceeded resource</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_RESOURCE)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on timeout</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_TIMEOUT)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on timestamp</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_TIMESTAMP)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on connection</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_CONNECTION)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on size</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_SIZE)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on permission</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_PERMISSION)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on uid</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_UID)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on gid</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_GID)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on unmonitor</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_UNMONITOR)?"yes":"no"); |
|
1599 |
} |
} |
1600 |
} |
} |
1601 |
out_print(res, "</table>"); |
out_print(res, "</table>"); |
1647 |
"<tr><td width=\"30%\"><b>Parameter</b></td><td width=\"70%\">" |
"<tr><td width=\"30%\"><b>Parameter</b></td><td width=\"70%\">" |
1648 |
"<b>Value</b></td></tr>"); |
"<b>Value</b></td></tr>"); |
1649 |
out_print(res, |
out_print(res, |
1650 |
"<tr><td>Name</a></td><td>%s</td></tr>", s->name); |
"<tr><td>Name</td><td>%s</td></tr>", s->name); |
1651 |
if(s->group) |
if(s->group) |
1652 |
out_print(res, |
out_print(res, |
1653 |
"<tr><td>Group</a></td><td><font color='#0000ff'>%s" |
"<tr><td>Group</td><td><font color='#0000ff'>%s" |
1654 |
"</font></td></tr>", s->group); |
"</font></td></tr>", s->group); |
1655 |
out_print(res, |
out_print(res, |
1656 |
"<tr><td>File status</a></td><td>%s</td></tr>", |
"<tr><td>File status</td><td>%s</td></tr>", |
1657 |
(s->perm&&s->perm->has_error)? |
(s->perm&&s->perm->has_error)? |
1658 |
"<font color='#ff0000'>Permission Error</font>": |
"<font color='#ff0000'>Permission Error</font>": |
1659 |
(s->uid&&s->uid->has_error)? |
(s->uid&&s->uid->has_error)? |
1664 |
"<font color='#00ff00'>Exist</font>": |
"<font color='#00ff00'>Exist</font>": |
1665 |
"<font color='#ff0000'>Doesn't Exist</font>"); |
"<font color='#ff0000'>Doesn't Exist</font>"); |
1666 |
out_print(res, |
out_print(res, |
1667 |
"<tr><td>Path</a></td><td>%s</td></tr>", |
"<tr><td>Path</td><td>%s</td></tr>", |
1668 |
s->path); |
s->path); |
1669 |
out_print(res, |
out_print(res, |
1670 |
"<tr><td>Monitoring mode</a></td><td>%s</td></tr>", |
"<tr><td>Monitoring mode</td><td>%s</td></tr>", |
1671 |
modenames[s->mode]); |
modenames[s->mode]); |
1672 |
out_print(res, |
out_print(res, |
1673 |
"<tr><td>Monitoring status</a></td><td><font color='#ff8800'>%s" |
"<tr><td>Monitoring status</td><td><font color='#ff8800'>%s" |
1674 |
"</font></td></tr>", |
"</font></td></tr>", statusnames[s->do_monitor]); |
|
statusnames[s->do_monitor]); |
|
1675 |
if(s->start) { |
if(s->start) { |
1676 |
int i = 0; |
int i = 0; |
1677 |
|
|
1678 |
out_print(res, "<tr><td>Start program</a></td><td>"); |
out_print(res, "<tr><td>Start program</td><td>"); |
1679 |
while(s->start->arg[i]) |
while(s->start->arg[i]) |
1680 |
out_print(res, "%s ", s->start->arg[i++]); |
out_print(res, "%s ", s->start->arg[i++]); |
1681 |
printf("</td></tr>"); |
out_print(res, "</td></tr>"); |
1682 |
} |
} |
1683 |
if(s->stop) { |
if(s->stop) { |
1684 |
int i = 0; |
int i = 0; |
1685 |
|
|
1686 |
out_print(res, "<tr><td>Stop program</a></td><td>"); |
out_print(res, "<tr><td>Stop program</td><td>"); |
1687 |
while(s->stop->arg[i]) |
while(s->stop->arg[i]) |
1688 |
out_print(res, "%s ", s->stop->arg[i++]); |
out_print(res, "%s ", s->stop->arg[i++]); |
1689 |
printf("</td></tr>"); |
out_print(res, "</td></tr>"); |
1690 |
} |
} |
1691 |
{ |
{ |
1692 |
Dependant_T d; |
Dependant_T d; |
1693 |
|
|
1694 |
for(d= s->dependantlist; d; d= d->next) { |
for(d= s->dependantlist; d; d= d->next) { |
1695 |
if(d->dependant != NULL) { |
if(d->dependant != NULL) { |
1696 |
out_print(res,"<tr><td>Depends on service </a></td>" |
out_print(res,"<tr><td>Depends on service</td>" |
1697 |
"<td> <a href=%s> %s </a></td></tr>", |
"<td> <a href=%s> %s </a></td></tr>", |
1698 |
d->dependant, d->dependant); |
d->dependant, d->dependant); |
1699 |
} |
} |
1704 |
for(t= s->timestamplist; t; t= t->next) { |
for(t= s->timestamplist; t; t= t->next) { |
1705 |
if(t->test_changes) { |
if(t->test_changes) { |
1706 |
out_print(res, |
out_print(res, |
1707 |
"<tr><td>Associated timestamp</a></td>" |
"<tr><td>Associated timestamp</td>" |
1708 |
"<td>If changed then %s</td></tr>", |
"<td>If changed then %s</td></tr>", |
1709 |
actionnames[t->action]); |
actionnames[t->action]); |
1710 |
} else { |
} else { |
1711 |
out_print(res, |
out_print(res, |
1712 |
"<tr><td>Associated timestamp</a></td>" |
"<tr><td>Associated timestamp</td>" |
1713 |
"<td>If %s %d second(s) then %s</td></tr>", |
"<td>If %s %d second(s) then %s</td></tr>", |
1714 |
operatornames[t->operator], |
operatornames[t->operator], |
1715 |
t->time, actionnames[t->action]); |
t->time, actionnames[t->action]); |
1721 |
for(sl= s->sizelist; sl; sl= sl->next) { |
for(sl= s->sizelist; sl; sl= sl->next) { |
1722 |
if(sl->test_changes) { |
if(sl->test_changes) { |
1723 |
out_print(res, |
out_print(res, |
1724 |
"<tr><td>Associated size</a></td>" |
"<tr><td>Associated size</td>" |
1725 |
"<td>If changed then %s</td></tr>", |
"<td>If changed then %s</td></tr>", |
1726 |
actionnames[sl->action]); |
actionnames[sl->action]); |
1727 |
} else { |
} else { |
1728 |
out_print(res, |
out_print(res, |
1729 |
"<tr><td>Associated size</a></td>" |
"<tr><td>Associated size</td>" |
1730 |
"<td>If %s %lu byte(s) then %s</td></tr>", |
"<td>If %s %lu byte(s) then %s</td></tr>", |
1731 |
operatornames[sl->operator], |
operatornames[sl->operator], |
1732 |
sl->size, actionnames[sl->action]); |
sl->size, actionnames[sl->action]); |
1734 |
} |
} |
1735 |
} |
} |
1736 |
if(s->checksum) |
if(s->checksum) |
1737 |
out_print(res, "<tr><td>Associated checksum</a></td><td>" |
out_print(res, "<tr><td>Associated checksum</td><td>" |
1738 |
"if failed %s then %s</td></tr>", |
"if failed %s then %s</td></tr>", |
1739 |
s->checksum->md5, actionnames[s->checksum->action]); |
s->checksum->md5, actionnames[s->checksum->action]); |
1740 |
if(s->perm) |
if(s->perm) |
1741 |
out_print(res, "<tr><td>Associated permission</a></td><td>" |
out_print(res, "<tr><td>Associated permission</td><td>" |
1742 |
"if failed %o then %s</td></tr>", |
"if failed %o then %s</td></tr>", |
1743 |
s->perm->perm, actionnames[s->perm->action]); |
s->perm->perm, actionnames[s->perm->action]); |
1744 |
if(s->uid) |
if(s->uid) |
1745 |
out_print(res, "<tr><td>Associated UID</a></td><td>" |
out_print(res, "<tr><td>Associated UID</td><td>" |
1746 |
"if failed %d then %s</td></tr>", |
"if failed %d then %s</td></tr>", |
1747 |
(int)s->uid->uid, actionnames[s->uid->action]); |
(int)s->uid->uid, actionnames[s->uid->action]); |
1748 |
if(s->gid) |
if(s->gid) |
1749 |
out_print(res, "<tr><td>Associated GID</a></td><td>" |
out_print(res, "<tr><td>Associated GID</td><td>" |
1750 |
"if failed %d then %s</td></tr>", |
"if failed %d then %s</td></tr>", |
1751 |
(int)s->gid->gid, actionnames[s->gid->action]); |
(int)s->gid->gid, actionnames[s->gid->action]); |
1752 |
out_print(res, |
out_print(res, |
1753 |
"<tr><td>Check service</a></td><td>Every %d cycle</td></tr>", |
"<tr><td>Check service</td><td>Every %d cycle</td></tr>", |
1754 |
s->every?s->every:1); |
s->every?s->every:1); |
1755 |
if(s->def_timeout) { |
if(s->def_timeout) { |
1756 |
out_print(res, |
out_print(res, |
1757 |
"<tr><td>Timeout</a></td><td>" |
"<tr><td>Timeout</td><td>" |
1758 |
"Timeout if %d restart within %d cycles</td></tr>", |
"Timeout if %d restart within %d cycles</td></tr>", |
1759 |
s->to_start, s->to_cycle); |
s->to_start, s->to_cycle); |
1760 |
} |
} |
1761 |
out_print(res, |
out_print(res, |
1762 |
"<tr><td>Size</a></td><td>%lu B</td></tr>", |
"<tr><td>Size</td><td>%lu B</td></tr>", |
1763 |
(unsigned long)stat_buf.st_size); |
(unsigned long)stat_buf.st_size); |
1764 |
out_print(res, |
out_print(res, |
1765 |
"<tr><td>Permission</a></td><td>%s%o</td></tr>", |
"<tr><td>Permission</td><td>%s%o</td></tr>", |
1766 |
(s->perm&&s->perm->has_error)? |
(s->perm&&s->perm->has_error)? |
1767 |
"<font color='#ff0000'>": |
"<font color='#ff0000'>": |
1768 |
"<font>", |
"<font>", |
1769 |
stat_buf.st_mode & 07777); |
stat_buf.st_mode & 07777); |
1770 |
out_print(res, |
out_print(res, |
1771 |
"<tr><td>UID</a></td><td>%s%d</font></td></tr>", |
"<tr><td>UID</td><td>%s%d</font></td></tr>", |
1772 |
(s->uid&&s->uid->has_error)? |
(s->uid&&s->uid->has_error)? |
1773 |
"<font color='#ff0000'>": |
"<font color='#ff0000'>": |
1774 |
"<font>", |
"<font>", |
1775 |
(int)stat_buf.st_uid); |
(int)stat_buf.st_uid); |
1776 |
out_print(res, |
out_print(res, |
1777 |
"<tr><td>GID</a></td><td>%s%d</font></td></tr>", |
"<tr><td>GID</td><td>%s%d</font></td></tr>", |
1778 |
(s->gid&&s->gid->has_error)? |
(s->gid&&s->gid->has_error)? |
1779 |
"<font color='#ff0000'>": |
"<font color='#ff0000'>": |
1780 |
"<font>", |
"<font>", |
1783 |
Mail_T r; |
Mail_T r; |
1784 |
for(r= s->maillist; r; r= r->next) { |
for(r= s->maillist; r; r= r->next) { |
1785 |
out_print(res, |
out_print(res, |
1786 |
"<tr bgcolor=\"#EFEFEF\"><td>Alert mail to</a></td><td>%s" |
"<tr bgcolor=\"#EFEFEF\"><td>Alert mail to</td><td>%s" |
1787 |
"</td></tr>", r->to?r->to:""); |
"</td></tr>", r->to?r->to:""); |
|
out_print(res, |
|
|
"<tr><td>Alert from</a></td><td>%s</td></tr>", |
|
|
r->from?r->from:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert subject</a></td><td>%s</td></tr>", |
|
|
r->subject?r->subject:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert message</a></td><td>%s</td></tr>", |
|
|
r->message?r->message:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on start</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_START)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on stop</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_STOP)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on restart</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_RESTART)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on checksum</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_CHECKSUM)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on exceeded resource</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_RESOURCE)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on timeout</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_TIMEOUT)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on timestamp</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_TIMESTAMP)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on connection</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_CONNECTION)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on size</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_SIZE)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on permission</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_PERMISSION)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on uid</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_UID)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on gid</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_GID)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on unmonitor</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_UNMONITOR)?"yes":"no"); |
|
1788 |
} |
} |
1789 |
} |
} |
1790 |
out_print(res, "</table>"); |
out_print(res, "</table>"); |
1835 |
"<tr><td width=\"30%\"><b>Parameter</b></td>" |
"<tr><td width=\"30%\"><b>Parameter</b></td>" |
1836 |
"<td width=\"70%\"><b>Value</b></td></tr>"); |
"<td width=\"70%\"><b>Value</b></td></tr>"); |
1837 |
out_print(res, |
out_print(res, |
1838 |
"<tr><td>Name</a></td><td>%s</td></tr>", s->name); |
"<tr><td>Name</td><td>%s</td></tr>", s->name); |
1839 |
if(s->group) |
if(s->group) |
1840 |
out_print(res, |
out_print(res, |
1841 |
"<tr><td>Group</a></td><td><font color='#0000ff'>%s" |
"<tr><td>Group</td><td><font color='#0000ff'>%s" |
1842 |
"</font></td></tr>", s->group); |
"</font></td></tr>", s->group); |
1843 |
out_print(res, |
out_print(res, |
1844 |
"<tr><td>Process id </a></td><td>%d</td></tr>", run); |
"<tr><td>Process id </td><td>%d</td></tr>", run); |
1845 |
out_print(res, |
out_print(res, |
1846 |
"<tr><td>Process status</a></td><td>%s</td></tr>", |
"<tr><td>Process status</td><td>%s</td></tr>", |
1847 |
run?"<font color='#00ff00'>Running</font>": |
run?"<font color='#00ff00'>Running</font>": |
1848 |
"<font color='#ff0000'>Not Running</font>"); |
"<font color='#ff0000'>Not Running</font>"); |
1849 |
out_print(res, |
out_print(res, |
1850 |
"<tr><td>Pid file</a></td><td>%s</td></tr>", |
"<tr><td>Pid file</td><td>%s</td></tr>", |
1851 |
s->path); |
s->path); |
1852 |
out_print(res, |
out_print(res, |
1853 |
"<tr><td>Monitoring mode</a></td><td>%s</td></tr>", |
"<tr><td>Monitoring mode</td><td>%s</td></tr>", |
1854 |
modenames[s->mode]); |
modenames[s->mode]); |
1855 |
out_print(res, |
out_print(res, |
1856 |
"<tr><td>Monitoring status</a></td><td><font color='#ff8800'>%s" |
"<tr><td>Monitoring status</td><td><font color='#ff8800'>%s" |
1857 |
"</font></td></tr>", |
"</font></td></tr>", |
1858 |
statusnames[s->do_monitor]); |
statusnames[s->do_monitor]); |
1859 |
if(s->start) { |
if(s->start) { |
1860 |
int i = 0; |
int i = 0; |
1861 |
|
|
1862 |
out_print(res, "<tr><td>Start program</a></td><td>"); |
out_print(res, "<tr><td>Start program</td><td>"); |
1863 |
while(s->start->arg[i]) |
while(s->start->arg[i]) |
1864 |
out_print(res, "%s ", s->start->arg[i++]); |
out_print(res, "%s ", s->start->arg[i++]); |
1865 |
printf("</td></tr>"); |
out_print(res, "</td></tr>"); |
1866 |
} |
} |
1867 |
if(s->stop) { |
if(s->stop) { |
1868 |
int i = 0; |
int i = 0; |
1869 |
|
|
1870 |
out_print(res, "<tr><td>Stop program</a></td><td>"); |
out_print(res, "<tr><td>Stop program</td><td>"); |
1871 |
while(s->stop->arg[i]) |
while(s->stop->arg[i]) |
1872 |
out_print(res, "%s ", s->stop->arg[i++]); |
out_print(res, "%s ", s->stop->arg[i++]); |
1873 |
printf("</td></tr>"); |
out_print(res, "</td></tr>"); |
1874 |
} |
} |
1875 |
{ |
{ |
1876 |
Dependant_T d; |
Dependant_T d; |
1877 |
|
|
1878 |
for(d= s->dependantlist; d; d= d->next) { |
for(d= s->dependantlist; d; d= d->next) { |
1879 |
if(d->dependant != NULL) { |
if(d->dependant != NULL) { |
1880 |
out_print(res,"<tr><td>Depends on service </a></td>" |
out_print(res,"<tr><td>Depends on service </td>" |
1881 |
"<td> <a href=%s> %s </a></td></tr>", |
"<td> <a href=%s> %s </a></td></tr>", |
1882 |
d->dependant, d->dependant); |
d->dependant, d->dependant); |
1883 |
} |
} |
1887 |
ProcInfo_T pi= s->procinfo; |
ProcInfo_T pi= s->procinfo; |
1888 |
|
|
1889 |
out_print(res, |
out_print(res, |
1890 |
"<tr><td>CPU usage</a></td><td>%.1f%%</td></tr>", |
"<tr><td>CPU usage</td><td>%.1f%%</td></tr>", |
1891 |
pi->cpu_percent/10.0); |
pi->cpu_percent/10.0); |
1892 |
out_print(res, |
out_print(res, |
1893 |
"<tr><td>Memory usage</a></td><td>%.1f%% [%ldkB]</td></tr>", |
"<tr><td>Memory usage</td><td>%.1f%% [%ldkB]</td></tr>", |
1894 |
pi->mem_percent/10.0,pi->mem_kbyte); |
pi->mem_percent/10.0,pi->mem_kbyte); |
1895 |
out_print(res, |
out_print(res, |
1896 |
"<tr><td>Children</a></td><td>%d</td></tr>", |
"<tr><td>Children</td><td>%d</td></tr>", |
1897 |
pi->children); |
pi->children); |
1898 |
out_print(res, |
out_print(res, |
1899 |
"<tr><td>Total memory usage (incl. children) </a></td>" |
"<tr><td>Total memory usage (incl. children) </td>" |
1900 |
"<td>%.1f%% [%ldkB]</td></tr>", |
"<td>%.1f%% [%ldkB]</td></tr>", |
1901 |
pi->total_mem_percent/10.0,pi->total_mem_kbyte); |
pi->total_mem_percent/10.0,pi->total_mem_kbyte); |
1902 |
} |
} |
1906 |
if(n->family == AF_INET) { |
if(n->family == AF_INET) { |
1907 |
if(n->SSL.use_ssl) { |
if(n->SSL.use_ssl) { |
1908 |
out_print(res, |
out_print(res, |
1909 |
"<tr><td>Host:Port</a></td>" |
"<tr><td>Host:Port</td>" |
1910 |
"<td>if failed %s:%d%s [%s via SSL] then %s</td>" |
"<td>if failed %s:%d%s [%s via SSL] then %s</td>" |
1911 |
"</tr>", n->hostname, n->port, n->request?n->request:"", |
"</tr>", n->hostname, n->port, n->request?n->request:"", |
1912 |
n->protocol->name, actionnames[n->action]); |
n->protocol->name, actionnames[n->action]); |
1913 |
|
|
1914 |
if(n->SSL.certmd5 != NULL) { |
if(n->SSL.certmd5 != NULL) { |
1915 |
out_print(res, |
out_print(res, |
1916 |
"<tr><td>Server certificate md5 sum</a></td><td>%s</td></tr>", |
"<tr><td>Server certificate md5 sum</td><td>%s</td></tr>", |
1917 |
n->SSL.certmd5); |
n->SSL.certmd5); |
1918 |
} |
} |
1919 |
} else { |
} else { |
1939 |
|
|
1940 |
case RESOURCE_ID_CPU_PERCENT: |
case RESOURCE_ID_CPU_PERCENT: |
1941 |
|
|
1942 |
out_print(res,"<tr><td>CPU usage limit</a></td>" |
out_print(res,"<tr><td>CPU usage limit</td>" |
1943 |
"<td>If %s %.1f%% for %d cycle(s) then %s</td></tr>", |
"<td>If %s %.1f%% for %d cycle(s) then %s</td></tr>", |
1944 |
operatornames[q->operator], |
operatornames[q->operator], |
1945 |
q->limit/10.0, q->max_cycle, |
q->limit/10.0, q->max_cycle, |
1948 |
|
|
1949 |
case RESOURCE_ID_MEM_PERCENT: |
case RESOURCE_ID_MEM_PERCENT: |
1950 |
|
|
1951 |
out_print(res,"<tr><td>Memory usage limit</a></td>" |
out_print(res,"<tr><td>Memory usage limit</td>" |
1952 |
"<td>If %s %.1f%% for %d cycle(s) then %s</td></tr>", |
"<td>If %s %.1f%% for %d cycle(s) then %s</td></tr>", |
1953 |
operatornames[q->operator], |
operatornames[q->operator], |
1954 |
q->limit/10.0, q->max_cycle, |
q->limit/10.0, q->max_cycle, |
1957 |
|
|
1958 |
case RESOURCE_ID_MEM_KBYTE: |
case RESOURCE_ID_MEM_KBYTE: |
1959 |
|
|
1960 |
out_print(res,"<tr><td>Memory amount limit</a></td>" |
out_print(res,"<tr><td>Memory amount limit</td>" |
1961 |
"<td>If %s %ld for %d cycle(s) then %s</td></tr>", |
"<td>If %s %ld for %d cycle(s) then %s</td></tr>", |
1962 |
operatornames[q->operator], |
operatornames[q->operator], |
1963 |
q->limit, q->max_cycle, |
q->limit, q->max_cycle, |
1966 |
|
|
1967 |
case RESOURCE_ID_LOAD1: |
case RESOURCE_ID_LOAD1: |
1968 |
|
|
1969 |
out_print(res,"<tr><td>Load average (1min)</a></td>" |
out_print(res,"<tr><td>Load average (1min)</td>" |
1970 |
"<td>If %s %.1f for %d cycle(s) then %s</td></tr>", |
"<td>If %s %.1f for %d cycle(s) then %s</td></tr>", |
1971 |
operatornames[q->operator], |
operatornames[q->operator], |
1972 |
q->limit/10.0, q->max_cycle, |
q->limit/10.0, q->max_cycle, |
1975 |
|
|
1976 |
case RESOURCE_ID_LOAD5: |
case RESOURCE_ID_LOAD5: |
1977 |
|
|
1978 |
out_print(res,"<tr><td>Load average (5min)</a></td>" |
out_print(res,"<tr><td>Load average (5min)</td>" |
1979 |
"<td>If %s %.1f for %d cycle(s) then %s</td></tr>", |
"<td>If %s %.1f for %d cycle(s) then %s</td></tr>", |
1980 |
operatornames[q->operator], |
operatornames[q->operator], |
1981 |
q->limit/10.0, q->max_cycle, |
q->limit/10.0, q->max_cycle, |
1983 |
break; |
break; |
1984 |
|
|
1985 |
case RESOURCE_ID_LOAD15: |
case RESOURCE_ID_LOAD15: |
1986 |
out_print(res,"<tr><td>Load average (15min)</a></td>" |
out_print(res,"<tr><td>Load average (15min)</td>" |
1987 |
"<td>If %s %.1f for %d cycle(s) then %s</td></tr>", |
"<td>If %s %.1f for %d cycle(s) then %s</td></tr>", |
1988 |
operatornames[q->operator], |
operatornames[q->operator], |
1989 |
q->limit/10.0, q->max_cycle, |
q->limit/10.0, q->max_cycle, |
1991 |
break; |
break; |
1992 |
|
|
1993 |
case RESOURCE_ID_CHILDREN: |
case RESOURCE_ID_CHILDREN: |
1994 |
out_print(res,"<tr><td>Children</a></td>" |
out_print(res,"<tr><td>Children</td>" |
1995 |
"<td>If %s %d for %d cycle(s) then %s</td></tr>", |
"<td>If %s %d for %d cycle(s) then %s</td></tr>", |
1996 |
operatornames[q->operator], |
operatornames[q->operator], |
1997 |
q->limit, q->max_cycle, |
q->limit, q->max_cycle, |
1999 |
break; |
break; |
2000 |
|
|
2001 |
case RESOURCE_ID_TOTAL_MEM_KBYTE: |
case RESOURCE_ID_TOTAL_MEM_KBYTE: |
2002 |
out_print(res,"<tr><td>Memory amount limit (incl. children)</a></td>" |
out_print(res,"<tr><td>Memory amount limit (incl. children)</td>" |
2003 |
"<td>If %s %d for %d cycle(s) then %s</td></tr>", |
"<td>If %s %d for %d cycle(s) then %s</td></tr>", |
2004 |
operatornames[q->operator], |
operatornames[q->operator], |
2005 |
q->limit, q->max_cycle, |
q->limit, q->max_cycle, |
2007 |
break; |
break; |
2008 |
|
|
2009 |
case RESOURCE_ID_TOTAL_MEM_PERCENT: |
case RESOURCE_ID_TOTAL_MEM_PERCENT: |
2010 |
out_print(res,"<tr><td>Memory usage limit (incl. children)</a></td>" |
out_print(res,"<tr><td>Memory usage limit (incl. children)</td>" |
2011 |
"<td>If %s %.1f%% for %d cycle(s) then %s</td></tr>", |
"<td>If %s %.1f%% for %d cycle(s) then %s</td></tr>", |
2012 |
operatornames[q->operator], |
operatornames[q->operator], |
2013 |
q->limit/10.0, q->max_cycle, |
q->limit/10.0, q->max_cycle, |
2018 |
} |
} |
2019 |
} |
} |
2020 |
out_print(res, |
out_print(res, |
2021 |
"<tr><td>Check service</a></td><td>Every %d cycle</td></tr>", |
"<tr><td>Check service</td><td>Every %d cycle</td></tr>", |
2022 |
s->every?s->every:1); |
s->every?s->every:1); |
2023 |
if(s->def_timeout) { |
if(s->def_timeout) { |
2024 |
out_print(res, |
out_print(res, |
2025 |
"<tr><td>Timeout</a></td><td>" |
"<tr><td>Timeout</td><td>" |
2026 |
"Timeout if %d restart within %d cycles</td></tr>", |
"Timeout if %d restart within %d cycles</td></tr>", |
2027 |
s->to_start, s->to_cycle); |
s->to_start, s->to_cycle); |
2028 |
} |
} |
2030 |
Mail_T r; |
Mail_T r; |
2031 |
for(r= s->maillist; r; r= r->next) { |
for(r= s->maillist; r; r= r->next) { |
2032 |
out_print(res, |
out_print(res, |
2033 |
"<tr bgcolor=\"#EFEFEF\"><td>" |
"<tr bgcolor=\"#EFEFEF\"><td>Alert mail to</td><td>%s</td></tr>", |
|
"Alert mail to</a></td><td>%s</td></tr>", |
|
2034 |
r->to?r->to:""); |
r->to?r->to:""); |
|
out_print(res, |
|
|
"<tr><td>Alert from</a></td><td>%s</td></tr>", |
|
|
r->from?r->from:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert subject</a></td><td>%s</td></tr>", |
|
|
r->subject?r->subject:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert message</a></td><td>%s</td></tr>", |
|
|
r->message?r->message:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on start</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_START)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on stop</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_STOP)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on restart</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_RESTART)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on checksum</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_CHECKSUM)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on exceeded resource</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_RESOURCE)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on timeout</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_TIMEOUT)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on timestamp</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_TIMESTAMP)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on connection</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_CONNECTION)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on size</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_SIZE)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on permission</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_PERMISSION)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on uid</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_UID)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on gid</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_GID)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on unmonitor</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_UNMONITOR)?"yes":"no"); |
|
2035 |
} |
} |
2036 |
} |
} |
2037 |
out_print(res, "</table>"); |
out_print(res, "</table>"); |
2090 |
"<tr><td width=\"30%\"><b>Parameter</b></td>" |
"<tr><td width=\"30%\"><b>Parameter</b></td>" |
2091 |
"<td width=\"70%\"><b>Value</b></td></tr>"); |
"<td width=\"70%\"><b>Value</b></td></tr>"); |
2092 |
out_print(res, |
out_print(res, |
2093 |
"<tr><td>Name</a></td><td>%s</td></tr>", s->name); |
"<tr><td>Name</td><td>%s</td></tr>", s->name); |
2094 |
if(s->group) |
if(s->group) |
2095 |
out_print(res, |
out_print(res, |
2096 |
"<tr><td>Group</a></td><td><font color='#0000ff'>%s" |
"<tr><td>Group</td><td><font color='#0000ff'>%s" |
2097 |
"</font></td></tr>", s->group); |
"</font></td></tr>", s->group); |
2098 |
out_print(res, |
out_print(res, |
2099 |
"<tr><td>Remote status</a></td><td>%s</td></tr>", |
"<tr><td>Remote status</td><td>%s</td></tr>", |
2100 |
available?"<font color='#00ff00'>Available</font>": |
available?"<font color='#00ff00'>Available</font>": |
2101 |
"<font color='#ff0000'>Not available</font>"); |
"<font color='#ff0000'>Not available</font>"); |
2102 |
out_print(res, |
out_print(res, |
2103 |
"<tr><td>Monitoring mode</a></td><td>%s</td></tr>", |
"<tr><td>Monitoring mode</td><td>%s</td></tr>", |
2104 |
modenames[s->mode]); |
modenames[s->mode]); |
2105 |
out_print(res, |
out_print(res, |
2106 |
"<tr><td>Monitoring status</a></td><td><font color='#ff8800'>%s" |
"<tr><td>Monitoring status</td><td><font color='#ff8800'>%s" |
2107 |
"</font></td></tr>", |
"</font></td></tr>", |
2108 |
statusnames[s->do_monitor]); |
statusnames[s->do_monitor]); |
2109 |
if(s->start) { |
if(s->start) { |
2110 |
int i = 0; |
int i = 0; |
2111 |
|
|
2112 |
out_print(res, "<tr><td>Start program</a></td><td>"); |
out_print(res, "<tr><td>Start program</td><td>"); |
2113 |
while(s->start->arg[i]) |
while(s->start->arg[i]) |
2114 |
out_print(res, "%s ", s->start->arg[i++]); |
out_print(res, "%s ", s->start->arg[i++]); |
2115 |
printf("</td></tr>"); |
out_print(res, "</td></tr>"); |
2116 |
} |
} |
2117 |
if(s->stop) { |
if(s->stop) { |
2118 |
int i = 0; |
int i = 0; |
2119 |
|
|
2120 |
out_print(res, "<tr><td>Stop program</a></td><td>"); |
out_print(res, "<tr><td>Stop program</td><td>"); |
2121 |
while(s->stop->arg[i]) |
while(s->stop->arg[i]) |
2122 |
out_print(res, "%s ", s->stop->arg[i++]); |
out_print(res, "%s ", s->stop->arg[i++]); |
2123 |
printf("</td></tr>"); |
out_print(res, "</td></tr>"); |
2124 |
} |
} |
2125 |
{ |
{ |
2126 |
Dependant_T d; |
Dependant_T d; |
2127 |
|
|
2128 |
for(d= s->dependantlist; d; d= d->next) { |
for(d= s->dependantlist; d; d= d->next) { |
2129 |
if(d->dependant != NULL) { |
if(d->dependant != NULL) { |
2130 |
out_print(res,"<tr><td>Depends on service </a></td>" |
out_print(res,"<tr><td>Depends on service </td>" |
2131 |
"<td> <a href=%s> %s </a></td></tr>", |
"<td> <a href=%s> %s </a></td></tr>", |
2132 |
d->dependant, d->dependant); |
d->dependant, d->dependant); |
2133 |
} |
} |
2139 |
if(n->family == AF_INET) { |
if(n->family == AF_INET) { |
2140 |
if(n->SSL.use_ssl) { |
if(n->SSL.use_ssl) { |
2141 |
out_print(res, |
out_print(res, |
2142 |
"<tr><td>Host:Port</a></td>" |
"<tr><td>Host:Port</td>" |
2143 |
"<td>if failed %s:%d%s [%s via SSL] then %s</td></tr>", |
"<td>if failed %s:%d%s [%s via SSL] then %s</td></tr>", |
2144 |
n->hostname, n->port, n->request?n->request:"", |
n->hostname, n->port, n->request?n->request:"", |
2145 |
n->protocol->name, actionnames[n->action]); |
n->protocol->name, actionnames[n->action]); |
2146 |
|
|
2147 |
if(n->SSL.certmd5 != NULL) { |
if(n->SSL.certmd5 != NULL) { |
2148 |
out_print(res, |
out_print(res, |
2149 |
"<tr><td>Server certificate md5 sum</a></td><td>%s</td></tr>", |
"<tr><td>Server certificate md5 sum</td><td>%s</td></tr>", |
2150 |
n->SSL.certmd5); |
n->SSL.certmd5); |
2151 |
} |
} |
2152 |
} else { |
} else { |
2153 |
out_print(res, |
out_print(res, |
2154 |
"<tr><td>Host:Port</a></td>" |
"<tr><td>Host:Port</td>" |
2155 |
"<td>if failed %s:%d%s [%s] then %s</td></tr>", |
"<td>if failed %s:%d%s [%s] then %s</td></tr>", |
2156 |
n->hostname, n->port, n->request?n->request:"", |
n->hostname, n->port, n->request?n->request:"", |
2157 |
n->protocol->name, actionnames[n->action]); |
n->protocol->name, actionnames[n->action]); |
2165 |
} |
} |
2166 |
} |
} |
2167 |
out_print(res, |
out_print(res, |
2168 |
"<tr><td>Check service</a></td><td>Every %d cycle</td></tr>", |
"<tr><td>Check service</td><td>Every %d cycle</td></tr>", |
2169 |
s->every?s->every:1); |
s->every?s->every:1); |
2170 |
if(s->def_timeout) { |
if(s->def_timeout) { |
2171 |
out_print(res, |
out_print(res, |
2172 |
"<tr><td>Timeout</a></td><td>" |
"<tr><td>Timeout</td><td>" |
2173 |
"Timeout if %d restart within %d cycles</td></tr>", |
"Timeout if %d restart within %d cycles</td></tr>", |
2174 |
s->to_start, s->to_cycle); |
s->to_start, s->to_cycle); |
2175 |
} |
} |
2178 |
for(r= s->maillist; r; r= r->next) { |
for(r= s->maillist; r; r= r->next) { |
2179 |
out_print(res, |
out_print(res, |
2180 |
"<tr bgcolor=\"#EFEFEF\"><td>" |
"<tr bgcolor=\"#EFEFEF\"><td>" |
2181 |
"Alert mail to</a></td><td>%s</td></tr>", |
"Alert mail to</td><td>%s</td></tr>", |
2182 |
r->to?r->to:""); |
r->to?r->to:""); |
|
out_print(res, |
|
|
"<tr><td>Alert from</a></td><td>%s</td></tr>", |
|
|
r->from?r->from:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert subject</a></td><td>%s</td></tr>", |
|
|
r->subject?r->subject:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert message</a></td><td>%s</td></tr>", |
|
|
r->message?r->message:"(default)"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on stop</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_STOP)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on restart</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_RESTART)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on timeout</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_TIMEOUT)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on connection</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_CONNECTION)?"yes":"no"); |
|
|
out_print(res, |
|
|
"<tr><td>Alert on unmonitor</a></td><td>%s</td></tr>", |
|
|
IS_EVENT_SET(r->events, EVENT_UNMONITOR)?"yes":"no"); |
|
2183 |
} |
} |
2184 |
} |
} |
2185 |
out_print(res, "</table>"); |
out_print(res, "</table>"); |