X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwireless.c;h=81c968e8d9b4e462a57129b6c37cb7fdd05e303d;hb=1fdb04e6cb573ad06b914b9371f21ffb255b1d13;hp=929d5d8a711608dc6c7b47e3dd025e3a8dbe058c;hpb=6360474f4aa35dd1a587b6148ff88a23e6155132;p=collectd.git diff --git a/src/wireless.c b/src/wireless.c index 929d5d8a..81c968e8 100644 --- a/src/wireless.c +++ b/src/wireless.c @@ -31,31 +31,6 @@ #define WIRELESS_PROC_FILE "/proc/net/wireless" -static data_source_t data_source_quality[1] = -{ - {"value", DS_TYPE_GAUGE, 0, NAN} -}; - -static data_set_t quality_ds = -{ - "signal_quality", 1, data_source_quality -}; - -static data_source_t data_source_signal[1] = -{ - {"value", DS_TYPE_GAUGE, NAN, 0} -}; - -static data_set_t power_ds = -{ - "signal_power", 1, data_source_signal -}; - -static data_set_t noise_ds = -{ - "signal_noise", 1, data_source_signal -}; - #if WIRELESS_HAVE_READ #if 0 static double wireless_dbm_to_watt (double dbm) @@ -84,7 +59,7 @@ static void wireless_submit (const char *plugin_instance, const char *type, vl.values = values; vl.values_len = 1; vl.time = time (NULL); - strcpy (vl.host, hostname); + strcpy (vl.host, hostname_g); strcpy (vl.plugin, "wireless"); strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)); @@ -112,7 +87,9 @@ static int wireless_read (void) /* there are a variety of names for the wireless device */ if ((fh = fopen (WIRELESS_PROC_FILE, "r")) == NULL) { - syslog (LOG_WARNING, "wireless: fopen: %s", strerror (errno)); + char errbuf[1024]; + WARNING ("wireless: fopen: %s", + sstrerror (errno, errbuf, sizeof (errbuf))); return (-1); } @@ -167,11 +144,7 @@ static int wireless_read (void) void module_register (void) { - plugin_register_data_set (&quality_ds); - plugin_register_data_set (&power_ds); - plugin_register_data_set (&noise_ds); - #if WIRELESS_HAVE_READ plugin_register_read ("wireless", wireless_read); #endif /* WIRELESS_HAVE_READ */ -} +} /* void module_register */