# </Value>
</MBean>
+ ######################################
+ # Define the "jmx_memory" type as: #
+ # jmx_memory value:GAUGE:0:U #
+ # See types.db(5) for details. #
+ ######################################
+
# Generic heap/nonheap memory usage.
<MBean "memory">
ObjectName "java.lang:type=Memory"
# Creates four values: committed, init, max, used
<Value>
- Type "memory"
+ Type "jmx_memory"
#InstancePrefix ""
#InstanceFrom ""
Table true
# Creates four values: committed, init, max, used
<Value>
- Type "memory"
+ Type "jmx_memory"
#InstancePrefix ""
#InstanceFrom ""
Table true
Attribute "NonHeapMemoryUsage"
+ InstancePrefix "nonheap-"
</Value>
</MBean>
InstanceFrom "name"
<Value>
- Type "memory"
+ Type "jmx_memory"
#InstancePrefix ""
#InstanceFrom ""
Table true
my $DIR = "/var/lib/collectd";
my $HOST = undef;
my $IMG_FMT = "PNG";
-my $RECURSIVE = 0;
+my $RECURSIVE = 1;
GetOptions (
"host=s" => \$HOST,
my @COLORS = (0xff7777, 0x7777ff, 0x55ff55, 0xffcc77, 0xff77ff, 0x77ffff,
0xffff77, 0x55aaff);
-my @tmp = `/bin/hostname`; chomp(@tmp);
+my @tmp = `/bin/hostname -f`; chomp(@tmp);
$HOST = $tmp[0] if (! defined $HOST);
my $svg_p = ($IMG_FMT eq "SVG");
my $IMG_SFX = $svg_p ? ".svg" : ".png";
my $IMG_DIR = "${HOST}.dir";
-my $HTML = "${HOST}.html";
+my $HTML = "${HOST}.xhtml";
################################################################################
#
my $title="Rrd plot for $HOST";
print OUT <<END;
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
+<style type="text/css" media="screen">
+.graph { text-align: center; }
+object.graph { width: 670; height: 179; }
+</style>
<title>$title</title>
+<meta http-equiv="Content-Type"
+ content="application/xhtml+xml; charset=us-ascii" />
</head>
<body>
-<center>
END
# list interesting rrd
}
chomp(@list);
-foreach my $rrd (sort @list){
+@list = sort @list;
+foreach my $rrd (@list){
$rrd =~ m/^$DIR\/(.*)\.rrd$/;
push(@rrds, $1);
}
# table of contents
print OUT <<END;
-<A name="top"></A><H1>$title</H1>
-<P>
+<h1><a id="top">$title</a></h1>
+<p>
END
foreach my $bn (@rrds){
my $cleaned_bn = $bn;
$cleaned_bn =~ tr/%\//__/;
print OUT <<END;
-<A href="#$cleaned_bn">$bn</A>
+<a href="#$cleaned_bn">$bn</a>
END
}
print OUT <<END;
-</P>
+</p>
END
# graph interesting rrd
my $cleaned_bn = $bn;
$cleaned_bn =~ tr/%\//__/;
print OUT <<END;
-<A name="$cleaned_bn"></A><H1>$bn</H1>
+<h2><a id="$cleaned_bn">$bn</a></h2>
END
# graph various ranges
my $cleaned_img = $img; $cleaned_img =~ s/%/%25/g;
if (! $svg_p) {
print OUT <<END;
-<P><IMG src="$cleaned_img" alt="${bn} $span"></P>
+<p class="graph"><img src="$cleaned_img" alt="${bn} $span" /></p>
END
} else {
print OUT <<END;
-<P><object data="$cleaned_img" type="image/svg+xml"
- width="670" height="179">
- ${bn} $span</object></P>
+<p class="graph"><object data="$cleaned_img" type="image/svg+xml">
+ ${bn} $span</object></p>
END
}
}
print OUT <<END;
-<A href="#top">[top]</A>
+<p><a href="#top">[top]</a></p>
END
}
print OUT <<END;
-</center>
+<hr />
+<p>
+ <a href="http://validator.w3.org/check?uri=referer"><img
+ src="http://www.w3.org/Icons/valid-xhtml10"
+ alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
+</p>
</body>
</html>
END
* Florian Forster <octo at verplant.org>
**/
-#define _XOPEN_SOURCE 600 /* glibc2 needs this for strptime */
+#include "config.h"
+
+#ifndef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 600 /* glibc2 needs this for strptime */
+#endif
#include "collectd.h"
#include "common.h"
SSTRCATF (command, " interval=%i", vl->interval);
if (vl->time > 0)
- SSTRCATF (command, "%u", (unsigned int) vl->time);
+ SSTRCATF (command, " %u", (unsigned int) vl->time);
else
- SSTRCAT (command, "N");
+ SSTRCAT (command, " N");
for (i = 0; i < vl->values_len; i++)
{
#define FUNC_ERROR(func) do { char errbuf[1024]; ERROR ("powerdns plugin: %s failed: %s", func, sstrerror (errno, errbuf, sizeof (errbuf))); } while (0)
#define SERVER_SOCKET LOCALSTATEDIR"/run/pdns.controlsocket"
-#define SERVER_COMMAND "SHOW *"
+#define SERVER_COMMAND "SHOW * \n"
#define RECURSOR_SOCKET LOCALSTATEDIR"/run/pdns_recursor.controlsocket"
#define RECURSOR_COMMAND "get noerror-answers nxdomain-answers " \
"servfail-answers sys-msec user-msec qa-latency cache-entries cache-hits " \
- "cache-misses questions"
+ "cache-misses questions\n"
struct list_item_s;
typedef struct list_item_s list_item_t;
return (-1);
}
+ struct timeval timeout;
+ timeout.tv_sec=5;
+ timeout.tv_usec=0;
+ status = setsockopt (sd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof (timeout));
+
status = connect (sd, (struct sockaddr *) &item->sockaddr,
sizeof (item->sockaddr));
if (status != 0)
int fields_num;
if (item->command == NULL)
- item->command = strdup ("SHOW *");
+ item->command = strdup (SERVER_COMMAND);
if (item->command == NULL)
{
ERROR ("powerdns plugin: strdup failed.");
else
{
sstrncpy (buffer, "get ", sizeof (buffer));
- status = strjoin (&buffer[4], sizeof (buffer) - strlen ("get "),
+ status = strjoin (&buffer[strlen("get ")], sizeof (buffer) - strlen ("get "),
li->fields, li->fields_num,
/* seperator = */ " ");
if (status < 0)
ERROR ("powerdns plugin: strjoin failed.");
return (-1);
}
+ buffer[sizeof (buffer) - 1] = 0;
+ int i = strlen (buffer);
+ if (i < sizeof (buffer) - 2)
+ {
+ buffer[i++] = ' ';
+ buffer[i++] = '\n';
+ buffer[i++] = '\0';
+ }
}
buffer[sizeof (buffer) - 1] = 0;
pse.vmem_code = 0;
pse.stack_size = 0;
+ pse.io_rchar = -1;
+ pse.io_wchar = -1;
+ pse.io_syscr = -1;
+ pse.io_syscw = -1;
+
ps_list_add (cmdline, cargs, &pse);
} /* for (i = 0 .. nprocs) */
}
else
{
- WARNING ("snmp plugin: I don't know the ASN type `%i'", (int) vl->type);
+ char oid_buffer[1024];
+
+ memset (oid_buffer, 0, sizeof (oid_buffer));
+ snprint_objid (oid_buffer, sizeof (oid_buffer) - 1,
+ vl->name, vl->name_length);
+
+#ifdef ASN_NULL
+ if (vl->type == ASN_NULL)
+ INFO ("snmp plugin: OID \"%s\" is undefined (type ASN_NULL)",
+ oid_buffer);
+ else
+#endif
+ WARNING ("snmp plugin: I don't know the ASN type \"%i\" (OID: %s)",
+ (int) vl->type, oid_buffer);
+
defined = 0;
}
for (i = 0; i < num_chars; i++)
{
/* Check for control characters. */
- if ((src[i] >= 0) && (src[i] < 32))
+ if ((unsigned char)src[i] < 32)
return (csnmp_strvbcopy_hexstring (dst, vb, dst_size));
dst[i] = src[i];
}