#include "common.h"
#include "plugin.h"
-#if defined(KERNEL_LINUX)
-# define WIRELESS_HAVE_READ 1
-#else
-# define WIRELESS_HAVE_READ 0
+#if !KERNEL_LINUX
+# error "No applicable input method."
#endif
#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)
{
/* 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);
}
return (0);
} /* int wireless_read */
-#endif /* WIRELESS_HAVE_READ */
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 */