[Machine readable output from userland utilities] report

Zaro Korchev zkorchev at mail.bg
Wed Jun 18 16:15:52 UTC 2014


Hi everybody

This week I finished working on netstat which took a lot of time as it supports huge amount of possible output statistics.
Here is an example after formatting:

{
    "internet": [
        {
            "proto": "udp4 ",
            "recv": 0,
            "sent": 0,
            "local address": "10.0.2.15.53954 ",
            "foreign address": "4.2.2.2.53 "
        },
    ],
    "unix": [
        {
            "sockets": [
                {
                    "address": -8796049594976,
                    "type": "stream",
                    "recv": 0,
                    "send": 0,
                    "inode": -8796049389256,
                    "conn": 0,
                    "refs": 0,
                    "nextref": 0,
                    "path": "/var/run/casper"
                },
                {
                    "address": -8796049594736,
                    "type": "stream",
                    "recv": 0,
                    "send": 0,
                    "inode": 0,
                    "conn": -8796049594496,
                    "refs": 0,
                    "nextref": 0
                },
                {
                    "address": -8796049594496,
                    "type": "stream",
                    "recv": 0,
                    "send": 0,
                    "inode": 0,
                    "conn": -8796049594736,
                    "refs": 0,
                    "nextref": 0
                },
                {
                    "address": -8796049593536,
                    "type": "stream",
                    "recv": 0,
                    "send": 0,
                    "inode": -8796050837032,
                    "conn": 0,
                    "refs": 0,
                    "nextref": 0,
                    "path": "/var/run/devd.pipe"
                }
            ]
        },
        {
            "sockets": [
                {
                    "address": -8796049596416,
                    "type": "dgram",
                    "recv": 0,
                    "send": 0,
                    "inode": 0,
                    "conn": -8796049594016,
                    "refs": 0,
                    "nextref": -8796049596176
                },
                {
                    "address": -8796049596176,
                    "type": "dgram",
                    "recv": 0,
                    "send": 0,
                    "inode": 0,
                    "conn": -8796049594016,
                    "refs": 0,
                    "nextref": -8796049595936
                },
                {
                    "address": -8796049595936,
                    "type": "dgram",
                    "recv": 0,
                    "send": 0,
                    "inode": 0,
                    "conn": -8796049594016,
                    "refs": 0,
                    "nextref": -8796049595696
                },
                {
                    "address": -8796049595696,
                    "type": "dgram",
                    "recv": 0,
                    "send": 0,
                    "inode": 0,
                    "conn": -8796049594016,
                    "refs": 0,
                    "nextref": -8796049595216
                },
                {
                    "address": -8796049595456,
                    "type": "dgram",
                    "recv": 0,
                    "send": 0,
                    "inode": 0,
                    "conn": -8796049593776,
                    "refs": 0,
                    "nextref": 0
                },
                {
                    "address": -8796049595216,
                    "type": "dgram",
                    "recv": 0,
                    "send": 0,
                    "inode": 0,
                    "conn": -8796049594016,
                    "refs": 0,
                    "nextref": -8796049594256
                },
                {
                    "address": -8796049594256,
                    "type": "dgram",
                    "recv": 0,
                    "send": 0,
                    "inode": 0,
                    "conn": -8796049594016,
                    "refs": 0,
                    "nextref": 0
                },
                {
                    "address": -8796049594016,
                    "type": "dgram",
                    "recv": 0,
                    "send": 0,
                    "inode": -8796050221216,
                    "conn": 0,
                    "refs": -8796049596416,
                    "nextref": 0,
                    "path": "/var/run/logpriv"
                },
                {
                    "address": -8796049593776,
                    "type": "dgram",
                    "recv": 0,
                    "send": 0,
                    "inode": -8796050220744,
                    "conn": 0,
                    "refs": -8796049595456,
                    "nextref": 0,
                    "path": "/var/run/logpriv"
                }
            ]
        },
        {
            "sockets": []
        }
    ]
}

There are some issues that I'm working on fixing. The most important is how to display very big integers which at the moment is not directly possible with yajl.

In the process I did some changes to libsol (like adding boolean support).

I did some fixes on the ls project and updated it to use the newest API of the system's libsol.

I'm currently working on fixing bugs and then I'm going to add libsol support to more tools.


Zaro


More information about the soc-status mailing list