Code

Merge branch 'collectd-4.1' into collectd-4.2
authorFlorian Forster <octo@noris.net>
Tue, 30 Oct 2007 16:19:04 +0000 (16:19 +0000)
committerFlorian Forster <octo@noris.net>
Tue, 30 Oct 2007 16:19:04 +0000 (16:19 +0000)
Conflicts:

src/collectd-snmp.pod

src/apcups.c
src/collectd-snmp.pod
src/collectd.h
src/hddtemp.c
src/mbmon.c
src/ntpd.c
src/plugin.h
src/types.db

index 4f0bdfa69f8b64593e6b669a0c919c91cf89cdfb..174febe45f5a5346124d7ad97ec83890cc964bda 100644 (file)
@@ -136,7 +136,7 @@ static int net_open (char *host, char *service, int port)
        if (status != 0)
        {
                char errbuf[1024];
-               DEBUG ("getaddrinfo failed: %s",
+               INFO ("getaddrinfo failed: %s",
                                (status == EAI_SYSTEM)
                                ? sstrerror (errno, errbuf, sizeof (errbuf))
                                : gai_strerror (status));
@@ -167,7 +167,7 @@ static int net_open (char *host, char *service, int port)
        if (status != 0) /* `connect(2)' failed */
        {
                char errbuf[1024];
-               DEBUG ("connect failed: %s",
+               INFO ("connect failed: %s",
                                sstrerror (errno, errbuf, sizeof (errbuf)));
                close (sd);
                return (-1);
index 001925453c27897a9c5645b6dd3fabcf645668cd..ea490293f17ab21990536ed06eb533056edd1d77 100644 (file)
@@ -33,7 +33,7 @@ collectd-snmp - Documentation of collectd's C<snmp plugin>
       Version 1
       Community "community_string"
       Collect "std_traffic"
-      Inverval 120
+      Interval 120
     </Host>
     <Host "some.server.mydomain.org">
       Address "192.168.0.42"
@@ -67,9 +67,8 @@ and ten threads are used.
 Since the aim of the C<snmp plugin> is to provide a generic interface to SNMP,
 it's configuration is not trivial and may take some time.
 
-Since the C<Net-SNMP> library is used you can use all the environment
-variables that are interpreted by that package. See L<snmpcmd(1)> for more
-details.
+Since the C<Net-SNMP> library is used you can use all the environment variables
+that are interpreted by that package. See L<snmpcmd(1)> for more details.
 
 There are two types of blocks that can be contained in the
 C<E<lt>PluginE<nbsp>snmpE<gt>> block: B<Data> and B<Host>:
@@ -207,7 +206,7 @@ Set the address to connect to.
 
 =item B<Version> B<1>|B<2>
 
-Set the SNMP version to use. When giving B<2> version 2c is actually used.
+Set the SNMP version to use. When giving B<2> version C<2c> is actually used.
 Version 3 is not supported by this plugin.
 
 =item B<Community> I<Community>
index 2849db27234002a6cae6f4b3bb193f2db657b0e6..9951d8a91013d929bc831a4e40ad49b9bce08893 100644 (file)
 #define PLUGINDIR PREFIX "/lib/" PACKAGE_NAME
 #endif
 
-#define MODE_SERVER 0x01
-#define MODE_CLIENT 0x02
-#define MODE_LOCAL  0x04
-#define MODE_LOG    0x08
-
 #ifndef COLLECTD_GRP_NAME
 # define COLLECTD_GRP_NAME "collectd"
 #endif
index 0432de73adc825c9ac161bc3ea5dc5a5800f68a9..0a93920b99e4ce7e42c3d8a0b06c6fc91373c8e8 100644 (file)
@@ -144,7 +144,7 @@ static int hddtemp_query_daemon (char *buffer, int buffer_size)
                if (connect (fd, (struct sockaddr *) ai_ptr->ai_addr, ai_ptr->ai_addrlen))
                {
                        char errbuf[1024];
-                       DEBUG ("hddtemp: connect (%s, %s): %s", host, port,
+                       INFO ("hddtemp: connect (%s, %s): %s", host, port,
                                        sstrerror (errno, errbuf, sizeof (errbuf)));
                        close (fd);
                        fd = -1;
index 384ecb5e6a5cda48d376ebea8b5aad3882a1143b..bad1a3884d86596b2f5600241ae83c5ee543b69c 100644 (file)
@@ -132,7 +132,7 @@ static int mbmon_query_daemon (char *buffer, int buffer_size)
                if (connect (fd, (struct sockaddr *) ai_ptr->ai_addr, ai_ptr->ai_addrlen))
                {
                        char errbuf[1024];
-                       DEBUG ("mbmon: connect (%s, %s): %s", host, port,
+                       INFO ("mbmon: connect (%s, %s): %s", host, port,
                                        sstrerror (errno, errbuf,
                                                sizeof (errbuf)));
                        close (fd);
index 63b037a6440eb8006027dac12b8355cde0e24b5b..9e09f81982291dc3b60b3040e93eb4829838a342 100644 (file)
@@ -493,7 +493,7 @@ static int ntpd_receive_response (int req_code, int *res_items, int *res_size,
                if (status < 0)
                {
                        char errbuf[1024];
-                       DEBUG ("recv(2) failed: %s",
+                       INFO ("recv(2) failed: %s",
                                        sstrerror (errno, errbuf, sizeof (errbuf)));
                        DEBUG ("Closing socket #%i", sd);
                        close (sd);
index 4ca6c771f16c8d87f050c499b4f367cf85b6b970..7692ebdb0377eb3212a4c3a2da9931c837202d46 100644 (file)
@@ -193,7 +193,11 @@ void plugin_log (int level, const char *format, ...);
 #define WARNING(...) plugin_log (LOG_WARNING, __VA_ARGS__)
 #define NOTICE(...)  plugin_log (LOG_NOTICE,  __VA_ARGS__)
 #define INFO(...)    plugin_log (LOG_INFO,    __VA_ARGS__)
-#define DEBUG(...)   plugin_log (LOG_DEBUG,   __VA_ARGS__)
+#if COLLECT_DEBUG
+# define DEBUG(...)  plugin_log (LOG_DEBUG,   __VA_ARGS__)
+#else /* COLLECT_DEBUG */
+# define DEBUG(...)  /* noop */
+#endif /* ! COLLECT_DEBUG */
 
 /* TODO: Move plugin_{complain,relief} into `utils_complain.[ch]'. -octo */
 void plugin_complain (int level, complain_t *c, const char *format, ...);
index efaea0ecd7163658ed1b4656fe81bcd063405cae..560354c16a50a170dbdaee4f60c45c01bff62198 100644 (file)
@@ -27,7 +27,7 @@ fanspeed              value:GAUGE:0:U
 frequency              frequency:GAUGE:0:U
 frequency_offset       ppm:GAUGE:-1000000:1000000
 gauge                  value:GAUGE:U:U
-humitidy               value:GAUGE:0:100
+humidity               value:GAUGE:0:100
 if_collisions          value:COUNTER:0:4294967295
 if_dropped             rx:COUNTER:0:4294967295, tx:COUNTER:0:4294967295
 if_errors              rx:COUNTER:0:4294967295, tx:COUNTER:0:4294967295