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

Neptune Apex plugin - unable to parse "none -0400" #5883

Closed
boozer2 opened this issue May 21, 2019 · 5 comments · Fixed by #5896
Closed

Neptune Apex plugin - unable to parse "none -0400" #5883

boozer2 opened this issue May 21, 2019 · 5 comments · Fixed by #5896
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@boozer2
Copy link

boozer2 commented May 21, 2019

Relevant telegraf.conf:

# Neptune Apex data collector
[[inputs.neptune_apex]]
   ## The Neptune Apex plugin reads the publicly available status.xml data from a local Apex.
   ## Measurements will be logged under "apex".

   ## The base URL of the local Apex(es). If you specify more than one server, they will
   ## be differentiated by the "source" tag.
   servers = [
     "http://192.168.111.111",
   ]

   ## The response_timeout specifies how long to wait for a reply from the Apex.
   #response_timeout = "5s"

System info:

Telegraf 1.10.4
Ubuntu 18.04 Server

Steps to reproduce:

I haven't gotten this to work at all because of this parsing error. This appears to be because the plugin is expecting a date but the Apex is returning "none" for power restored time.

Expected behavior:

No errors, and data logged to InfluxDB

Actual behavior:

Error: telegraf[9919]: 2019-05-21T00:33:50Z E! [inputs.neptune_apex]: Error in plugin: unable to parse "none -0400" (parsing time "none -0400": month out of range)

And nothing is added to my database from this input plugin.

Additional info:

Beginning of my Apex status.xml:

<status software="4.53_AB17" hardware="1.0">
    <hostname>FishTank</hostname>
    <serial>AC4:12345</serial>
    <timezone>-4.00</timezone>
    <date>05/20/2019 20:24:36</date>
    <power>
        <failed>05/06/2019 17:43:41</failed>
        <restored>none</restored>
    </power>
@danielnelson
Copy link
Contributor

It seems like we should either ignore errors parsing the failed/restored time and possible log them as warnings (could be annoying if restored is always none). @MaxRenaud What do you think?

@danielnelson danielnelson added the bug unexpected problem or unintended behavior label May 21, 2019
@MaxRenaud
Copy link
Contributor

Yes, this works. I'm surprised that this field can ever be "none" considering the device has power and serving an xml file.
I'll submit a diff this weekend that ignores errors in both "failed" and "restored" and omits these fields. I'm a bit hesitant to log them as warnings since it seems like a persistent error but I'm OK to do it if it fits Telegraf's general logging practices from external sensors

boozer2,
I'm sorry this is happening on your new installation. As a temporary fix until we get a new release done, you can try to power cycle your apex from the wall and hopefully this field will be populated in the status.xml

@danielnelson
Copy link
Contributor

If the error is persistent, and can't be cleared up by the user, then we shouldn't log.

@boozer2
Copy link
Author

boozer2 commented May 21, 2019

I power-cycled, and I see the "failed" time has updated, but the restored time still says "none". That is kind of strange...

@MaxRenaud
Copy link
Contributor

@danielnelson ACK for the logging
@boozer2 This seems like an Apex bug and we'll work around it by not logging these invalid fields. I imagine any automation will have do something like "if current_failed > previous_failed" or something like that so the lack of data should be OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants