summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2244db3)
raw | patch | inline | side by side (parent: 2244db3)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 14 Feb 2009 15:45:55 +0000 (16:45 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 16 Feb 2009 14:22:04 +0000 (15:22 +0100) |
src/collectd-perl.pod | patch | blob | history | |
src/perl.c | patch | blob | history |
diff --git a/src/collectd-perl.pod b/src/collectd-perl.pod
index 18dbafdc8c93cfa9c7cf00f64b62985200b1c71a..1bd874359a5bd17fd3d3e3f896b908640edf4bcb 100644 (file)
--- a/src/collectd-perl.pod
+++ b/src/collectd-perl.pod
{
values => [123, 0.5],
time => time (),
+ interval => $interval_g,
host => $hostname_g,
plugin => 'myplugin',
type => 'myplugin',
diff --git a/src/perl.c b/src/perl.c
index 27abc62373552fadffbe56d9352cd6b1ebb3b9af..81d78c675c7909696b0391a85f637925dfc9c9b9 100644 (file)
--- a/src/perl.c
+++ b/src/perl.c
}
}
- if (NULL != (tmp = hv_fetch (hash, "time", 4, 0))) {
+ if (NULL != (tmp = hv_fetch (hash, "time", 4, 0)))
vl->time = (time_t)SvIV (*tmp);
- }
- if (NULL != (tmp = hv_fetch (hash, "host", 4, 0))) {
+ if (NULL != (tmp = hv_fetch (hash, "interval", 8, 0)))
+ vl->interval = SvIV (*tmp);
+
+ if (NULL != (tmp = hv_fetch (hash, "host", 4, 0)))
sstrncpy (vl->host, SvPV_nolen (*tmp), sizeof (vl->host));
- }
- else {
+ else
sstrncpy (vl->host, hostname_g, sizeof (vl->host));
- }
if (NULL != (tmp = hv_fetch (hash, "plugin", 6, 0)))
sstrncpy (vl->plugin, SvPV_nolen (*tmp), sizeof (vl->plugin));
if (NULL == hv_store (hash, "time", 4, newSViv (vl->time), 0))
return -1;
+ if (NULL == hv_store (hash, "interval", 8, newSViv (vl->interval), 0))
+ return -1;
+
if ('\0' != vl->host[0])
if (NULL == hv_store (hash, "host", 4, newSVpv (vl->host, 0), 0))
return -1;