}
v = malloc(sizeof(*v));
v->name = strdup(name);
-// v->name = malloc(strlen(name) + 5);
-// strcpy(v->name, "vol-");
-// strcpy(v->name + 4, name);
+ /* v->name = malloc(strlen(name) + 5); */
+ /* strcpy(v->name, "vol-"); */
+ /* strcpy(v->name + 4, name); */
v->perf_data.flags = 0;
v->volume_data.flags = 0;
v->next = host->volumes;
v = malloc(sizeof(*v));
*v = init;
v->name = strdup(name);
-// v->name = malloc(strlen(name) + 6);
-// strcpy(v->name, "disk-");
-// strcpy(v->name + 5, name);
+ /* v->name = malloc(strlen(name) + 6); */
+ /* strcpy(v->name, "disk-"); */
+ /* strcpy(v->name + 5, name); */
v->next = host->disks;
host->disks = v;
return v;
plugin_dispatch_values (&vl);
}
if ((perf->flags & PERF_SYSTEM_CPU) && cpu_busy && cpu_total) {
-// values[0].gauge = (double) (cpu_busy - perf->last_cpu_busy) / (cpu_total - perf->last_cpu_total) * 100;
+ /* values[0].gauge = (double) (cpu_busy - perf->last_cpu_busy) / (cpu_total - perf->last_cpu_total) * 100; */
values[0].counter = cpu_busy / 10000;
vl.values = values;
vl.values_len = 1;
sstrncpy(vl.plugin_instance, instance, sizeof(vl.plugin_instance));
sstrncpy(vl.type, "cpu", sizeof(vl.type));
sstrncpy(vl.type_instance, "system", sizeof(vl.plugin_instance));
-// if (perf->last_cpu_busy && perf->last_cpu_total) printf("CPU: busy: %lf - idle: %lf\n", values[0].gauge, 100.0 - values[0].gauge);
-// if (perf->last_cpu_busy && perf->last_cpu_total) plugin_dispatch_values ("cpu", &vl);
+ /* if (perf->last_cpu_busy && perf->last_cpu_total) printf("CPU: busy: %lf - idle: %lf\n", values[0].gauge, 100.0 - values[0].gauge); */
+ /* if (perf->last_cpu_busy && perf->last_cpu_total) plugin_dispatch_values ("cpu", &vl); */
DEBUG("%s/netapp-%s/cpu: busy: %"PRIu64" - idle: %"PRIu64, host->name, instance, cpu_busy / 10000, cpu_total / 10000);
plugin_dispatch_values (&vl);
-// values[0].gauge = 100.0 - (double) (cpu_busy - perf->last_cpu_busy) / (cpu_total - perf->last_cpu_total) * 100;
+ /* values[0].gauge = 100.0 - (double) (cpu_busy - perf->last_cpu_busy) / (cpu_total - perf->last_cpu_total) * 100; */
values[0].counter = (cpu_total - cpu_busy) / 10000;
vl.values = values;
vl.values_len = 1;
sstrncpy(vl.plugin_instance, instance, sizeof(vl.plugin_instance));
sstrncpy(vl.type, "cpu", sizeof(vl.type));
sstrncpy(vl.type_instance, "idle", sizeof(vl.plugin_instance));
-// if (perf->last_cpu_busy && perf->last_cpu_total) plugin_dispatch_values ("cpu", &vl);
+ /* if (perf->last_cpu_busy && perf->last_cpu_total) plugin_dispatch_values ("cpu", &vl); */
plugin_dispatch_values (&vl);
perf->last_cpu_busy = cpu_busy;
na_child_add_string(e, "foo", "buf_hash_miss");
na_child_add_string(e, "foo", "inode_cache_hit");
na_child_add_string(e, "foo", "inode_cache_miss");
-// na_child_add_string(e, "foo", "inode_eject_time");
-// na_child_add_string(e, "foo", "buf_eject_time");
+ /* na_child_add_string(e, "foo", "inode_eject_time"); */
+ /* na_child_add_string(e, "foo", "buf_eject_time"); */
na_child_add(service->query, e);
} else if (service->handler == collect_perf_disk_data) {
service->query = na_elem_new("perf-object-get-instances");
na_child_add(service->query, e);
} else if (service->handler == collect_volume_data) {
service->query = na_elem_new("volume-list-info");
-// na_child_add_string(service->query, "objectname", "volume");
-// } else if (service->handler == collect_snapshot_data) {
-// service->query = na_elem_new("snapshot-list-info");
+ /* na_child_add_string(service->query, "objectname", "volume"); */
+ /* } else if (service->handler == collect_snapshot_data) { */
+ /* service->query = na_elem_new("snapshot-list-info"); */
}
}
}
for (i = 0; i < ci->children_num; ++i) {
oconfig_item_t *item = ci->children + i;
-// if (!item || !item->key || !*item->key) continue;
+ /* if (!item || !item->key || !*item->key) continue; */
if (!strcasecmp(item->key, "Multiplier")) {
if (item->values_num != 1 || item->values[0].type != OCONFIG_TYPE_NUMBER || item->values[0].value.number != (int) item->values[0].value.number || item->values[0].value.number < 1) {
WARNING("netapp plugin: \"Multiplier\" of host %s service GetVolPerfData needs exactly one positive integer argument.", host->name);
for (i = 0; i < ci->children_num; ++i) {
oconfig_item_t *item = ci->children + i;
-// if (!item || !item->key || !*item->key) continue;
+ /* if (!item || !item->key || !*item->key) continue; */
if (!strcasecmp(item->key, "Multiplier")) {
if (item->values_num != 1 || item->values[0].type != OCONFIG_TYPE_NUMBER || item->values[0].value.number != (int) item->values[0].value.number || item->values[0].value.number < 1) {
WARNING("netapp plugin: \"Multiplier\" of host %s service GetVolPerfData needs exactly one positive integer argument.", host->name);
for (i = 0; i < ci->children_num; ++i) {
oconfig_item_t *item = ci->children + i;
-// if (!item || !item->key || !*item->key) continue;
+ /* if (!item || !item->key || !*item->key) continue; */
if (!strcasecmp(item->key, "Multiplier")) {
if (item->values_num != 1 || item->values[0].type != OCONFIG_TYPE_NUMBER || item->values[0].value.number != (int) item->values[0].value.number || item->values[0].value.number < 1) {
WARNING("netapp plugin: \"Multiplier\" of host %s service GetWaflPerfData needs exactly one positive integer argument.", ci->values[0].value.string);
for (i = 0; i < ci->children_num; ++i) {
oconfig_item_t *item = ci->children + i;
-// if (!item || !item->key || !*item->key) continue;
+ /* if (!item || !item->key || !*item->key) continue; */
if (!strcasecmp(item->key, "Multiplier")) {
if (item->values_num != 1 || item->values[0].type != OCONFIG_TYPE_NUMBER || item->values[0].value.number != (int) item->values[0].value.number || item->values[0].value.number < 1) {
WARNING("netapp plugin: \"Multiplier\" of host %s service GetWaflPerfData needs exactly one positive integer argument.", ci->values[0].value.string);
for (i = 0; i < ci->children_num; ++i) {
oconfig_item_t *item = ci->children + i;
-// if (!item || !item->key || !*item->key) continue;
+ /* if (!item || !item->key || !*item->key) continue; */
if (!strcasecmp(item->key, "Multiplier")) {
if (item->values_num != 1 || item->values[0].type != OCONFIG_TYPE_NUMBER || item->values[0].value.number != (int) item->values[0].value.number || item->values[0].value.number < 1) {
WARNING("netapp plugin: \"Multiplier\" of host %s service GetSystemPerfData needs exactly one positive integer argument.", ci->values[0].value.string);
for (i = 0; i < ci->children_num; ++i) {
item = ci->children + i;
-// if (!item || !item->key || !*item->key) continue;
+ /* if (!item || !item->key || !*item->key) continue; */
if (!strcasecmp(item->key, "Address")) {
if ((item->values_num != 1) || (item->values[0].type != OCONFIG_TYPE_STRING)) {
WARNING("netapp plugin: \"Name\" needs exactly one string argument. Ignoring host block \"%s\".", ci->values[0].value.string);
for (i = 0; i < ci->children_num; ++i) {
item = ci->children + i;
-// if (!item || !item->key || !*item->key) continue;
+ /* if (!item || !item->key || !*item->key) continue; */
if (!strcasecmp(item->key, "Host")) {
build_host_config(item, &default_host, &default_service);
} else {
ERROR("netapp plugin: Error %d from host %s: %s", netapp_errno, host->name, na_results_reason(out));
na_elem_free(out);
if (netapp_errno == EIO || netapp_errno == ETIMEDOUT) {
- // Network problems. Just give up on all other services on this host.
+ /* Network problems. Just give up on all other services on this host. */
break;
}
continue;