summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/monit.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/app/src/monit.c b/app/src/monit.c
index ff474fd..3be3ce3 100644
--- a/app/src/monit.c
+++ b/app/src/monit.c
@@ -11,10 +11,22 @@ unsigned int g_monit_interval = 1;
int vdev_instance_stats_get(struct vdev_instance * vdi, struct vdev_stat_info * stat_info)
{
- struct vnode_cons_stat * st_cons_rx = vnode_mirror_cons_stat_get(vdi->vnode_rx_cons);
- struct vnode_prod_stat * st_prod_tx = vnode_mirror_prod_stat_get(vdi->vnode_tx_prod);
- struct vnode_prod_stat * st_prod_ftx = vnode_mirror_prod_stat_get(vdi->vnode_ftx_prod);
- struct vnode_prod_stat * st_prod_ltx = vnode_mirror_prod_stat_get(vdi->vnode_ltx_prod);
+ struct vnode_cons_stat * st_cons_rx = NULL;
+ struct vnode_prod_stat * st_prod_tx = NULL;
+ struct vnode_prod_stat * st_prod_ftx = NULL;
+ struct vnode_prod_stat * st_prod_ltx = NULL;
+
+ if(vdi->nr_rxstream > 0)
+ {
+ st_cons_rx = vnode_mirror_cons_stat_get(vdi->vnode_rx_cons);
+ }
+
+ if(vdi->nr_txstream > 0)
+ {
+ st_prod_tx = vnode_mirror_prod_stat_get(vdi->vnode_tx_prod);
+ st_prod_ftx = vnode_mirror_prod_stat_get(vdi->vnode_ftx_prod);
+ st_prod_ltx = vnode_mirror_prod_stat_get(vdi->vnode_ltx_prod);
+ }
stat_info->nr_rxstream = vdi->nr_rxstream;
stat_info->nr_txstream = vdi->nr_txstream;