X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnfs.c;h=299d63b9e4b98e56363770eb7003850ea3621f87;hb=aa39b2bf774bf297f6c1a3967764bd7d84e0a49f;hp=1dc64b78a1d948a2b9112ceb3c9484691f60042a;hpb=e5bee85b6d9b15a57a4d555cde72a994e2dc73b1;p=collectd.git diff --git a/src/nfs.c b/src/nfs.c index 1dc64b78..299d63b9 100644 --- a/src/nfs.c +++ b/src/nfs.c @@ -23,9 +23,6 @@ #include "collectd.h" #include "common.h" #include "plugin.h" -#include "utils_debug.h" - -#define MODULE_NAME "nfs" /* #if defined(KERNEL_LINUX) || defined(HAVE_LIBKSTAT) */ #if KERNEL_LINUX @@ -79,16 +76,6 @@ Number Procedures Procedures 21 commit */ -static data_source_t procedure_dsrc[1] = -{ - {"value", DS_TYPE_COUNTER, 0, 4294967295.0} -}; - -static data_set_t procedure_ds = -{ - "nfs_procedure", 1, procedure_dsrc -}; - #if NFS_HAVE_READ static const char *nfs2_procedures_names[] = { @@ -205,7 +192,7 @@ static void nfs_procedures_submit (const char *plugin_instance, vl.values = values; vl.values_len = 1; vl.time = time (NULL); - strcpy (vl.host, hostname); + strcpy (vl.host, hostname_g); strcpy (vl.plugin, "nfs"); strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)); @@ -215,7 +202,7 @@ static void nfs_procedures_submit (const char *plugin_instance, values[0].counter = val[i]; strncpy (vl.type_instance, names[i], sizeof (vl.type_instance)); - DBG ("%s-%s/nfs_procedure-%s = %llu", + DEBUG ("%s-%s/nfs_procedure-%s = %llu", vl.plugin, vl.plugin_instance, vl.type_instance, val[i]); plugin_dispatch_values ("nfs_procedure", &vl); @@ -251,7 +238,7 @@ static void nfs_read_stats_file (FILE *fh, char *inst) if ((numfields - 2) != nfs2_procedures_names_num) { - syslog (LOG_WARNING, "nfs plugin: Wrong " + WARNING ("nfs plugin: Wrong " "number of fields (= %i) " "for NFSv2 statistics.", numfields - 2); @@ -265,9 +252,10 @@ static void nfs_read_stats_file (FILE *fh, char *inst) values = (unsigned long long *) malloc (nfs2_procedures_names_num * sizeof (unsigned long long)); if (values == NULL) { - syslog (LOG_ERR, "nfs plugin: malloc " + char errbuf[1024]; + ERROR ("nfs plugin: malloc " "failed: %s", - strerror (errno)); + sstrerror (errno, errbuf, sizeof (errbuf))); continue; } @@ -287,7 +275,7 @@ static void nfs_read_stats_file (FILE *fh, char *inst) if ((numfields - 2) != nfs3_procedures_names_num) { - syslog (LOG_WARNING, "nfs plugin: Wrong " + WARNING ("nfs plugin: Wrong " "number of fields (= %i) " "for NFSv3 statistics.", numfields - 2); @@ -301,9 +289,10 @@ static void nfs_read_stats_file (FILE *fh, char *inst) values = (unsigned long long *) malloc (nfs3_procedures_names_num * sizeof (unsigned long long)); if (values == NULL) { - syslog (LOG_ERR, "nfs plugin: malloc " + char errbuf[1024]; + ERROR ("nfs plugin: malloc " "failed: %s", - strerror (errno)); + sstrerror (errno, errbuf, sizeof (errbuf))); continue; } @@ -381,11 +370,7 @@ static int nfs_read (void) void module_register (void) { - plugin_register_data_set (&procedure_ds); - #if NFS_HAVE_READ plugin_register_read ("nfs", nfs_read); #endif -} - -#undef MODULE_NAME +} /* void module_register */