author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Thu, 1 Oct 2009 19:34:21 +0000 (21:34 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Thu, 1 Oct 2009 19:34:21 +0000 (21:34 +0200) |
Conflicts:
src/types.db
src/types.db
README | patch | blob | history | |
src/collectd.conf.in | patch | blob | history | |
src/owniptc/libiptc.c | patch | blob | history | |
src/processes.c | patch | blob | history | |
src/types.db | patch | blob | history | |
src/unixsock.c | patch | blob | history |
index 07a7415a00d6dc4ef929762aff433d4ec6087e32..a737f8625ab0d3eca52af8ca56465a98b5b57bb9 100644 (file)
--- a/README
+++ b/README
* libyajl (optional)
Parse JSON data. This is needed for the `curl_json' plugin.
- <http://www.lloydforge.org/projects/yajl/>
+ <http://github.com/lloyd/yajl>
Configuring / Compiling / Installing
------------------------------------
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index e78f9dce3e00aab7408654416ca47b1e25c90e53..8f28f8f3c3c02755f1322b4ccc4857009e24e428 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
# </View>
#</Plugin>
-#<Plugin couchdb>
+#<Plugin csv>
+# DataDir "@prefix@/var/lib/@PACKAGE_NAME@/csv"
+# StoreRates false
+#</Plugin>
+
+#<Plugin curl>
+# <Page "stock_quotes">
+# URL "http://finance.google.com/finance?q=NYSE%3AAMD"
+# User "foo"
+# Password "bar"
+# <Match>
+# Regex "<span +class=\"pr\"[^>]*> *([0-9]*\\.[0-9]+) *</span>"
+# DSType "GaugeAverage"
+# Type "stock_value"
+# Instance "AMD"
+# </Match>
+# </Page>
+#</Plugin>
+
+#<Plugin curl_json>
## See: http://wiki.apache.org/couchdb/Runtime_Statistics
# <URL "http://localhost:5984/_stats">
# Instance "httpd"
# </URL>
#</Plugin>
-#<Plugin csv>
-# DataDir "@prefix@/var/lib/@PACKAGE_NAME@/csv"
-# StoreRates false
-#</Plugin>
-
-#<Plugin curl>
-# <Page "stock_quotes">
-# URL "http://finance.google.com/finance?q=NYSE%3AAMD"
-# User "foo"
-# Password "bar"
-# <Match>
-# Regex "<span +class=\"pr\"[^>]*> *([0-9]*\\.[0-9]+) *</span>"
-# DSType "GaugeAverage"
-# Type "stock_value"
-# Instance "AMD"
-# </Match>
-# </Page>
-#</Plugin>
-
#<Plugin dbi>
# <Query "num_of_customers">
# Statement "SELECT 'customers' AS c_key, COUNT(*) AS c_value FROM customers_tbl"
#<Plugin dns>
# Interface "eth0"
# IgnoreSource "192.168.0.1"
+# SelectNumericQueryTypes true
#</Plugin>
#<Plugin email>
# TranslateDevicename false
#</Plugin>
-#<Plugin http>
-# URL "http://example.com/collectd-import"
-# User "www-user"
-# Password "secret"
-#</Plugin>
-
#<Plugin interface>
# Interface "eth0"
# IgnoreSelected false
diff --git a/src/owniptc/libiptc.c b/src/owniptc/libiptc.c
index f7a6640fffe09b398a2de9a54d21cc9f250b3e33..5e5fde083cdbed549fa5fe439e8f9dc49b810700 100644 (file)
--- a/src/owniptc/libiptc.c
+++ b/src/owniptc/libiptc.c
}
/* How many rules in this chain? */
+#if 0
static unsigned int
TC_NUM_RULES(const char *chain, TC_HANDLE_T *handle)
{
return c->num_rules;
}
+#endif
+#if 0
static const STRUCT_ENTRY *
TC_GET_RULE(const char *chain, unsigned int n, TC_HANDLE_T *handle)
{
return NULL;
return r->entry;
}
+#endif
/* Returns a pointer to the target name of this position. */
static const char *standard_target_map(int verdict)
diff --git a/src/processes.c b/src/processes.c
index fd06b21b4949d88cff169806d01abee98720ce03..4f515184ed85a66f38f17400f9f08dbca112fdb5 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
else
{
if ( (ps->num_lwp = ps_read_tasks (pid)) == -1 )
- return (-1);
+ {
+ /* returns -1 => kernel 2.4 */
+ ps->num_lwp = 1;
+ }
ps->num_proc = 1;
}
diff --git a/src/types.db b/src/types.db
index c6526d42a5ba956b877bf373dce3ae87b08b8409..960674c00c68a3f0a5c41bca8ea2774329dc5244 100644 (file)
--- a/src/types.db
+++ b/src/types.db
email_size value:GAUGE:0:U
entropy entropy:GAUGE:0:4294967295
fanspeed value:GAUGE:0:U
-file_size bytes:GAUGE:0:U
+file_size bytes:GAUGE:0:U
files value:GAUGE:0:U
frequency frequency:GAUGE:0:U
frequency_offset ppm:GAUGE:-1000000:1000000
ps_state value:GAUGE:0:65535
ps_vm value:GAUGE:0:9223372036854775807
queue_length value:GAUGE:0:U
-records count:GAUGE:0:U
response_time value:GAUGE:0:U
+records count:GAUGE:0:U
route_etx value:GAUGE:0:U
route_metric value:GAUGE:0:U
routes value:GAUGE:0:U
diff --git a/src/unixsock.c b/src/unixsock.c
index be36abc8c8f9bbb339c6557b701e41f4c62a61cd..0b897482c9d956547d74be3f905f9d9941b157be 100644 (file)
--- a/src/unixsock.c
+++ b/src/unixsock.c
static void *us_handle_client (void *arg)
{
- int fd;
+ int fdin;
+ int fdout;
FILE *fhin, *fhout;
- fd = *((int *) arg);
+ fdin = *((int *) arg);
free (arg);
arg = NULL;
- DEBUG ("unixsock plugin: us_handle_client: Reading from fd #%i", fd);
+ DEBUG ("unixsock plugin: us_handle_client: Reading from fd #%i", fdin);
- fhin = fdopen (fd, "r");
+ fdout = dup (fdin);
+ if (fdout < 0)
+ {
+ char errbuf[1024];
+ ERROR ("unixsock plugin: dup failed: %s",
+ sstrerror (errno, errbuf, sizeof (errbuf)));
+ close (fdin);
+ pthread_exit ((void *) 1);
+ }
+
+ fhin = fdopen (fdin, "r");
if (fhin == NULL)
{
char errbuf[1024];
ERROR ("unixsock plugin: fdopen failed: %s",
sstrerror (errno, errbuf, sizeof (errbuf)));
- close (fd);
+ close (fdin);
+ close (fdout);
pthread_exit ((void *) 1);
}
- fhout = fdopen (fd, "w");
+ fhout = fdopen (fdout, "w");
if (fhout == NULL)
{
char errbuf[1024];
ERROR ("unixsock plugin: fdopen failed: %s",
sstrerror (errno, errbuf, sizeof (errbuf)));
- fclose (fhin); /* this closes fd as well */
+ fclose (fhin); /* this closes fdin as well */
+ close (fdout);
pthread_exit ((void *) 1);
}
fields_num = strsplit (buffer_copy, fields,
sizeof (fields) / sizeof (fields[0]));
-
if (fields_num < 1)
{
- close (fd);
- break;
+ fprintf (fhout, "-1 Internal error\n");
+ fclose (fhin);
+ fclose (fhout);
+ pthread_exit ((void *) 1);
}
if (strcasecmp (fields[0], "getval") == 0)