"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/device/sysdep_SOLARIS.c" between
monit-5.27.2.tar.gz and monit-5.28.0.tar.gz

About: Monit is a utility for managing and monitoring processes, files, directories and filesystems (with automatic error recovery).

sysdep_SOLARIS.c  (monit-5.27.2):sysdep_SOLARIS.c  (monit-5.28.0)
skipping to change at line 95 skipping to change at line 95
#define PATHTOINST "/etc/path_to_inst" #define PATHTOINST "/etc/path_to_inst"
static struct { static struct {
int generation; // Increment each time the mount table is changed int generation; // Increment each time the mount table is changed
unsigned long long timestamp; // /etc/mnttab timestamp [ms] (changed on mount/unmount) unsigned long long timestamp; // /etc/mnttab timestamp [ms] (changed on mount/unmount)
} _statistics = {}; } _statistics = {};
/* ----------------------------------------------------------------- Private */ /* ----------------------------------------------------------------- Private */
static bool _getDummyDiskActivity(void *_inf) { static bool _getDummyDiskActivity(__attribute__ ((unused)) void *_inf) {
return true; return true;
} }
static bool _getZfsDiskActivity(void *_inf) { static bool _getZfsDiskActivity(void *_inf) {
Info_T inf = _inf; Info_T inf = _inf;
bool rv = false; bool rv = false;
libzfs_handle_t *z = libzfs_init(); libzfs_handle_t *z = libzfs_init();
libzfs_print_on_error(z, 1); libzfs_print_on_error(z, 1);
zpool_handle_t *zp = zpool_open_canfail(z, inf->filesystem->object.key); zpool_handle_t *zp = zpool_open_canfail(z, inf->filesystem->object.key);
if (zp) { if (zp) {
nvlist_t *zpoolConfig = zpool_get_config(zp, NULL); nvlist_t *zpoolConfig = zpool_get_config(zp, NULL);
nvlist_t *zpoolVdevTree = NULL; nvlist_t *zpoolVdevTree = NULL;
if (nvlist_lookup_nvlist(zpoolConfig, ZPOOL_CONFIG_VDEV_TREE, &z poolVdevTree) == 0) { if (nvlist_lookup_nvlist(zpoolConfig, ZPOOL_CONFIG_VDEV_TREE, &z poolVdevTree) == 0) {
vdev_stat_t *zpoolStatistics = NULL; vdev_stat_t *zpoolStatistics = NULL;
uint_t zpoolStatisticsCount = 0; uint_t zpoolStatisticsCount = 0;
if (nvlist_lookup_uint64_array(zpoolVdevTree, ZPOOL_CONF IG_VDEV_STATS, (unsigned long long **)&zpoolStatistics, &zpoolStatisticsCount) = = 0) { if (nvlist_lookup_uint64_array(zpoolVdevTree, ZPOOL_CONF IG_VDEV_STATS, (uint64_t **)&zpoolStatistics, &zpoolStatisticsCount) == 0) {
//FIXME: if the zpool state has error, trigger t he fs event, can also report number of read/write/checksum errors (see vdev_stat _t in /usr/include/sys/fs/zfs.h) //FIXME: if the zpool state has error, trigger t he fs event, can also report number of read/write/checksum errors (see vdev_stat _t in /usr/include/sys/fs/zfs.h)
DEBUG("ZFS pool '%s' state: %s\n", inf->filesyst em->object.key, zpool_state_to_name(zpoolStatistics->vs_state, zpoolStatistics-> vs_aux)); DEBUG("ZFS pool '%s' state: %s\n", inf->filesyst em->object.key, zpool_state_to_name(zpoolStatistics->vs_state, zpoolStatistics-> vs_aux));
unsigned long long now = Time_milli(); unsigned long long now = Time_milli();
Statistics_update(&(inf->filesystem->read.bytes) , now, zpoolStatistics->vs_bytes[ZIO_TYPE_READ]); Statistics_update(&(inf->filesystem->read.bytes) , now, zpoolStatistics->vs_bytes[ZIO_TYPE_READ]);
Statistics_update(&(inf->filesystem->write.bytes ), now, zpoolStatistics->vs_bytes[ZIO_TYPE_WRITE]); Statistics_update(&(inf->filesystem->write.bytes ), now, zpoolStatistics->vs_bytes[ZIO_TYPE_WRITE]);
Statistics_update(&(inf->filesystem->read.operat ions), now, zpoolStatistics->vs_ops[ZIO_TYPE_READ]); Statistics_update(&(inf->filesystem->read.operat ions), now, zpoolStatistics->vs_ops[ZIO_TYPE_READ]);
Statistics_update(&(inf->filesystem->write.opera tions), now, zpoolStatistics->vs_ops[ZIO_TYPE_WRITE]); Statistics_update(&(inf->filesystem->write.opera tions), now, zpoolStatistics->vs_ops[ZIO_TYPE_WRITE]);
rv = true; rv = true;
} }
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)