author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 28 Feb 2009 09:35:17 +0000 (10:35 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 28 Feb 2009 09:35:17 +0000 (10:35 +0100) |
index e4dc54f2dab4485fb178a31161e0da93207a4b32..86b1e83ee5ed379fbcf460d80e1f515a85fb8967 100644 (file)
+-- collectd - contrib/oracle/create_schema.ddl
+-- Copyright (C) 2008,2009 Roman Klesel
+--
+-- This program is free software; you can redistribute it and/or modify it
+-- under the terms of the GNU General Public License as published by the
+-- Free Software Foundation; only version 2 of the License is applicable.
+--
+-- This program is distributed in the hope that it will be useful, but
+-- WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License along
+-- with this program; if not, write to the Free Software Foundation, Inc.,
+-- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--
+-- Authors:
+-- Roman Klesel <roman.klesel at noris.de>
+
-- Description
--------------
-- This will create a schema to provide collectd with the required permissions
spool off
quit
+
+-- vim: set syntax=sql :
index ca00a6defe33e7c45d682c32bae1f90cccdda89a..ac4a1b13fb4810b99e2fbc6f40ae853c27b1091f 100644 (file)
The C<unixsock plugin> opens an UNIX-socket over which one can interact with
the daemon. This can be used to use the values collected by collectd in other
-applications, such as monitoring, or submit externally collected values to
-collectd.
+applications, such as monitoring solutions, or submit externally collected
+values to collectd.
-This plugin is used by L<collectd-nagios(1)> to check if some value is in a
-certain range and exit with a Nagios-compatible exit code.
+For example, this plugin is used by L<collectd-nagios(1)> to check if some
+value is in a certain range and exit with a Nagios-compatible exit code.
=head1 COMMANDS
diff --git a/src/common.c b/src/common.c
index 4aa0ebe26a1f2fb3140746698d596486956e6440..ef808851948ccb47d9ba05b7c2913faa4cb95c43 100644 (file)
--- a/src/common.c
+++ b/src/common.c
*/
if (fields[i][0] == '.')
{
- ERROR ("Cowardly refusing to create a directory that begins with a `.' (dot): `%s'", file_orig);
+ ERROR ("Cowardly refusing to create a directory that "
+ "begins with a `.' (dot): `%s'", file_orig);
return (-2);
}
return (-1);
}
- if (stat (dir, &statbuf) == -1)
- {
- if (errno == ENOENT)
+ while (42) {
+ if (stat (dir, &statbuf) == -1)
{
- if (mkdir (dir, 0755) == -1)
+ if (errno == ENOENT)
{
+ if (mkdir (dir, 0755) == 0)
+ break;
+
+ /* this might happen, if a different thread created
+ * the directory in the meantime
+ * => call stat() again to check for S_ISDIR() */
+ if (EEXIST == errno)
+ continue;
+
char errbuf[1024];
ERROR ("check_create_dir: mkdir (%s): %s", dir,
sstrerror (errno,
errbuf, sizeof (errbuf)));
return (-1);
}
+ else
+ {
+ char errbuf[1024];
+ ERROR ("check_create_dir: stat (%s): %s", dir,
+ sstrerror (errno, errbuf,
+ sizeof (errbuf)));
+ return (-1);
+ }
}
- else
+ else if (!S_ISDIR (statbuf.st_mode))
{
- char errbuf[1024];
- ERROR ("stat (%s): %s", dir,
- sstrerror (errno, errbuf,
- sizeof (errbuf)));
+ ERROR ("check_create_dir: `%s' exists but is not "
+ "a directory!", dir);
return (-1);
}
- }
- else if (!S_ISDIR (statbuf.st_mode))
- {
- ERROR ("stat (%s): Not a directory!", dir);
- return (-1);
+ break;
}
}
diff --git a/src/dns.c b/src/dns.c
index ab38789ff858fc9842c50fed4f8e58e05cbe3184..476b6ddb2a2effded68e76af34152b20a634df51 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
/* Passing `pcap_device == NULL' is okay and the same as passign "any" */
DEBUG ("Creating PCAP object..");
- pcap_obj = pcap_open_live (pcap_device,
+ pcap_obj = pcap_open_live ((pcap_device != NULL) ? pcap_device : "any",
PCAP_SNAPLEN,
0 /* Not promiscuous */,
interval_g,
diff --git a/src/oracle.c b/src/oracle.c
index 324dd4b4becf905f3d4338bbbc5f29041618ee9b..78a09ffd048962a05b5054bf51756a88463f37bc 100644 (file)
--- a/src/oracle.c
+++ b/src/oracle.c
for (i = 0; i < column_num; i++) /* {{{ */
{
char *column_name;
- size_t column_name_length;
+ ub4 column_name_length;
OCIParam *oci_param;
oci_param = NULL;
column_names[i][column_name_length] = 0;
DEBUG ("oracle plugin: o_read_database_query: column_names[%zu] = %s; "
- "column_name_length = %zu;",
- i, column_names[i], column_name_length);
+ "column_name_length = %"PRIu32";",
+ i, column_names[i], (uint32_t) column_name_length);
status = OCIDefineByPos (oci_statement,
&oci_defines[i], oci_error, (ub4) (i + 1),