- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "memory");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "memory", sizeof (vl.plugin));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
memory_submit ("cache", sysctl_vals[6]);
/* #endif HAVE_SYSCTLBYNAME */
memory_submit ("cache", sysctl_vals[6]);
/* #endif HAVE_SYSCTLBYNAME */
memory_submit ("cached", mem_cached);
memory_submit ("free", mem_free);
}
memory_submit ("cached", mem_cached);
memory_submit ("free", mem_free);
}
memory_submit ("used", mem_used);
memory_submit ("free", mem_free);
memory_submit ("locked", mem_lock);
memory_submit ("used", mem_used);
memory_submit ("free", mem_free);
memory_submit ("locked", mem_lock);
sg_mem_stats *ios;
if ((ios = sg_get_mem_stats ()) != NULL)
{
memory_submit ("used", ios->used);
sg_mem_stats *ios;
if ((ios = sg_get_mem_stats ()) != NULL)
{
memory_submit ("used", ios->used);
memory_submit ("free", ios->free);
}
#endif /* HAVE_LIBSTATGRAB */
memory_submit ("free", ios->free);
}
#endif /* HAVE_LIBSTATGRAB */