[Nut-upsuser] query "Data stale" from the cmdline
clepple at gmail.com
Mon Jun 27 12:59:02 UTC 2016
On Jun 27, 2016, at 4:46 AM, Thomas Jarosch wrote:
> is there a way to query from the cmdline if the UPS data is stale?
The "data stale" state applies to the entire set of variables for an UPS, so if the exit code of `upsc` is zero, the data set is not stale.
> "upsc" outputs a lot of information, but not if the data is stale.
> Example output from a "stale" UPS on the server:
Actually, you caught the UPS right after it was no longer stale -- otherwise, `upsc` would print just the "Error: Data stale" message instead of the variables.
> driver.name: usbhid-ups
> driver.parameter.pollfreq: 30
> driver.parameter.pollinterval: 2
You can tune these parameters to avoid the stale condition, at the expense of slightly longer latency for updates. The smaller `pollinterval` (seconds between poll cycles) is used for items marked "HU_FLAG_QUICK_POLL" in the HID tables: https://github.com/networkupstools/nut/blob/master/drivers/apc-hid.c#L301 and the `pollfreq` value is used for polling the rest.
More information here: http://networkupstools.org/docs/man/usbhid-ups.html (I think the interrupt stuff applies to APC models with USB ID 051d:0002)
If needed, we can look at the debug output to see what is going on, but for whatever reason, a few "data stale" messages over the course of a day seems normal for many USB UPS interfaces.
clepple at gmail
More information about the Nut-upsuser