liske / needrestart

Restart daemons after library updates.
GNU General Public License v2.0
426 stars 67 forks source link

Enhancement: JSON output #306

Open sebneus opened 3 months ago

sebneus commented 3 months ago

Hi

I would highly appreciate it, if there would be json output with the parameter -j. I know there is also the batch output but for some scripts (pyhton) and some monitoring solutions (zabbix) it would be great to have json output.

From your bash output example I created an example:

{
    "version": "2.1",
    "kernel": {
        "current": "3.19.3-tl1",
        "expected": "3.19.3-tl1",
        "status": "1",
        "status_description": "no pending upgrade"
    },
    "services": [
        "systemd-journald.service",
        "systemd-machined.service"
    ],
    "container": [
        "LXC web1"
    ],
    "sessions": [
        "metabase @ user manager service",
        "root @ session #28017"
    ],
    "microcode": "obsolete"
}

Thanks for the great tool! Sebastian