Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.6.7 #76

Merged
merged 12 commits into from
Jul 10, 2017
Prev Previous commit
Next Next commit
vstatus fix
  • Loading branch information
jangaraj committed Jun 23, 2017
commit 23a232a95af5c21599d84d8bdae491881e5c4d7b
18 changes: 16 additions & 2 deletions src/modules/zabbix_module_docker/zabbix_module_docker.c
Original file line number Diff line number Diff line change
Expand Up @@ -2358,15 +2358,22 @@ int zbx_module_docker_vstatus(AGENT_REQUEST *request, AGENT_RESULT *result)
}

struct zbx_json_parse jp_data, jp_data2;
int count;
jp_data.start = &answer[0];
jp_data.end = &answer[strlen(answer)];

if (SUCCEED == zbx_json_brackets_by_name(&jp_data, "Volumes", &jp_data2)) {
int count = zbx_json_count(&jp_data2);
count = zbx_json_count(&jp_data2);
free((void*) answer);
zabbix_log(LOG_LEVEL_DEBUG, "Count of volumes in %s status: %d", state, count);
SET_UI64_RESULT(result, count);
return SYSINFO_RET_OK;
} else {
free((void*) answer);
count = 0;
zabbix_log(LOG_LEVEL_DEBUG, "Count of volumes in %s status: %d", state, count);
SET_UI64_RESULT(result, count);
return SYSINFO_RET_OK;
}
} else if (strcmp(state, "Dangling") == 0) {
// Dangling
Expand All @@ -2386,12 +2393,19 @@ int zbx_module_docker_vstatus(AGENT_REQUEST *request, AGENT_RESULT *result)
}

struct zbx_json_parse jp_data, jp_data2;
int count;
jp_data.start = &answer[0];
jp_data.end = &answer[strlen(answer)];

if (SUCCEED == zbx_json_brackets_by_name(&jp_data, "Volumes", &jp_data2)) {
int count = zbx_json_count(&jp_data2);
count = zbx_json_count(&jp_data2);
free((void*) answer);
zabbix_log(LOG_LEVEL_DEBUG, "Count of volumes in %s status: %d", state, count);
SET_UI64_RESULT(result, count);
return SYSINFO_RET_OK;
} else {
free((void*) answer);
count = 0;
zabbix_log(LOG_LEVEL_DEBUG, "Count of volumes in %s status: %d", state, count);
SET_UI64_RESULT(result, count);
return SYSINFO_RET_OK;
Expand Down