question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New Parser: nmcli

See original GitHub issue

Awesome work! I’ve already used jc for some ifconfig work. Along the same line I’d think nmcli would be a handy one. If I find some time this weekend I can take a stab at it.

Thanks again!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
kellyjonbrazilcommented, Jan 21, 2022

Hi @sebastian-burlacu! No worries. I decided against creating parsers for iproute2 for a few reasons:

  • It already had some JSON output capability at the time I started jc, so I didn’t want to give the iproute2 developers an excuse to stop/slow-down enhancing the capability by having a workaround using jc
  • I created parsers for other legacy commands that provided the same or similar output (e.g. route, ifconfig)
  • Newer versions of iproute2 now have good JSON output support
1reaction
bobpaulcommented, Sep 28, 2021

Not sure if this helps any, but I’ve been able to ~use~ abuse the generic yaml parser on some of nmcli outputs. Example, to get the APN configured on a cellular connection:

$ nmcli c show wan |  jc --yaml | jq --raw-output '.[0]."gsm.apn"'
VZWINTERNET
Read more comments on GitHub >

github_iconTop Results From Across the Web

Nmcli parsers — insights-core 3.0.8 documentation
This parser works like a python dictionary, all parsed data can be accessed via the dict interfaces. Sample input for /usr/bin/nmcli dev ...
Read more >
nmcli: NetworkManager Reference Manual
nmcli is a command-line tool for controlling NetworkManager and reporting network status. It can be utilized as a replacement for nm-applet or other...
Read more >
nmcli: NetworkManager Reference Manual
nmcli is a command-line tool for controlling NetworkManager and reporting network status. It can be utilized as a replacement for nm-applet or other...
Read more >
nmcli should show output in non-pretty-printed form for parsing
The "nmcli connection show" command now displays the correct output for both `empty` and `NULL` values Previously, the output of the "nmcli connection...
Read more >
nmcli - PyPI
A python wrapper library for the network-manager cli client. ... Create a new connection using specified properties. nmcli.connection.add( conn_type: str, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found