---
title: "How to fix negative number for latency on check_vmware_api"
description: "Negative latency values can cause the check_vmware_api plugin to return CRITICAL status intermittently. This issue can be resolved by collecting multiple data samples or by switching to the newer check_vmware_v2 plugin."
url: "https://docs.itrsgroup.com/docs/faq/op5/360020053734-op5-monitor-how-to-fix-negative-number-for-latency-on-check-vmware-api/index.html"
---
## Question

---

Every few minutes, a check will return CRITICAL  as it appears to be getting a negative number for latency:

```
CHECK_VMWARE_API.PL CRITICAL - io read latency=-1 ms | io_read=-1ms;40;90
```

The same check will then return OK a few seconds later:

```
CHECK_VMWARE_API.PL OK - io read latency=0 ms | io_read=0ms;40;90
```

Any idea why it might be getting a negative number?

## Answer

---

This problem can be fixed by collecting multiple samples of the data, described in the help text for the plugin:

```
-M, --maxsamples=<max sample count> Maximum number of samples to retrieve. Max sample number is ignored for historic intervals. Default value is 1 (latest available sample).
```

Note that check\_vmware\_api is already deprecated. Consider switching to [check\_vmware\_v2](https://docs.itrsgroup.com/docs/op5-monitor/current/topics/plugins/plugin-reference.html#check_vmware_v2) instead.


