#endif
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
-#include <sys/types.h>
-#include <sys/vm_usage.h>
#include <procfs.h>
#include <zone.h>
} zone_stats_t;
static int
-zone_compare(const zoneid_t *a, const zoneid_t *b)
+zone_compare(const void *a, const void *b)
{
- if (*a == *b)
+ if (*(const zoneid_t *)a == *(const zoneid_t *)b)
return(0);
- if (*a < *b)
+ if (*(const zoneid_t *)a < *(const zoneid_t *)b)
return(-1);
return(1);
}
vl.values = values;
vl.values_len = 1; /*STATIC_ARRAY_SIZE (values);*/
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "zone", sizeof (vl.plugin));
sstrncpy (vl.type, "percent", sizeof (vl.type));
sstrncpy (vl.type_instance, zone, sizeof (vl.type_instance));
while (c_avl_pick (tree, (void **)&zoneid, (void **)&stats) == 0)
{
if (getzonenamebyid(*zoneid, zonename, sizeof( zonename )) == -1) {
- WARNING("zone plugin: error retreiving zonename");
+ WARNING("zone plugin: error retrieving zonename");
} else {
zone_submit_value(zonename, (gauge_t)FRC2PCT(stats->pctcpu));
}
c_avl_tree_t *tree;
zone_stats_t *stats;
- if (!(tree=c_avl_create((void *) zone_compare))) {
+ if (!(tree=c_avl_create(zone_compare))) {
WARNING("zone plugin: Failed to create tree");
return(NULL);
}