Menu

#20 njmon2influx.py read njmon data error

Unstable (example)
open
None
4
2022-11-16
2022-11-15
LiukeCode
No
njmon -s 5 |python3 njmon2influx.py njmond.conf
Traceback (most recent call last):
  File "/root/njmon-tools/njmon2influx.py", line 240, in <module>
    host = inject_snapshot(json.loads(line))
  File "/root/njmon-tools/njmon2influx.py", line 125, in inject_snapshot
    timestamp = sample["timestamp"]["UTC"]
TypeError: 'int' object is not subscriptable

Discussion

  • LiukeCode

    LiukeCode - 2022-11-15

    env: unbutu 22.10.
    run the njmon, will echo the pid first, Causes script error.
    add

    # line:241
    if isinstance(eval(line), dict):
    

    fixed

     
  • Nigel Griffiths

    Nigel Griffiths - 2022-11-15

    Use the -n option with njmon.
    This switches off the outputting of the process id, PID.

     
    • LiukeCode

      LiukeCode - 2022-11-16

      Thanks.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.