"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/http/cervlet.c" between
monit-5.25.3.tar.gz and monit-5.26.0.tar.gz

About: Monit is a utility for managing and monitoring processes, files, directories and filesystems (with automatic error recovery).

cervlet.c  (monit-5.25.3):cervlet.c  (monit-5.26.0)
skipping to change at line 378 skipping to change at line 378
s->inf.filesystem->f_bsize > 0 ? Fmt_byt es2str(s->inf.filesystem->f_blocks * s->inf.filesystem->f_bsize, (char[10]){}) : "0 MB", s->inf.filesystem->f_bsize > 0 ? Fmt_byt es2str(s->inf.filesystem->f_blocks * s->inf.filesystem->f_bsize, (char[10]){}) : "0 MB",
s->inf.filesystem->f_blocks > 0 ? ((floa t)100 * (float)(s->inf.filesystem->f_blocksfreetotal - s->inf.filesystem->f_bloc ksfree) / (float)s->inf.filesystem->f_blocks) : 0); s->inf.filesystem->f_blocks > 0 ? ((floa t)100 * (float)(s->inf.filesystem->f_blocksfreetotal - s->inf.filesystem->f_bloc ksfree) / (float)s->inf.filesystem->f_blocks) : 0);
_formatStatus("space free for non superuser", Ev ent_Null, type, res, s, true, "%s [%.1f%%]", _formatStatus("space free for non superuser", Ev ent_Null, type, res, s, true, "%s [%.1f%%]",
s->inf.filesystem->f_bsize > 0 ? Fmt_byt es2str(s->inf.filesystem->f_blocksfree * s->inf.filesystem->f_bsize, (char[10]){ }) : "0 MB", s->inf.filesystem->f_bsize > 0 ? Fmt_byt es2str(s->inf.filesystem->f_blocksfree * s->inf.filesystem->f_bsize, (char[10]){ }) : "0 MB",
s->inf.filesystem->f_blocks > 0 ? ((floa t)100 * (float)s->inf.filesystem->f_blocksfree / (float)s->inf.filesystem->f_blo cks) : 0); s->inf.filesystem->f_blocks > 0 ? ((floa t)100 * (float)s->inf.filesystem->f_blocksfree / (float)s->inf.filesystem->f_blo cks) : 0);
_formatStatus("space free total", Event_Resource , type, res, s, true, "%s [%.1f%%]", _formatStatus("space free total", Event_Resource , type, res, s, true, "%s [%.1f%%]",
s->inf.filesystem->f_bsize > 0 ? Fmt_byt es2str(s->inf.filesystem->f_blocksfreetotal * s->inf.filesystem->f_bsize, (char[ 10]){}) : "0 MB", s->inf.filesystem->f_bsize > 0 ? Fmt_byt es2str(s->inf.filesystem->f_blocksfreetotal * s->inf.filesystem->f_bsize, (char[ 10]){}) : "0 MB",
s->inf.filesystem->f_blocks > 0 ? ((floa t)100 * (float)s->inf.filesystem->f_blocksfreetotal / (float)s->inf.filesystem-> f_blocks) : 0); s->inf.filesystem->f_blocks > 0 ? ((floa t)100 * (float)s->inf.filesystem->f_blocksfreetotal / (float)s->inf.filesystem-> f_blocks) : 0);
if (s->inf.filesystem->f_files > 0) { if (s->inf.filesystem->f_files > 0) {
_formatStatus("inodes total", Event_Null , type, res, s, true, "%lld", s->inf.filesystem->f_files); _formatStatus("inodes total", Event_Null , type, res, s, true, "%lld", s->inf.filesystem->f_files);
_formatStatus("inodes free", Event_Resou if (s->inf.filesystem->f_filesfree > 0)
rce, type, res, s, true, "%lld [%.1f%%]", s->inf.filesystem->f_filesfree, (float _formatStatus("inodes free", Eve
)100 * (float)s->inf.filesystem->f_filesfree / (float)s->inf.filesystem->f_files nt_Resource, type, res, s, true, "%lld [%.1f%%]", s->inf.filesystem->f_filesfree
); , (float)100 * (float)s->inf.filesystem->f_filesfree / (float)s->inf.filesystem-
>f_files);
} }
_printIOStatistics(type, res, s, &(s->inf.filesy stem->read), "read", "read"); _printIOStatistics(type, res, s, &(s->inf.filesy stem->read), "read", "read");
_printIOStatistics(type, res, s, &(s->inf.filesy stem->write), "write", "write"); _printIOStatistics(type, res, s, &(s->inf.filesy stem->write), "write", "write");
boolean_t hasReadTime = Statistics_initialized(& (s->inf.filesystem->time.read)); boolean_t hasReadTime = Statistics_initialized(& (s->inf.filesystem->time.read));
boolean_t hasWriteTime = Statistics_initialized( &(s->inf.filesystem->time.write)); boolean_t hasWriteTime = Statistics_initialized( &(s->inf.filesystem->time.write));
boolean_t hasWaitTime = Statistics_initialized(& (s->inf.filesystem->time.wait)); boolean_t hasWaitTime = Statistics_initialized(& (s->inf.filesystem->time.wait));
boolean_t hasRunTime = Statistics_initialized(&( s->inf.filesystem->time.run)); boolean_t hasRunTime = Statistics_initialized(&( s->inf.filesystem->time.run));
double deltaOperations = Statistics_delta(&(s->i nf.filesystem->read.operations)) + Statistics_delta(&(s->inf.filesystem->write.o perations)); double deltaOperations = Statistics_delta(&(s->i nf.filesystem->read.operations)) + Statistics_delta(&(s->inf.filesystem->write.o perations));
if (hasReadTime && hasWriteTime) { if (hasReadTime && hasWriteTime) {
double readTime = deltaOperations > 0. ? Statistics_deltaNormalize(&(s->inf.filesystem->time.read)) / deltaOperations : 0.; double readTime = deltaOperations > 0. ? Statistics_deltaNormalize(&(s->inf.filesystem->time.read)) / deltaOperations : 0.;
skipping to change at line 1025 skipping to change at line 1026
} }
} }
handle_runtime(req, res); handle_runtime(req, res);
} }
static void do_service(HttpRequest req, HttpResponse res, Service_T s) { static void do_service(HttpRequest req, HttpResponse res, Service_T s) {
char buf[STRLEN]; char buf[STRLEN];
ASSERT(s); ASSERT(s);
do_head(res, s->name, s->name, Run.polltime); do_head(res, s->name_escaped, s->name, Run.polltime);
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<h2>%s status</h2>" "<h2>%s status</h2>"
"<table id='status-table'>" "<table id='status-table'>"
"<tr>" "<tr>"
"<th width='30%%'>Parameter</th>" "<th width='30%%'>Parameter</th>"
"<th width='70%%'>Value</th>" "<th width='70%%'>Value</th>"
"</tr>" "</tr>"
"<tr>" "<tr>"
"<td>Name</td>" "<td>Name</td>"
"<td>%s</td>" "<td>%s</td>"
skipping to change at line 1062 skipping to change at line 1063
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<tr><td>Monitoring status</td><td>%s</td></tr>", ge t_monitoring_status(HTML, s, buf, sizeof(buf))); "<tr><td>Monitoring status</td><td>%s</td></tr>", ge t_monitoring_status(HTML, s, buf, sizeof(buf)));
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<tr><td>Monitoring mode</td><td>%s</td></tr>", mode names[s->mode]); "<tr><td>Monitoring mode</td><td>%s</td></tr>", mode names[s->mode]);
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<tr><td>On reboot</td><td>%s</td></tr>", onrebootna mes[s->onreboot]); "<tr><td>On reboot</td><td>%s</td></tr>", onrebootna mes[s->onreboot]);
for (Dependant_T d = s->dependantlist; d; d = d->next) { for (Dependant_T d = s->dependantlist; d; d = d->next) {
if (d->dependant != NULL) { if (d->dependant != NULL) {
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<tr><td>Depends on service </td><td > <a href=%s> %s </a></td></tr>", "<tr><td>Depends on service </td><td > <a href=%s> %s </a></td></tr>",
d->dependant, d->dependant); d->dependant_escaped, d->dependant);
} }
} }
if (s->start) { if (s->start) {
StringBuffer_append(res->outputbuffer, "<tr><td>Start program</t d><td>'%s'", Util_commandDescription(s->start, (char[STRLEN]){})); StringBuffer_append(res->outputbuffer, "<tr><td>Start program</t d><td>'%s'", Util_commandDescription(s->start, (char[STRLEN]){}));
if (s->start->has_uid) if (s->start->has_uid)
StringBuffer_append(res->outputbuffer, " as uid %d", s-> start->uid); StringBuffer_append(res->outputbuffer, " as uid %d", s-> start->uid);
if (s->start->has_gid) if (s->start->has_gid)
StringBuffer_append(res->outputbuffer, " as gid %d", s-> start->gid); StringBuffer_append(res->outputbuffer, " as gid %d", s-> start->gid);
StringBuffer_append(res->outputbuffer, " timeout %s", Fmt_time2s tr(s->start->timeout, (char[11]){})); StringBuffer_append(res->outputbuffer, " timeout %s", Fmt_time2s tr(s->start->timeout, (char[11]){}));
StringBuffer_append(res->outputbuffer, "</td></tr>"); StringBuffer_append(res->outputbuffer, "</td></tr>");
skipping to change at line 1163 skipping to change at line 1164
"<tr class='stripe'>" "<tr class='stripe'>"
"<td class='left'><a href='%s'>%s</a></td>" "<td class='left'><a href='%s'>%s</a></td>"
"<td class='left'>%s</td>" "<td class='left'>%s</td>"
"<td class='right column'>[%.2f]&nbsp;[%.2f]&nbsp;[% .2f]</td>" "<td class='right column'>[%.2f]&nbsp;[%.2f]&nbsp;[% .2f]</td>"
"<td class='right column'>" "<td class='right column'>"
"%.1f%%us,&nbsp;%.1f%%sy" "%.1f%%us,&nbsp;%.1f%%sy"
#ifdef HAVE_CPU_WAIT #ifdef HAVE_CPU_WAIT
",&nbsp;%.1f%%wa" ",&nbsp;%.1f%%wa"
#endif #endif
"</td>", "</td>",
s->name, s->name, s->name_escaped, s->name,
get_service_status(HTML, s, buf, sizeof(buf)), get_service_status(HTML, s, buf, sizeof(buf)),
systeminfo.loadavg[0], systeminfo.loadavg[1], system info.loadavg[2], systeminfo.loadavg[0], systeminfo.loadavg[1], system info.loadavg[2],
systeminfo.cpu.usage.user > 0. ? systeminfo.cpu.usag e.user : 0., systeminfo.cpu.usage.user > 0. ? systeminfo.cpu.usag e.user : 0.,
systeminfo.cpu.usage.system > 0. ? systeminfo.cpu.us age.system : 0. systeminfo.cpu.usage.system > 0. ? systeminfo.cpu.us age.system : 0.
#ifdef HAVE_CPU_WAIT #ifdef HAVE_CPU_WAIT
, systeminfo.cpu.usage.wait > 0. ? systeminfo.cpu.us age.wait : 0. , systeminfo.cpu.usage.wait > 0. ? systeminfo.cpu.us age.wait : 0.
#endif #endif
); );
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<td class='right column'>%.1f%% [%s]</td>", "<td class='right column'>%.1f%% [%s]</td>",
skipping to change at line 1210 skipping to change at line 1211
"<th class='right column'>Read</th>" "<th class='right column'>Read</th>"
"<th class='right column'>Write</th> " "<th class='right column'>Write</th> "
"</tr>"); "</tr>");
header = false; header = false;
} }
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<tr%s>" "<tr%s>"
"<td class='left'><a href='%s'>%s</a></td>" "<td class='left'><a href='%s'>%s</a></td>"
"<td class='left'>%s</td>", "<td class='left'>%s</td>",
on ? " class='stripe'" : "", on ? " class='stripe'" : "",
s->name, s->name, s->name_escaped, s->name,
get_service_status(HTML, s, buf, sizeof(buf) )); get_service_status(HTML, s, buf, sizeof(buf) ));
if (! (Run.flags & Run_ProcessEngineEnabled) || ! Util_hasServic eStatus(s) || s->inf.process->uptime < 0) { if (! (Run.flags & Run_ProcessEngineEnabled) || ! Util_hasServic eStatus(s) || s->inf.process->uptime < 0) {
StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>"); StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>");
} else { } else {
StringBuffer_append(res->outputbuffer, "<td class='right '>%s</td>", _getUptime(s->inf.process->uptime, (char[256]){})); StringBuffer_append(res->outputbuffer, "<td class='right '>%s</td>", _getUptime(s->inf.process->uptime, (char[256]){}));
} }
if (! (Run.flags & Run_ProcessEngineEnabled) || ! Util_hasServic eStatus(s) || s->inf.process->total_cpu_percent < 0) { if (! (Run.flags & Run_ProcessEngineEnabled) || ! Util_hasServic eStatus(s) || s->inf.process->total_cpu_percent < 0) {
StringBuffer_append(res->outputbuffer, "<td clas s='right'>-</td>"); StringBuffer_append(res->outputbuffer, "<td clas s='right'>-</td>");
} else { } else {
StringBuffer_append(res->outputbuffer, "<td class='right %s'>%.1f%%</td>", (s->error & Event_Resource) ? " red-text" : "", s->inf.process ->total_cpu_percent); StringBuffer_append(res->outputbuffer, "<td class='right %s'>%.1f%%</td>", (s->error & Event_Resource) ? " red-text" : "", s->inf.process ->total_cpu_percent);
skipping to change at line 1277 skipping to change at line 1278
"<th class='right'>Last started</th> " "<th class='right'>Last started</th> "
"<th class='right'>Exit value</th>" "<th class='right'>Exit value</th>"
"</tr>"); "</tr>");
header = false; header = false;
} }
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<tr %s>" "<tr %s>"
"<td class='left'><a href='%s'>%s</a></td>" "<td class='left'><a href='%s'>%s</a></td>"
"<td class='left'>%s</td>", "<td class='left'>%s</td>",
on ? "class='stripe'" : "", on ? "class='stripe'" : "",
s->name, s->name, s->name_escaped, s->name,
get_service_status(HTML, s, buf, sizeof(buf) )); get_service_status(HTML, s, buf, sizeof(buf) ));
if (! Util_hasServiceStatus(s)) { if (! Util_hasServiceStatus(s)) {
StringBuffer_append(res->outputbuffer, "<td class='left' >-</td>"); StringBuffer_append(res->outputbuffer, "<td class='left' >-</td>");
StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>"); StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>");
StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>"); StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>");
} else { } else {
if (s->program->started) { if (s->program->started) {
StringBuffer_append(res->outputbuffer, "<td clas s='left short'>"); StringBuffer_append(res->outputbuffer, "<td clas s='left short'>");
if (StringBuffer_length(s->program->lastOutput)) { if (StringBuffer_length(s->program->lastOutput)) {
// Print first line only (escape HTML ch aracters if any) // Print first line only (escape HTML ch aracters if any)
skipping to change at line 1345 skipping to change at line 1346
"<th class='right'>Upload</th>" "<th class='right'>Upload</th>"
"<th class='right'>Download</th>" "<th class='right'>Download</th>"
"</tr>"); "</tr>");
header = false; header = false;
} }
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<tr %s>" "<tr %s>"
"<td class='left'><a href='%s'>%s</a></td>" "<td class='left'><a href='%s'>%s</a></td>"
"<td class='left'>%s</td>", "<td class='left'>%s</td>",
on ? "class='stripe'" : "", on ? "class='stripe'" : "",
s->name, s->name, s->name_escaped, s->name,
get_service_status(HTML, s, buf, sizeof(buf) )); get_service_status(HTML, s, buf, sizeof(buf) ));
if (! Util_hasServiceStatus(s) || Link_getState(s->inf.net->stat s) != 1) { if (! Util_hasServiceStatus(s) || Link_getState(s->inf.net->stat s) != 1) {
StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>"); StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>");
StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>"); StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>");
} else { } else {
StringBuffer_append(res->outputbuffer, "<td class='right '>%s&#47;s</td>", Fmt_bytes2str(Link_getBytesOutPerSecond(s->inf.net->stats), bu f)); StringBuffer_append(res->outputbuffer, "<td class='right '>%s&#47;s</td>", Fmt_bytes2str(Link_getBytesOutPerSecond(s->inf.net->stats), bu f));
StringBuffer_append(res->outputbuffer, "<td class='right '>%s&#47;s</td>", Fmt_bytes2str(Link_getBytesInPerSecond(s->inf.net->stats), buf )); StringBuffer_append(res->outputbuffer, "<td class='right '>%s&#47;s</td>", Fmt_bytes2str(Link_getBytesInPerSecond(s->inf.net->stats), buf ));
} }
StringBuffer_append(res->outputbuffer, "</tr>"); StringBuffer_append(res->outputbuffer, "</tr>");
on = ! on; on = ! on;
skipping to change at line 1387 skipping to change at line 1388
"<th class='right column'>Read</th>" "<th class='right column'>Read</th>"
"<th class='right column'>Write</th> " "<th class='right column'>Write</th> "
"</tr>"); "</tr>");
header = false; header = false;
} }
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<tr %s>" "<tr %s>"
"<td class='left'><a href='%s'>%s</a></td>" "<td class='left'><a href='%s'>%s</a></td>"
"<td class='left'>%s</td>", "<td class='left'>%s</td>",
on ? "class='stripe'" : "", on ? "class='stripe'" : "",
s->name, s->name, s->name_escaped, s->name,
get_service_status(HTML, s, buf, sizeof(buf) )); get_service_status(HTML, s, buf, sizeof(buf) ));
if (! Util_hasServiceStatus(s)) { if (! Util_hasServiceStatus(s)) {
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<td class='right'>- [-]</td>" "<td class='right'>- [-]</td>"
"<td class='right'>- [-]</td>" "<td class='right'>- [-]</td>"
"<td class='right column'>- [-]</td> " "<td class='right column'>- [-]</td> "
"<td class='right column'>- [-]</td> "); "<td class='right column'>- [-]</td> ");
} else { } else {
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<td class='right column%s'>%.1f%% [ %s]</td>", "<td class='right column%s'>%.1f%% [ %s]</td>",
skipping to change at line 1453 skipping to change at line 1454
"<th class='right'>GID</th>" "<th class='right'>GID</th>"
"</tr>"); "</tr>");
header = false; header = false;
} }
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<tr %s>" "<tr %s>"
"<td class='left'><a href='%s'>%s</a></td>" "<td class='left'><a href='%s'>%s</a></td>"
"<td class='left'>%s</td>", "<td class='left'>%s</td>",
on ? "class='stripe'" : "", on ? "class='stripe'" : "",
s->name, s->name, s->name_escaped, s->name,
get_service_status(HTML, s, buf, sizeof(buf) )); get_service_status(HTML, s, buf, sizeof(buf) ));
if (! Util_hasServiceStatus(s) || s->inf.file->size < 0) if (! Util_hasServiceStatus(s) || s->inf.file->size < 0)
StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>"); StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>");
else else
StringBuffer_append(res->outputbuffer, "<td class='right '>%s</td>", Fmt_bytes2str(s->inf.file->size, (char[10]){})); StringBuffer_append(res->outputbuffer, "<td class='right '>%s</td>", Fmt_bytes2str(s->inf.file->size, (char[10]){}));
if (! Util_hasServiceStatus(s) || s->inf.file->mode < 0) if (! Util_hasServiceStatus(s) || s->inf.file->mode < 0)
StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>"); StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>");
else else
StringBuffer_append(res->outputbuffer, "<td class='right '>%04o</td>", s->inf.file->mode & 07777); StringBuffer_append(res->outputbuffer, "<td class='right '>%04o</td>", s->inf.file->mode & 07777);
if (! Util_hasServiceStatus(s) || s->inf.file->uid < 0) if (! Util_hasServiceStatus(s) || s->inf.file->uid < 0)
skipping to change at line 1503 skipping to change at line 1504
"<th class='right'>UID</th>" "<th class='right'>UID</th>"
"<th class='right'>GID</th>" "<th class='right'>GID</th>"
"</tr>"); "</tr>");
header = false; header = false;
} }
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<tr %s>" "<tr %s>"
"<td class='left'><a href='%s'>%s</a></td>" "<td class='left'><a href='%s'>%s</a></td>"
"<td class='left'>%s</td>", "<td class='left'>%s</td>",
on ? "class='stripe'" : "", on ? "class='stripe'" : "",
s->name, s->name, s->name_escaped, s->name,
get_service_status(HTML, s, buf, sizeof(buf) )); get_service_status(HTML, s, buf, sizeof(buf) ));
if (! Util_hasServiceStatus(s) || s->inf.fifo->mode < 0) if (! Util_hasServiceStatus(s) || s->inf.fifo->mode < 0)
StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>"); StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>");
else else
StringBuffer_append(res->outputbuffer, "<td class='right '>%04o</td>", s->inf.fifo->mode & 07777); StringBuffer_append(res->outputbuffer, "<td class='right '>%04o</td>", s->inf.fifo->mode & 07777);
if (! Util_hasServiceStatus(s) || s->inf.fifo->uid < 0) if (! Util_hasServiceStatus(s) || s->inf.fifo->uid < 0)
StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>"); StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>");
else else
StringBuffer_append(res->outputbuffer, "<td class='right '>%d</td>", s->inf.fifo->uid); StringBuffer_append(res->outputbuffer, "<td class='right '>%d</td>", s->inf.fifo->uid);
if (! Util_hasServiceStatus(s) || s->inf.fifo->gid < 0) if (! Util_hasServiceStatus(s) || s->inf.fifo->gid < 0)
skipping to change at line 1549 skipping to change at line 1550
"<th class='right'>UID</th>" "<th class='right'>UID</th>"
"<th class='right'>GID</th>" "<th class='right'>GID</th>"
"</tr>"); "</tr>");
header = false; header = false;
} }
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<tr %s>" "<tr %s>"
"<td class='left'><a href='%s'>%s</a></td>" "<td class='left'><a href='%s'>%s</a></td>"
"<td class='left'>%s</td>", "<td class='left'>%s</td>",
on ? "class='stripe'" : "", on ? "class='stripe'" : "",
s->name, s->name, s->name_escaped, s->name,
get_service_status(HTML, s, buf, sizeof(buf) )); get_service_status(HTML, s, buf, sizeof(buf) ));
if (! Util_hasServiceStatus(s) || s->inf.directory->mode < 0) if (! Util_hasServiceStatus(s) || s->inf.directory->mode < 0)
StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>"); StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>");
else else
StringBuffer_append(res->outputbuffer, "<td class='right '>%04o</td>", s->inf.directory->mode & 07777); StringBuffer_append(res->outputbuffer, "<td class='right '>%04o</td>", s->inf.directory->mode & 07777);
if (! Util_hasServiceStatus(s) || s->inf.directory->uid < 0) if (! Util_hasServiceStatus(s) || s->inf.directory->uid < 0)
StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>"); StringBuffer_append(res->outputbuffer, "<td class='right '>-</td>");
else else
StringBuffer_append(res->outputbuffer, "<td class='right '>%d</td>", s->inf.directory->uid); StringBuffer_append(res->outputbuffer, "<td class='right '>%d</td>", s->inf.directory->uid);
if (! Util_hasServiceStatus(s) || s->inf.directory->gid < 0) if (! Util_hasServiceStatus(s) || s->inf.directory->gid < 0)
skipping to change at line 1593 skipping to change at line 1594
"<th class='left'>Status</th>" "<th class='left'>Status</th>"
"<th class='right'>Protocol(s)</th>" "<th class='right'>Protocol(s)</th>"
"</tr>"); "</tr>");
header = false; header = false;
} }
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<tr %s>" "<tr %s>"
"<td class='left'><a href='%s'>%s</a></td>" "<td class='left'><a href='%s'>%s</a></td>"
"<td class='left'>%s</td>", "<td class='left'>%s</td>",
on ? "class='stripe'" : "", on ? "class='stripe'" : "",
s->name, s->name, s->name_escaped, s->name,
get_service_status(HTML, s, buf, sizeof(buf) )); get_service_status(HTML, s, buf, sizeof(buf) ));
if (! Util_hasServiceStatus(s)) { if (! Util_hasServiceStatus(s)) {
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<td class='right'>-</td>"); "<td class='right'>-</td>");
} else { } else {
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<td class='right'>"); "<td class='right'>");
for (Icmp_T icmp = s->icmplist; icmp; icmp = icmp->next) { for (Icmp_T icmp = s->icmplist; icmp; icmp = icmp->next) {
if (icmp != s->icmplist) if (icmp != s->icmplist)
StringBuffer_append(res->outputbuffer, " &nbsp;&nbsp;<b>|</b>&nbsp;&nbsp;"); StringBuffer_append(res->outputbuffer, " &nbsp;&nbsp;<b>|</b>&nbsp;&nbsp;");
skipping to change at line 1743 skipping to change at line 1744
StringBuffer_append(res->outputbuffer, "<table id='buttons'><tr>"); StringBuffer_append(res->outputbuffer, "<table id='buttons'><tr>");
/* Start program */ /* Start program */
if (s->start) if (s->start)
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<td>" "<td>"
"<form method=POST action=%s>" "<form method=POST action=%s>"
"<input type=hidden name='securitytoken' val ue='%s'>" "<input type=hidden name='securitytoken' val ue='%s'>"
"<input type=hidden value='start' name=actio n>" "<input type=hidden value='start' name=actio n>"
"<input type=submit value='Start service'>" "<input type=submit value='Start service'>"
"</form>" "</form>"
"</td>", s->name, res->token); "</td>", s->name_escaped, res->token);
/* Stop program */ /* Stop program */
if (s->stop) if (s->stop)
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<td>" "<td>"
"<form method=POST action=%s>" "<form method=POST action=%s>"
"<input type=hidden name='securitytoken' val ue='%s'>" "<input type=hidden name='securitytoken' val ue='%s'>"
"<input type=hidden value='stop' name=action >" "<input type=hidden value='stop' name=action >"
"<input type=submit value='Stop service'>" "<input type=submit value='Stop service'>"
"</form>" "</form>"
"</td>", s->name, res->token); "</td>", s->name_escaped, res->token);
/* Restart program */ /* Restart program */
if ((s->start && s->stop) || s->restart) if ((s->start && s->stop) || s->restart)
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<td>" "<td>"
"<form method=POST action=%s>" "<form method=POST action=%s>"
"<input type=hidden name='securitytoken' val ue='%s'>" "<input type=hidden name='securitytoken' val ue='%s'>"
"<input type=hidden value='restart' name=act ion>" "<input type=hidden value='restart' name=act ion>"
"<input type=submit value='Restart service'> " "<input type=submit value='Restart service'> "
"</form>" "</form>"
"</td>", s->name, res->token); "</td>", s->name_escaped, res->token);
/* (un)monitor */ /* (un)monitor */
StringBuffer_append(res->outputbuffer, StringBuffer_append(res->outputbuffer,
"<td>" "<td>"
"<form method=POST action=%s>" "<form method=POST action=%s>"
"<input type=hidden name='securitytoken' val ue='%s'>" "<input type=hidden name='securitytoken' val ue='%s'>"
"<input type=hidden value='%s' name=action>" "<input type=hidden value='%s' name=action>"
"<input type=submit value='%s'>" "<input type=submit value='%s'>"
"</form>" "</form>"
"</td>", "</td>",
s->name, s->name_escaped,
res->token, res->token,
s->monitor ? "unmonitor" : "monitor", s->monitor ? "unmonitor" : "monitor",
s->monitor ? "Disable monitoring" : "Enable monitoring"); s->monitor ? "Disable monitoring" : "Enable monitoring");
StringBuffer_append(res->outputbuffer, "</tr></table>"); StringBuffer_append(res->outputbuffer, "</tr></table>");
} }
static void print_service_rules_timeout(HttpResponse res, Service_T s) { static void print_service_rules_timeout(HttpResponse res, Service_T s) {
for (ActionRate_T ar = s->actionratelist; ar; ar = ar->next) { for (ActionRate_T ar = s->actionratelist; ar; ar = ar->next) {
StringBuffer_append(res->outputbuffer, "<tr class='rule'><td>Tim eout</td><td>If restarted %d times within %d cycle(s) then ", ar->count, ar->cyc le); StringBuffer_append(res->outputbuffer, "<tr class='rule'><td>Tim eout</td><td>If restarted %d times within %d cycle(s) then ", ar->count, ar->cyc le);
Util_printAction(ar->action->failed, res->outputbuffer); Util_printAction(ar->action->failed, res->outputbuffer);
skipping to change at line 2174 skipping to change at line 2175
case Resource_SwapPercent: case Resource_SwapPercent:
StringBuffer_append(res->outputbuffer, "Swap usa ge limit"); StringBuffer_append(res->outputbuffer, "Swap usa ge limit");
break; break;
case Resource_SwapKbyte: case Resource_SwapKbyte:
StringBuffer_append(res->outputbuffer, "Swap amo unt limit"); StringBuffer_append(res->outputbuffer, "Swap amo unt limit");
break; break;
case Resource_LoadAverage1m: case Resource_LoadAverage1m:
StringBuffer_append(res->outputbuffer, "Load ave rage (1min)"); StringBuffer_append(res->outputbuffer, "Load ave rage (1m)");
break; break;
case Resource_LoadAverage5m: case Resource_LoadAverage5m:
StringBuffer_append(res->outputbuffer, "Load ave rage (5min)"); StringBuffer_append(res->outputbuffer, "Load ave rage (5m)");
break; break;
case Resource_LoadAverage15m: case Resource_LoadAverage15m:
StringBuffer_append(res->outputbuffer, "Load ave StringBuffer_append(res->outputbuffer, "Load ave
rage (15min)"); rage (15m)");
break;
case Resource_LoadAveragePerCore1m:
StringBuffer_append(res->outputbuffer, "Load ave
rage per core (1m)");
break;
case Resource_LoadAveragePerCore5m:
StringBuffer_append(res->outputbuffer, "Load ave
rage per core (5m)");
break;
case Resource_LoadAveragePerCore15m:
StringBuffer_append(res->outputbuffer, "Load ave
rage per core (15m)");
break; break;
case Resource_Threads: case Resource_Threads:
StringBuffer_append(res->outputbuffer, "Threads" ); StringBuffer_append(res->outputbuffer, "Threads" );
break; break;
case Resource_Children: case Resource_Children:
StringBuffer_append(res->outputbuffer, "Children "); StringBuffer_append(res->outputbuffer, "Children ");
break; break;
skipping to change at line 2242 skipping to change at line 2255
case Resource_MemoryKbyte: case Resource_MemoryKbyte:
case Resource_SwapKbyte: case Resource_SwapKbyte:
case Resource_MemoryKbyteTotal: case Resource_MemoryKbyteTotal:
Util_printRule(res->outputbuffer, q->action, "If %s %s", operatornames[q->operator], Fmt_bytes2str(q->limit, buf)); Util_printRule(res->outputbuffer, q->action, "If %s %s", operatornames[q->operator], Fmt_bytes2str(q->limit, buf));
break; break;
case Resource_LoadAverage1m: case Resource_LoadAverage1m:
case Resource_LoadAverage5m: case Resource_LoadAverage5m:
case Resource_LoadAverage15m: case Resource_LoadAverage15m:
case Resource_LoadAveragePerCore1m:
case Resource_LoadAveragePerCore5m:
case Resource_LoadAveragePerCore15m:
Util_printRule(res->outputbuffer, q->action, "If %s %.1f", operatornames[q->operator], q->limit); Util_printRule(res->outputbuffer, q->action, "If %s %.1f", operatornames[q->operator], q->limit);
break; break;
case Resource_Threads: case Resource_Threads:
case Resource_Children: case Resource_Children:
Util_printRule(res->outputbuffer, q->action, "If %s %.0f", operatornames[q->operator], q->limit); Util_printRule(res->outputbuffer, q->action, "If %s %.0f", operatornames[q->operator], q->limit);
break; break;
case Resource_ReadBytes: case Resource_ReadBytes:
case Resource_WriteBytes: case Resource_WriteBytes:
 End of changes. 20 change blocks. 
23 lines changed or deleted 42 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)