Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MANDATE can be a different date format #6

Closed
MariusSchiffer opened this issue Mar 2, 2019 · 10 comments
Closed

MANDATE can be a different date format #6

MariusSchiffer opened this issue Mar 2, 2019 · 10 comments

Comments

@MariusSchiffer
Copy link

Apparently MANDATE can also be in a 03/06/09 format in addition to the normal Y-M-D format.

Example in the documentation: http://www.apcupsd.org/manual/manual.html#apcupsd-network-monitoring-cgi-programs

The prometheus exporter fails on my system with this error:
parsing time "03/06/09" as "2006-01-02": cannot parse "6/09" as "2006"
with a MANDATE of 03/06/09.

@mdlayher
Copy link
Owner

mdlayher commented Mar 2, 2019

Of course it can, ha. To clarify, does "03/06/09" mean March 6th, 2009?

@MariusSchiffer
Copy link
Author

MariusSchiffer commented Mar 2, 2019

Exactly, M/D/Y.
MANDATE seems to be equal to the date on the quality assurance test document.

@mdlayher
Copy link
Owner

mdlayher commented Mar 3, 2019

It's been a long time since I looked at this code, but it appears it doesn't parse MANDATE at all. Can you show the output of apcaccess and the logs from the exporter?

@maxxant
Copy link
Contributor

maxxant commented Mar 4, 2019

status examples for two various UPS:

in first UPS:
MANDATE : 2005-02-15
BATTDATE : 2001-09-25

in second:
MANDATE : 07/31/99
BATTDATE : 07/31/99

and i have dirty fix for BATDATE in my GH fork: maxxant@16f68f9

but for full coverage we needs fix all cases, which presents in apcupsd (that your can see in https://github.com/maxxant/apcupsd-status-examples)

@mdlayher
Copy link
Owner

mdlayher commented Mar 4, 2019

That's a super useful repo for me, thanks! Want to open a pull request for your change? I have a couple small nits but we can work them out.

@mdlayher
Copy link
Owner

mdlayher commented Mar 6, 2019

BATTDATE parsing should be fixed as of now, and we don't parse MANDATE at the moment. But now we can whenever needed.

@toby11
Copy link

toby11 commented Nov 16, 2019

I have another example with a different format BATTDATE

BATTDATE : 12/28/2013

full apcaccess output here

APC : 001,044,1024 DATE : 2019-11-16 18:04:54 +0000 HOSTNAME : pve VERSION : 3.14.14 (31 May 2016) debian UPSNAME : APCUPS CABLE : Ethernet Link DRIVER : SNMP UPS Driver UPSMODE : Stand Alone STARTTIME: 2019-11-16 17:48:50 +0000 MODEL : Smart-UPS 750 STATUS : ONLINE LINEV : 230.0 Volts LOADPCT : 44.0 Percent BCHARGE : 100.0 Percent TIMELEFT : 23.0 Minutes MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 0 Seconds MAXLINEV : 237.0 Volts MINLINEV : 230.0 Volts OUTPUTV : 230.0 Volts SENSE : High DWAKE : 1000 Seconds DSHUTD : 20 Seconds DLOWBATT : 2 Minutes LOTRANS : 207.0 Volts HITRANS : 253.0 Volts ITEMP : 21.0 C ALARMDEL : 30 Seconds BATTV : 27.0 Volts LINEFREQ : 50.0 Hz LASTXFER : Line voltage notch or spike NUMXFERS : 0 TONBATT : 0 Seconds CUMONBATT: 0 Seconds XOFFBATT : N/A SELFTEST : OK STESTI : OFF STATFLAG : 0x05000008 MANDATE : 12/28/2013 SERIALNO : AS1352131956 BATTDATE : 12/28/2013 NOMOUTV : 230 Volts FIRMWARE : UPS 08.8 (ID18) END APC : 2019-11-16 18:04:58 +0000

@netstx
Copy link

netstx commented Jun 6, 2020

I am still having this issue where BATTDATE can't be parsed.
Telegraf version 1.14.3 (git: HEAD 1b35d6c2).
apcupsd version 3.14.14 (31 May 2016) freebsd

APCUPSD output:
...
MANDATE : 04/04/2014
BATTDATE : 02/15/2018
...

Any suggestions?

@mdlayher
Copy link
Owner

mdlayher commented Jun 6, 2020

I don't use telegraf, please file an issue there. This problem is resolved here.

@netstx
Copy link

netstx commented Jun 6, 2020

Ok, will do. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants