**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#elif HAVE_LIBKSTAT
static int nfs_init (void)
{
- kstat_t *ksp_chain = NULL;
-
nfs2_ksp_client = NULL;
nfs2_ksp_server = NULL;
nfs3_ksp_client = NULL;
if (kc == NULL)
return (-1);
- for (ksp_chain = kc->kc_chain; ksp_chain != NULL;
+ for (kstat_t *ksp_chain = kc->kc_chain; ksp_chain != NULL;
ksp_chain = ksp_chain->ks_next)
{
if (strncmp (ksp_chain->ks_module, "nfs", 3) != 0)
value_t *values, size_t values_num)
{
value_list_t vl = VALUE_LIST_INIT;
- size_t i;
vl.values_len = 1;
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sizeof (vl.plugin_instance));
sstrncpy (vl.type, "nfs_procedure", sizeof (vl.type));
- for (i = 0; i < values_num; i++)
+ for (size_t i = 0; i < values_num; i++)
{
vl.values = values + i;
sstrncpy (vl.type_instance, type_instances[i],
{
char plugin_instance[DATA_MAX_NAME_LEN];
value_t values[fields_num];
- size_t i;
ssnprintf (plugin_instance, sizeof (plugin_instance), "v%i%s",
nfs_version, instance);
- for (i = 0; i < fields_num; i++)
+ for (size_t i = 0; i < fields_num; i++)
(void) parse_value (fields[i], &values[i], DS_TYPE_DERIVE);
nfs_procedures_submit (plugin_instance, proc_names, values,
{
char plugin_instance[DATA_MAX_NAME_LEN];
value_t values[proc_names_num];
- size_t i;
if (ksp == NULL)
return (EINVAL);
nfs_version, inst);
kstat_read(kc, ksp, NULL);
- for (i = 0; i < proc_names_num; i++)
+ for (size_t i = 0; i < proc_names_num; i++)
{
/* The name passed to kstat_data_lookup() doesn't have the
* "const" modifier, so we need to copy the name here. */