mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2026-04-03 17:44:07 +02:00
Compare commits
176 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f9164ea77 | ||
|
|
7fd6fecbf5 | ||
|
|
8029f72363 | ||
|
|
c7fdce5d3b | ||
|
|
84f48aa369 | ||
|
|
2e9a0a9c12 | ||
|
|
c1f6f2b950 | ||
|
|
ede21bca13 | ||
|
|
8dd9a9f9cb | ||
|
|
04f92cd133 | ||
|
|
8be8d2393b | ||
|
|
0a879681be | ||
|
|
2ca1587a49 | ||
|
|
ec2cd2d708 | ||
|
|
5d0dbece93 | ||
|
|
df1e4b414b | ||
|
|
40760991e7 | ||
|
|
464f5f86cf | ||
|
|
7b09e9fccd | ||
|
|
6cba7d4298 | ||
|
|
9730f62e49 | ||
|
|
e0c1c87f54 | ||
|
|
931b3d2b83 | ||
|
|
e5d561baee | ||
|
|
2867593e7a | ||
|
|
dd52fee563 | ||
|
|
8e1f885827 | ||
|
|
2d39a58f90 | ||
|
|
9c4fa2ae26 | ||
|
|
de52d84e82 | ||
|
|
ce9b55059a | ||
|
|
bcd370a6a0 | ||
|
|
c8216850ab | ||
|
|
f5feedb90b | ||
|
|
a4371cd187 | ||
|
|
9d5ba4c834 | ||
|
|
1639dee1bb | ||
|
|
9363f430f2 | ||
|
|
9192a09073 | ||
|
|
b915eb9755 | ||
|
|
1cfcc2b592 | ||
|
|
7138dd02b7 | ||
|
|
b4276643b7 | ||
|
|
2ef00763bf | ||
|
|
54364928fc | ||
|
|
09b3b4932b | ||
|
|
29d6670119 | ||
|
|
2f654b5f1a | ||
|
|
e53b9f5992 | ||
|
|
addb234e61 | ||
|
|
76eca3b659 | ||
|
|
f90dec4c0e | ||
|
|
8900a59d4c | ||
|
|
6685138200 | ||
|
|
4d3e65b980 | ||
|
|
e9282bb546 | ||
|
|
f5627a4594 | ||
|
|
81ffdb2510 | ||
|
|
4c00a99850 | ||
|
|
2bfcb45b28 | ||
|
|
ab0c10e791 | ||
|
|
2c1935115d | ||
|
|
d98e43dc78 | ||
|
|
9348988d64 | ||
|
|
1285c66467 | ||
|
|
b7191bbc13 | ||
|
|
98b97509f7 | ||
|
|
2b2b570490 | ||
|
|
cce2d1ff29 | ||
|
|
b79600c572 | ||
|
|
140f1a8543 | ||
|
|
e34657cfde | ||
|
|
99070fa607 | ||
|
|
2b46785b1f | ||
|
|
c72562524b | ||
|
|
b7dd6441c7 | ||
|
|
31fcc2f755 | ||
|
|
b391aa14bc | ||
|
|
d3c45debbb | ||
|
|
5b08469b87 | ||
|
|
4a77ec63a4 | ||
|
|
d13606b6dc | ||
|
|
05291c93bb | ||
|
|
8cf00a208e | ||
|
|
06d73c8876 | ||
|
|
649c646ea2 | ||
|
|
b7756d9250 | ||
|
|
1cd2cd954c | ||
|
|
72020b8da9 | ||
|
|
cf9720b749 | ||
|
|
967b9db7f9 | ||
|
|
bb3acb1182 | ||
|
|
560c7f7e6d | ||
|
|
79b2841764 | ||
|
|
a06a89cbd1 | ||
|
|
431bd969eb | ||
|
|
c87b722aec | ||
|
|
3688b8b014 | ||
|
|
07b8d9e0c0 | ||
|
|
7454b53e39 | ||
|
|
3d6a76024d | ||
|
|
421b980957 | ||
|
|
4a22e27d6a | ||
|
|
99f7842dee | ||
|
|
7f869b4b18 | ||
|
|
9665f4ee84 | ||
|
|
606904d48b | ||
|
|
3f5279b97c | ||
|
|
f5ec21e6ac | ||
|
|
578a284465 | ||
|
|
422e392d9d | ||
|
|
54dfffd34a | ||
|
|
cffba64d2b | ||
|
|
56a0c12a59 | ||
|
|
c174d3de18 | ||
|
|
a9c59ef9fc | ||
|
|
abdb9b2673 | ||
|
|
548aaab626 | ||
|
|
20571c87ae | ||
|
|
19e49200de | ||
|
|
d32f5c67a9 | ||
|
|
b83b626435 | ||
|
|
ab2c1b25ec | ||
|
|
f2d46313a4 | ||
|
|
87e4796a6c | ||
|
|
0014a5c2f4 | ||
|
|
7af56e0dad | ||
|
|
a5ae6e3c01 | ||
|
|
fe1a0d1faf | ||
|
|
302f05cdda | ||
|
|
c0044be7b0 | ||
|
|
0110078807 | ||
|
|
42eacb45f8 | ||
|
|
a43e2e1991 | ||
|
|
c8b721d4f6 | ||
|
|
d0bfddc3d9 | ||
|
|
6b925a16c8 | ||
|
|
89ebd9fc22 | ||
|
|
6b4ba66231 | ||
|
|
5b697dc381 | ||
|
|
9ba73c95d1 | ||
|
|
93aa390447 | ||
|
|
3cfb8945dd | ||
|
|
cd8d38f2a1 | ||
|
|
8ec8cd6294 | ||
|
|
c028113561 | ||
|
|
5f22e1c803 | ||
|
|
d3351787e5 | ||
|
|
e5bea9ae3b | ||
|
|
93c710abe9 | ||
|
|
c29e7cfe5c | ||
|
|
cb5c1ba00d | ||
|
|
9a012b94e1 | ||
|
|
400f5a44ec | ||
|
|
a2ab5bab91 | ||
|
|
fc8ab27361 | ||
|
|
59f19d33a5 | ||
|
|
dfc9618115 | ||
|
|
8e02e5c75a | ||
|
|
970493ab93 | ||
|
|
64d78956eb | ||
|
|
40c05346f4 | ||
|
|
e9b0bc1409 | ||
|
|
798e6bb7d9 | ||
|
|
12a370deed | ||
|
|
553bfbe1a0 | ||
|
|
52494321fc | ||
|
|
c6c9e06496 | ||
|
|
e3a6c05a58 | ||
|
|
391d06f68d | ||
|
|
99804ea06e | ||
|
|
51935deb2a | ||
|
|
b24d0c3a47 | ||
|
|
762a886d6f | ||
|
|
2c3e9ddfe4 | ||
|
|
c7cd2b63c8 |
2
.github/workflows/pythonapp.yml
vendored
2
.github/workflows/pythonapp.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Test code
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,5 +3,4 @@ __pycache__
|
||||
dist/
|
||||
build/
|
||||
*.egg-info/
|
||||
jc/parsers.old/
|
||||
.github/
|
||||
|
||||
2
LICENSE.md
Executable file → Normal file
2
LICENSE.md
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Kelly Brazil
|
||||
Copyright (c) 2020 Kelly Brazil
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
graft tests/fixtures
|
||||
325
README.md
Executable file → Normal file
325
README.md
Executable file → Normal file
@@ -1,9 +1,12 @@
|
||||

|
||||

|
||||
|
||||
# JC
|
||||
JSON CLI output utility
|
||||
|
||||
`jc` is used to JSONify the output of many standard linux cli tools and file types for easier parsing in scripts. See the [**Parsers**](#parsers) section for supported commands and file types.
|
||||
`jc` JSONifies the output of many CLI tools and file-types for easier parsing in scripts. See the [**Parsers**](#parsers) section for supported commands and file-types.
|
||||
|
||||
This allows further command line processing of output with tools like `jq` simply by piping commands:
|
||||
This allows further command-line processing of output with tools like `jq` by piping commands:
|
||||
```
|
||||
$ ls -l /usr/bin | jc --ls | jq '.[] | select(.size > 50000000)'
|
||||
{
|
||||
@@ -63,13 +66,29 @@ Schemas for each parser can be found in the [`docs/parsers`](https://github.com/
|
||||
|
||||
Release notes can be found [here](https://blog.kellybrazil.com/category/jc-news/).
|
||||
|
||||
For more information on the motivations for this project, please see my [blog post](https://blog.kellybrazil.com/2019/11/26/bringing-the-unix-philosophy-to-the-21st-century/).
|
||||
**Why would anyone do this?!** For more information on the motivations for this project, please see my [blog post](https://blog.kellybrazil.com/2019/11/26/bringing-the-unix-philosophy-to-the-21st-century/).
|
||||
|
||||
## Installation
|
||||
There are several ways to get `jc`. You can install via `pip`, `brew`, DEB or RPM packages, or by downloading the correct binary for your architecture and running it anywhere on your filesystem.
|
||||
|
||||
### Pip (macOS, linux, unix, Windows)
|
||||
```
|
||||
$ pip3 install --upgrade jc
|
||||
```
|
||||
|
||||
### Zypper (openSUSE linux)
|
||||
```
|
||||
# zypper install jc
|
||||
```
|
||||
|
||||
### Brew (macOS)
|
||||
```
|
||||
$ brew install jc
|
||||
```
|
||||
|
||||
### Packages and Binaries
|
||||
Please see https://kellyjonbrazil.github.io/jc-packaging/ for details.
|
||||
|
||||
## Usage
|
||||
`jc` accepts piped input from `STDIN` and outputs a JSON representation of the previous command's output to `STDOUT`.
|
||||
```
|
||||
@@ -82,6 +101,8 @@ jc [OPTIONS] COMMAND
|
||||
The JSON output can be compact (default) or pretty formatted with the `-p` option.
|
||||
|
||||
### Parsers
|
||||
- `--airport` enables the `airport -I` command parser (OSX)
|
||||
- `--airport-s` enables the `airport -s` command parser (OSX)
|
||||
- `--arp` enables the `arp` command parser
|
||||
- `--blkid` enables the `blkid` command parser
|
||||
- `--crontab` enables the `crontab` command and file parser
|
||||
@@ -89,8 +110,10 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio
|
||||
- `--csv` enables the `CSV` file parser
|
||||
- `--df` enables the `df` command parser
|
||||
- `--dig` enables the `dig` command parser
|
||||
- `--dmidecode` enables the `dmidecode` command parser
|
||||
- `--du` enables the `du` command parser
|
||||
- `--env` enables the `env` command parser
|
||||
- `--file` enables the `file` command parser
|
||||
- `--free` enables the `free` command parser
|
||||
- `--fstab` enables the `/etc/fstab` file parser
|
||||
- `--group` enables the `/etc/group` file parser
|
||||
@@ -109,6 +132,7 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio
|
||||
- `--lsof` enables the `lsof` command parser
|
||||
- `--mount` enables the `mount` command parser
|
||||
- `--netstat` enables the `netstat` command parser
|
||||
- `--ntpq` enables the `ntpq -p` command parser
|
||||
- `--passwd` enables the `/etc/passwd` file parser
|
||||
- `--pip-list` enables the `pip list` command parser
|
||||
- `--pip-show` enables the `pip show` command parser
|
||||
@@ -121,6 +145,7 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio
|
||||
- `--systemctl-lj` enables the `systemctl list-jobs` command parser
|
||||
- `--systemctl-ls` enables the `systemctl list-sockets` command parser
|
||||
- `--systemctl-luf` enables the `systemctl list-unit-files` command parser
|
||||
- `--timedatectl` enables the `timedatectl status` command parser
|
||||
- `--uname` enables the `uname -a` command parser
|
||||
- `--uptime` enables the `uptime` command parser
|
||||
- `--w` enables the `w` command parser
|
||||
@@ -131,17 +156,30 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio
|
||||
### Options
|
||||
- `-a` about `jc`. Prints information about `jc` and the parsers (in JSON, of course!)
|
||||
- `-d` debug mode. Prints trace messages if parsing issues encountered
|
||||
- `-m` monochrome JSON output
|
||||
- `-p` pretty format the JSON output
|
||||
- `-q` quiet mode. Suppresses warning messages
|
||||
- `-r` raw output. Provides a more literal JSON output with all values as text and no additional sematic processing
|
||||
- `-r` raw output. Provides a more literal JSON output with all values as strings and no additional sematic processing
|
||||
|
||||
## Contributions
|
||||
Feel free to add/improve code or parsers! You can use the [`jc/parsers/foo.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo.py) parser as a template and submit your parser with a pull request.
|
||||
### Setting Custom Colors via Environment Variable
|
||||
You can specify custom colors via the `JC_COLORS` environment variable. The `JC_COLORS` environment variable takes four comma separated string values in the following format:
|
||||
```
|
||||
JC_COLORS=<keyname_color>,<keyword_color>,<number_color>,<string_color>
|
||||
```
|
||||
Where colors are: `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `gray`, `brightblack`, `brightred`, `brightgreen`, `brightyellow`, `brightblue`, `brightmagenta`, `brightcyan`, `white`, or `default`
|
||||
|
||||
For example, to set to the default colors:
|
||||
```
|
||||
JC_COLORS=blue,brightblack,magenta,green
|
||||
```
|
||||
or
|
||||
```
|
||||
JC_COLORS=default,default,default,default
|
||||
```
|
||||
|
||||
## Compatibility
|
||||
Some parsers like `ls`, `ps`, `dig`, etc. will work on any platform. Other parsers that are platform-specific will generate a warning message if they are used on an unsupported platform. To see all parser information, including compatibility, run `jc -ap`.
|
||||
|
||||
|
||||
You may still use a parser on an unsupported platform - for example, you may want to parse a file with linux `lsof` output on an OSX laptop. In that case you can suppress the warning message with the `-q` cli option or the `quiet=True` function parameter in `parse()`:
|
||||
|
||||
```
|
||||
@@ -151,10 +189,15 @@ $ cat lsof.out | jc --lsof -q
|
||||
Tested on:
|
||||
- Centos 7.7
|
||||
- Ubuntu 18.4
|
||||
- Fedora32
|
||||
- OSX 10.11.6
|
||||
- OSX 10.14.6
|
||||
|
||||
## Contributions
|
||||
Feel free to add/improve code or parsers! You can use the [`jc/parsers/foo.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo.py) parser as a template and submit your parser with a pull request.
|
||||
|
||||
## Acknowledgments
|
||||
- CI automation and code optimizations from https://github.com/philippeitis
|
||||
- `ifconfig-parser` module from https://github.com/KnightWhoSayNi/ifconfig-parser
|
||||
- `xmltodict` module from https://github.com/martinblech/xmltodict by Martín Blech
|
||||
- `ruamel.yaml` library from https://pypi.org/project/ruamel.yaml by Anthon van der Neut
|
||||
@@ -162,6 +205,67 @@ Tested on:
|
||||
- Excellent constructive feedback from Ilya Sher (https://github.com/ilyash-b)
|
||||
|
||||
## Examples
|
||||
### airport -I
|
||||
```
|
||||
$ airport -I | jc --airport -p # or: jc -p airport -I
|
||||
{
|
||||
"agrctlrssi": -66,
|
||||
"agrextrssi": 0,
|
||||
"agrctlnoise": -90,
|
||||
"agrextnoise": 0,
|
||||
"state": "running",
|
||||
"op_mode": "station",
|
||||
"lasttxrate": 195,
|
||||
"maxrate": 867,
|
||||
"lastassocstatus": 0,
|
||||
"802_11_auth": "open",
|
||||
"link_auth": "wpa2-psk",
|
||||
"bssid": "3c:37:86:15:ad:f9",
|
||||
"ssid": "SnazzleDazzle",
|
||||
"mcs": 0,
|
||||
"channel": "48,80"
|
||||
}
|
||||
```
|
||||
### airport -s
|
||||
```
|
||||
$ airport -s | jc --airport-s -p # or: jc -p airport -s
|
||||
[
|
||||
{
|
||||
"ssid": "DIRECT-4A-HP OfficeJet 3830",
|
||||
"bssid": "00:67:eb:2a:a7:3b",
|
||||
"rssi": -90,
|
||||
"channel": "6",
|
||||
"ht": true,
|
||||
"cc": "--",
|
||||
"security": [
|
||||
"WPA2(PSK/AES/AES)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ssid": "Latitude38",
|
||||
"bssid": "c0:ff:d5:d2:7a:f3",
|
||||
"rssi": -85,
|
||||
"channel": "11",
|
||||
"ht": true,
|
||||
"cc": "US",
|
||||
"security": [
|
||||
"WPA2(PSK/AES/AES)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ssid": "xfinitywifi",
|
||||
"bssid": "6e:e3:0e:b8:45:99",
|
||||
"rssi": -83,
|
||||
"channel": "11",
|
||||
"ht": true,
|
||||
"cc": "US",
|
||||
"security": [
|
||||
"NONE"
|
||||
]
|
||||
},
|
||||
...
|
||||
]
|
||||
```
|
||||
### arp
|
||||
```
|
||||
$ arp | jc --arp -p # or: jc -p arp
|
||||
@@ -242,7 +346,7 @@ $ blkid | jc --blkid -p # or: jc -p blkid
|
||||
]
|
||||
```
|
||||
```
|
||||
$ sudo blkid -o udev -ip /dev/sda2 | jc --blkid -p # or: sudo jc -p blkid -o udev -ip /dev/sda2
|
||||
# blkid -o udev -ip /dev/sda2 | jc --blkid -p # or: jc -p blkid -o udev -ip /dev/sda2
|
||||
[
|
||||
{
|
||||
"id_fs_uuid": "3klkIj-w1kk-DkJi-0XBJ-y3i7-i2Ac-vHqWBM",
|
||||
@@ -637,6 +741,51 @@ $ dig -x 1.1.1.1 | jc --dig -p # or: jc -p dig -x 1.1.1.1
|
||||
}
|
||||
]
|
||||
```
|
||||
### dmidecode
|
||||
```
|
||||
# dmidecode | jc --dmidecode -p # or: jc -p dmidecode
|
||||
{
|
||||
"handle": "0x0000",
|
||||
"type": 0,
|
||||
"bytes": 24,
|
||||
"description": "BIOS Information",
|
||||
"values": {
|
||||
"vendor": "Phoenix Technologies LTD",
|
||||
"version": "6.00",
|
||||
"release_date": "04/13/2018",
|
||||
"address": "0xEA490",
|
||||
"runtime_size": "88944 bytes",
|
||||
"rom_size": "64 kB",
|
||||
"characteristics": [
|
||||
"ISA is supported",
|
||||
"PCI is supported",
|
||||
"PC Card (PCMCIA) is supported",
|
||||
"PNP is supported",
|
||||
"APM is supported",
|
||||
"BIOS is upgradeable",
|
||||
"BIOS shadowing is allowed",
|
||||
"ESCD support is available",
|
||||
"Boot from CD is supported",
|
||||
"Selectable boot is supported",
|
||||
"EDD is supported",
|
||||
"Print screen service is supported (int 5h)",
|
||||
"8042 keyboard services are supported (int 9h)",
|
||||
"Serial services are supported (int 14h)",
|
||||
"Printer services are supported (int 17h)",
|
||||
"CGA/mono video services are supported (int 10h)",
|
||||
"ACPI is supported",
|
||||
"Smart battery is supported",
|
||||
"BIOS boot specification is supported",
|
||||
"Function key-initiated network boot is supported",
|
||||
"Targeted content distribution is supported"
|
||||
],
|
||||
"bios_revision": "4.6",
|
||||
"firmware_revision": "0.0"
|
||||
}
|
||||
},
|
||||
...
|
||||
]
|
||||
```
|
||||
### du
|
||||
```
|
||||
$ du /usr | jc --du -p # or: jc -p du /usr
|
||||
@@ -695,6 +844,41 @@ $ env | jc --env -p # or: jc -p env
|
||||
...
|
||||
]
|
||||
```
|
||||
### file
|
||||
```
|
||||
$ file * | jc --file -p # or: jc -p file *
|
||||
[
|
||||
{
|
||||
"filename": "Applications",
|
||||
"type": "directory"
|
||||
},
|
||||
{
|
||||
"filename": "another file with spaces",
|
||||
"type": "empty"
|
||||
},
|
||||
{
|
||||
"filename": "argstest.py",
|
||||
"type": "Python script text executable, ASCII text"
|
||||
},
|
||||
{
|
||||
"filename": "blkid-p.out",
|
||||
"type": "ASCII text"
|
||||
},
|
||||
{
|
||||
"filename": "blkid-pi.out",
|
||||
"type": "ASCII text, with very long lines"
|
||||
},
|
||||
{
|
||||
"filename": "cd_catalog.xml",
|
||||
"type": "XML 1.0 document text, ASCII text, with CRLF line terminators"
|
||||
},
|
||||
{
|
||||
"filename": "centosserial.sh",
|
||||
"type": "Bourne-Again shell script text executable, UTF-8 Unicode text"
|
||||
},
|
||||
...
|
||||
]
|
||||
```
|
||||
### free
|
||||
```
|
||||
$ free | jc --free -p # or: jc -p free
|
||||
@@ -1017,7 +1201,7 @@ $ cat example.ini | jc --ini -p
|
||||
```
|
||||
### iptables
|
||||
```
|
||||
$ sudo iptables --line-numbers -v -L -t nat | jc --iptables -p # or: sudo jc -p iptables --line-numbers -v -L -t nat
|
||||
# iptables --line-numbers -v -L -t nat | jc --iptables -p # or: jc -p iptables --line-numbers -v -L -t nat
|
||||
[
|
||||
{
|
||||
"chain": "PREROUTING",
|
||||
@@ -1247,7 +1431,7 @@ $ lsmod | jc --lsmod -p # or: jc -p lsmod
|
||||
```
|
||||
### lsof
|
||||
```
|
||||
$ sudo lsof | jc --lsof -p # or: sudo jc -p lsof
|
||||
# lsof | jc --lsof -p # or: jc -p lsof
|
||||
[
|
||||
{
|
||||
"command": "systemd",
|
||||
@@ -1334,7 +1518,7 @@ $ mount | jc --mount -p # or: jc -p mount
|
||||
```
|
||||
### netstat
|
||||
```
|
||||
$ sudo netstat -apee | jc --netstat -p # or: sudo jc -p netstat -apee
|
||||
# netstat -apee | jc --netstat -p # or: jc -p netstat -apee
|
||||
[
|
||||
{
|
||||
"proto": "tcp",
|
||||
@@ -1483,6 +1667,107 @@ $ sudo netstat -apee | jc --netstat -p # or: sudo jc -p netstat -apee
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ netstat -r | jc --netstat -p # or: jc -p netstat -r
|
||||
[
|
||||
{
|
||||
"destination": "default",
|
||||
"gateway": "gateway",
|
||||
"genmask": "0.0.0.0",
|
||||
"route_flags": "UG",
|
||||
"mss": 0,
|
||||
"window": 0,
|
||||
"irtt": 0,
|
||||
"iface": "ens33",
|
||||
"kind": "route"
|
||||
},
|
||||
{
|
||||
"destination": "172.17.0.0",
|
||||
"gateway": "0.0.0.0",
|
||||
"genmask": "255.255.0.0",
|
||||
"route_flags": "U",
|
||||
"mss": 0,
|
||||
"window": 0,
|
||||
"irtt": 0,
|
||||
"iface": "docker0",
|
||||
"kind": "route"
|
||||
},
|
||||
{
|
||||
"destination": "192.168.71.0",
|
||||
"gateway": "0.0.0.0",
|
||||
"genmask": "255.255.255.0",
|
||||
"route_flags": "U",
|
||||
"mss": 0,
|
||||
"window": 0,
|
||||
"irtt": 0,
|
||||
"iface": "ens33",
|
||||
"kind": "route"
|
||||
}
|
||||
]
|
||||
|
||||
$ netstat -i | jc --netstat -p # or: jc -p netstat -i
|
||||
[
|
||||
{
|
||||
"iface": "ens33",
|
||||
"mtu": 1500,
|
||||
"rx_ok": 476,
|
||||
"rx_err": 0,
|
||||
"rx_drp": 0,
|
||||
"rx_ovr": 0,
|
||||
"tx_ok": 312,
|
||||
"tx_err": 0,
|
||||
"tx_drp": 0,
|
||||
"tx_ovr": 0,
|
||||
"flg": "BMRU",
|
||||
"kind": "interface"
|
||||
},
|
||||
{
|
||||
"iface": "lo",
|
||||
"mtu": 65536,
|
||||
"rx_ok": 0,
|
||||
"rx_err": 0,
|
||||
"rx_drp": 0,
|
||||
"rx_ovr": 0,
|
||||
"tx_ok": 0,
|
||||
"tx_err": 0,
|
||||
"tx_drp": 0,
|
||||
"tx_ovr": 0,
|
||||
"flg": "LRU",
|
||||
"kind": "interface"
|
||||
}
|
||||
]
|
||||
```
|
||||
### ntpq
|
||||
```
|
||||
$ ntpq -p | jc --ntpq -p # or: jc -p ntpq -p
|
||||
[
|
||||
{
|
||||
"remote": "44.190.6.254",
|
||||
"refid": "127.67.113.92",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 1,
|
||||
"poll": 64,
|
||||
"reach": 1,
|
||||
"delay": 23.399,
|
||||
"offset": -2.805,
|
||||
"jitter": 2.131,
|
||||
"state": null
|
||||
},
|
||||
{
|
||||
"remote": "mirror1.sjc02.s",
|
||||
"refid": "216.218.254.202",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 2,
|
||||
"poll": 64,
|
||||
"reach": 1,
|
||||
"delay": 29.325,
|
||||
"offset": 1.044,
|
||||
"jitter": 4.069,
|
||||
"state": null
|
||||
}
|
||||
]
|
||||
```
|
||||
### /etc/passwd file
|
||||
```
|
||||
@@ -1697,7 +1982,7 @@ $ route -ee | jc --route -p # or: jc -p route -ee
|
||||
```
|
||||
### /etc/shadow file
|
||||
```
|
||||
$ sudo cat /etc/shadow | jc --shadow -p
|
||||
# cat /etc/shadow | jc --shadow -p
|
||||
[
|
||||
{
|
||||
"username": "root",
|
||||
@@ -1734,7 +2019,7 @@ $ sudo cat /etc/shadow | jc --shadow -p
|
||||
```
|
||||
### ss
|
||||
```
|
||||
$ sudo ss -a | jc --ss -p # or: sudo jc -p ss -a
|
||||
# ss -a | jc --ss -p # or: jc -p ss -a
|
||||
[
|
||||
{
|
||||
"netid": "nl",
|
||||
@@ -1991,6 +2276,20 @@ $ systemctl list-unit-files | jc --systemctl-luf -p # or: jc -p system
|
||||
...
|
||||
]
|
||||
```
|
||||
### timedatectl status
|
||||
```
|
||||
$ timedatectl | jc --timedatectl -p # or: jc -p timedatectl
|
||||
{
|
||||
"local_time": "Tue 2020-03-10 17:53:21 PDT",
|
||||
"universal_time": "Wed 2020-03-11 00:53:21 UTC",
|
||||
"rtc_time": "Wed 2020-03-11 00:53:21",
|
||||
"time_zone": "America/Los_Angeles (PDT, -0700)",
|
||||
"ntp_enabled": true,
|
||||
"ntp_synchronized": true,
|
||||
"rtc_in_local_tz": false,
|
||||
"dst_active": true
|
||||
}
|
||||
```
|
||||
### uname -a
|
||||
```
|
||||
$ uname -a | jc --uname -p # or: jc -p uname -a
|
||||
|
||||
@@ -1,7 +1,77 @@
|
||||
jc changelog
|
||||
|
||||
20200523 v1.11.1
|
||||
- Update stat command parser to change osx_flags field to string
|
||||
|
||||
20200522 v1.11.0
|
||||
- Add dmidecode command parser
|
||||
- Update stat command parser to add OSX support
|
||||
- Update netstat command parser to add OSX support
|
||||
- Update netstat command parser to add -r (route) functionality for linux and OSX
|
||||
- Update netstat command parser to add -i (interface) functionality for linux and OSX
|
||||
|
||||
20200511 v1.10.12
|
||||
- Remove shebang from jc/cli.py for Fedora packaging
|
||||
|
||||
20200511 v1.10.11
|
||||
- Change file permissions for Fedora packaging
|
||||
|
||||
20200509 v1.10.10
|
||||
- Fix ls parser issue where the first file was skipped for ls -R on some platforms
|
||||
- Update last parser to handle 'gone - no logout' condition
|
||||
- Update netstat parser to handle bluetooth section (ignore gracefully for now)
|
||||
|
||||
20200508 v1.10.9
|
||||
- Add license info to vendorized ifconfig-parser class
|
||||
|
||||
20200508 v1.10.8
|
||||
- Add license file to dist for Fedora RPM packaging requirements
|
||||
- Remove tests from package to keep from polluting the global site-packages
|
||||
|
||||
20200501 v1.10.7
|
||||
- Requirements modifications for Fedora RPM packaging requirements
|
||||
|
||||
20200420 v1.10.6
|
||||
- Remove homebrew shim references from du osx tests
|
||||
|
||||
20200414 v1.10.5
|
||||
- Minor change of using sys.exit(0) instead of exit()
|
||||
|
||||
20200412 v1.10.4
|
||||
- Add color customization via JC_COLORS env variable
|
||||
|
||||
20200409 v1.10.3
|
||||
- Fix break on pipe error
|
||||
|
||||
20200409 v1.10.2
|
||||
- Change colors to ansi and match jello colors
|
||||
|
||||
20200402 v1.10.1
|
||||
- Code cleanup
|
||||
|
||||
20200402 v1.10.0
|
||||
- Add color output by default when not piping data to another program
|
||||
- Add -m option for monochrome output
|
||||
|
||||
20200326 v1.9.3
|
||||
- Add axfr support for dig command parser
|
||||
|
||||
20200312 v1.9.2
|
||||
- Updated arp parser to fix OSX detection for some edge cases
|
||||
|
||||
20200312 v1.9.1
|
||||
- Updated file command parser to make filename splitting more robust
|
||||
|
||||
20200311 v1.9.0
|
||||
- Added ntpq command parser
|
||||
- Added timedatectl status command parser
|
||||
- Added airport -I and airport -s command parser
|
||||
- Added file command parser
|
||||
- Optimized history command parser by https://github.com/philippeitis
|
||||
- Magic syntax fix for certain edge cases
|
||||
|
||||
20200308 v1.8.1
|
||||
- CLI and history parser optimizations by https://github.com/philippeitis
|
||||
- CLI optimizations by https://github.com/philippeitis
|
||||
- Refactored magic syntax function and added tests (https://github.com/philippeitis)
|
||||
- Github actions for CI testing on multiple platforms by https://github.com/philippeitis
|
||||
- Updated ls parser to fix parsing error in OSX with -lR when there are empty folders
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
cd jc
|
||||
pydocmd simple jc+ > ../docs/readme.md
|
||||
pydocmd simple utils+ > ../docs/utils.md
|
||||
pydocmd simple jc.parsers.airport+ > ../docs/parsers/airport.md
|
||||
pydocmd simple jc.parsers.airport_s+ > ../docs/parsers/airport_s.md
|
||||
pydocmd simple jc.parsers.arp+ > ../docs/parsers/arp.md
|
||||
pydocmd simple jc.parsers.blkid+ > ../docs/parsers/blkid.md
|
||||
pydocmd simple jc.parsers.crontab+ > ../docs/parsers/crontab.md
|
||||
@@ -11,8 +13,10 @@ pydocmd simple jc.parsers.crontab_u+ > ../docs/parsers/crontab_u.md
|
||||
pydocmd simple jc.parsers.csv+ > ../docs/parsers/csv.md
|
||||
pydocmd simple jc.parsers.df+ > ../docs/parsers/df.md
|
||||
pydocmd simple jc.parsers.dig+ > ../docs/parsers/dig.md
|
||||
pydocmd simple jc.parsers.dmidecode+ > ../docs/parsers/dmidecode.md
|
||||
pydocmd simple jc.parsers.du+ > ../docs/parsers/du.md
|
||||
pydocmd simple jc.parsers.env+ > ../docs/parsers/env.md
|
||||
pydocmd simple jc.parsers.file+ > ../docs/parsers/file.md
|
||||
pydocmd simple jc.parsers.free+ > ../docs/parsers/free.md
|
||||
pydocmd simple jc.parsers.fstab+ > ../docs/parsers/fstab.md
|
||||
pydocmd simple jc.parsers.group+ > ../docs/parsers/group.md
|
||||
@@ -31,6 +35,7 @@ pydocmd simple jc.parsers.lsmod+ > ../docs/parsers/lsmod.md
|
||||
pydocmd simple jc.parsers.lsof+ > ../docs/parsers/lsof.md
|
||||
pydocmd simple jc.parsers.mount+ > ../docs/parsers/mount.md
|
||||
pydocmd simple jc.parsers.netstat+ > ../docs/parsers/netstat.md
|
||||
pydocmd simple jc.parsers.ntpq+ > ../docs/parsers/ntpq.md
|
||||
pydocmd simple jc.parsers.passwd+ > ../docs/parsers/passwd.md
|
||||
pydocmd simple jc.parsers.pip_list+ > ../docs/parsers/pip_list.md
|
||||
pydocmd simple jc.parsers.pip_show+ > ../docs/parsers/pip_show.md
|
||||
@@ -43,6 +48,7 @@ pydocmd simple jc.parsers.systemctl+ > ../docs/parsers/systemctl.md
|
||||
pydocmd simple jc.parsers.systemctl_lj+ > ../docs/parsers/systemctl_lj.md
|
||||
pydocmd simple jc.parsers.systemctl_ls+ > ../docs/parsers/systemctl_ls.md
|
||||
pydocmd simple jc.parsers.systemctl_luf+ > ../docs/parsers/systemctl_luf.md
|
||||
pydocmd simple jc.parsers.timedatectl+ > ../docs/parsers/timedatectl.md
|
||||
pydocmd simple jc.parsers.uname+ > ../docs/parsers/uname.md
|
||||
pydocmd simple jc.parsers.uptime+ > ../docs/parsers/uptime.md
|
||||
pydocmd simple jc.parsers.w+ > ../docs/parsers/w.md
|
||||
|
||||
109
docs/parsers/airport.md
Normal file
109
docs/parsers/airport.md
Normal file
@@ -0,0 +1,109 @@
|
||||
# jc.parsers.airport
|
||||
jc - JSON CLI output utility airport -I Parser
|
||||
|
||||
Usage:
|
||||
|
||||
specify --airport as the first argument if the piped input is coming from airport -I (OSX)
|
||||
|
||||
This program can be found at:
|
||||
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
|
||||
|
||||
Compatibility:
|
||||
|
||||
'darwin'
|
||||
|
||||
Examples:
|
||||
|
||||
$ airport -I | jc --airport -p
|
||||
{
|
||||
"agrctlrssi": -66,
|
||||
"agrextrssi": 0,
|
||||
"agrctlnoise": -90,
|
||||
"agrextnoise": 0,
|
||||
"state": "running",
|
||||
"op_mode": "station",
|
||||
"lasttxrate": 195,
|
||||
"maxrate": 867,
|
||||
"lastassocstatus": 0,
|
||||
"802_11_auth": "open",
|
||||
"link_auth": "wpa2-psk",
|
||||
"bssid": "3c:37:86:15:ad:f9",
|
||||
"ssid": "SnazzleDazzle",
|
||||
"mcs": 0,
|
||||
"channel": "48,80"
|
||||
}
|
||||
|
||||
$ airport -I | jc --airport -p -r
|
||||
{
|
||||
"agrctlrssi": "-66",
|
||||
"agrextrssi": "0",
|
||||
"agrctlnoise": "-90",
|
||||
"agrextnoise": "0",
|
||||
"state": "running",
|
||||
"op_mode": "station",
|
||||
"lasttxrate": "195",
|
||||
"maxrate": "867",
|
||||
"lastassocstatus": "0",
|
||||
"802_11_auth": "open",
|
||||
"link_auth": "wpa2-psk",
|
||||
"bssid": "3c:37:86:15:ad:f9",
|
||||
"ssid": "SnazzleDazzle",
|
||||
"mcs": "0",
|
||||
"channel": "48,80"
|
||||
}
|
||||
|
||||
## info
|
||||
```python
|
||||
info(self, /, *args, **kwargs)
|
||||
```
|
||||
|
||||
## process
|
||||
```python
|
||||
process(proc_data)
|
||||
```
|
||||
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Structured data with the following schema:
|
||||
|
||||
{
|
||||
"agrctlrssi": integer,
|
||||
"agrextrssi": integer,
|
||||
"agrctlnoise": integer,
|
||||
"agrextnoise": integer,
|
||||
"state": string,
|
||||
"op_mode": string,
|
||||
"lasttxrate": integer,
|
||||
"maxrate": integer,
|
||||
"lastassocstatus": integer,
|
||||
"802_11_auth": string,
|
||||
"link_auth": string,
|
||||
"bssid": string,
|
||||
"ssid": string,
|
||||
"mcs": integer,
|
||||
"channel": string
|
||||
}
|
||||
|
||||
## parse
|
||||
```python
|
||||
parse(data, raw=False, quiet=False)
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) output preprocessed JSON if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
136
docs/parsers/airport_s.md
Normal file
136
docs/parsers/airport_s.md
Normal file
@@ -0,0 +1,136 @@
|
||||
# jc.parsers.airport_s
|
||||
jc - JSON CLI output utility airport -s Parser
|
||||
|
||||
Usage:
|
||||
|
||||
specify --airport as the first argument if the piped input is coming from airport -s (OSX)
|
||||
|
||||
This program can be found at:
|
||||
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
|
||||
|
||||
Compatibility:
|
||||
|
||||
'darwin'
|
||||
|
||||
Examples:
|
||||
|
||||
$ airport -s | jc --airport-s -p
|
||||
[
|
||||
{
|
||||
"ssid": "DIRECT-4A-HP OfficeJet 3830",
|
||||
"bssid": "00:67:eb:2a:a7:3b",
|
||||
"rssi": -90,
|
||||
"channel": "6",
|
||||
"ht": true,
|
||||
"cc": "--",
|
||||
"security": [
|
||||
"WPA2(PSK/AES/AES)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ssid": "Latitude38",
|
||||
"bssid": "c0:ff:d5:d2:7a:f3",
|
||||
"rssi": -85,
|
||||
"channel": "11",
|
||||
"ht": true,
|
||||
"cc": "US",
|
||||
"security": [
|
||||
"WPA2(PSK/AES/AES)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ssid": "xfinitywifi",
|
||||
"bssid": "6e:e3:0e:b8:45:99",
|
||||
"rssi": -83,
|
||||
"channel": "11",
|
||||
"ht": true,
|
||||
"cc": "US",
|
||||
"security": [
|
||||
"NONE"
|
||||
]
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ airport -s | jc --airport -p -r
|
||||
[
|
||||
{
|
||||
"ssid": "DIRECT-F3-HP ENVY 5660 series",
|
||||
"bssid": "b0:5a:da:6f:0a:d4",
|
||||
"rssi": "-93",
|
||||
"channel": "1",
|
||||
"ht": "Y",
|
||||
"cc": "--",
|
||||
"security": "WPA2(PSK/AES/AES)"
|
||||
},
|
||||
{
|
||||
"ssid": "YouAreInfected-5",
|
||||
"bssid": "5c:e3:0e:c2:85:da",
|
||||
"rssi": "-85",
|
||||
"channel": "36",
|
||||
"ht": "Y",
|
||||
"cc": "US",
|
||||
"security": "WPA(PSK/AES,TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP)"
|
||||
},
|
||||
{
|
||||
"ssid": "YuanFamily",
|
||||
"bssid": "5c:e3:0e:b8:5f:9a",
|
||||
"rssi": "-84",
|
||||
"channel": "11",
|
||||
"ht": "Y",
|
||||
"cc": "US",
|
||||
"security": "WPA(PSK/AES,TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP)"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
## info
|
||||
```python
|
||||
info(self, /, *args, **kwargs)
|
||||
```
|
||||
|
||||
## process
|
||||
```python
|
||||
process(proc_data)
|
||||
```
|
||||
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Structured data with the following schema:
|
||||
[
|
||||
{
|
||||
"ssid": string,
|
||||
"bssid": string,
|
||||
"rssi": integer,
|
||||
"channel": string,
|
||||
"ht": boolean,
|
||||
"cc": string,
|
||||
"security": [
|
||||
string,
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
## parse
|
||||
```python
|
||||
parse(data, raw=False, quiet=False)
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) output preprocessed JSON if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Raw or processed structured data.
|
||||
|
||||
@@ -353,6 +353,15 @@ Returns:
|
||||
"answer_num": integer,
|
||||
"authority_num": integer,
|
||||
"additional_num": integer,
|
||||
"axfr": [
|
||||
{
|
||||
"name": string,
|
||||
"class": string,
|
||||
"type": string,
|
||||
"ttl": integer,
|
||||
"data": string
|
||||
}
|
||||
],
|
||||
"question": {
|
||||
"name": string,
|
||||
"class": string,
|
||||
@@ -380,6 +389,7 @@ Returns:
|
||||
"server": string,
|
||||
"when": string,
|
||||
"rcvd": integer
|
||||
"size": string
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
153
docs/parsers/dmidecode.md
Normal file
153
docs/parsers/dmidecode.md
Normal file
@@ -0,0 +1,153 @@
|
||||
# jc.parsers.dmidecode
|
||||
jc - JSON CLI output utility dmidecode Parser
|
||||
|
||||
Usage:
|
||||
|
||||
specify --dmidecode as the first argument if the piped input is coming from dmidecode
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux'
|
||||
|
||||
Examples:
|
||||
|
||||
# dmidecode | jc --dmidecode -p
|
||||
[
|
||||
{
|
||||
"handle": "0x0000",
|
||||
"type": 0,
|
||||
"bytes": 24,
|
||||
"description": "BIOS Information",
|
||||
"values": {
|
||||
"vendor": "Phoenix Technologies LTD",
|
||||
"version": "6.00",
|
||||
"release_date": "04/13/2018",
|
||||
"address": "0xEA490",
|
||||
"runtime_size": "88944 bytes",
|
||||
"rom_size": "64 kB",
|
||||
"characteristics": [
|
||||
"ISA is supported",
|
||||
"PCI is supported",
|
||||
"PC Card (PCMCIA) is supported",
|
||||
"PNP is supported",
|
||||
"APM is supported",
|
||||
"BIOS is upgradeable",
|
||||
"BIOS shadowing is allowed",
|
||||
"ESCD support is available",
|
||||
"Boot from CD is supported",
|
||||
"Selectable boot is supported",
|
||||
"EDD is supported",
|
||||
"Print screen service is supported (int 5h)",
|
||||
"8042 keyboard services are supported (int 9h)",
|
||||
"Serial services are supported (int 14h)",
|
||||
"Printer services are supported (int 17h)",
|
||||
"CGA/mono video services are supported (int 10h)",
|
||||
"ACPI is supported",
|
||||
"Smart battery is supported",
|
||||
"BIOS boot specification is supported",
|
||||
"Function key-initiated network boot is supported",
|
||||
"Targeted content distribution is supported"
|
||||
],
|
||||
"bios_revision": "4.6",
|
||||
"firmware_revision": "0.0"
|
||||
}
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
# dmidecode | jc --dmidecode -p -r
|
||||
[
|
||||
{
|
||||
"handle": "0x0000",
|
||||
"type": "0",
|
||||
"bytes": "24",
|
||||
"description": "BIOS Information",
|
||||
"values": {
|
||||
"vendor": "Phoenix Technologies LTD",
|
||||
"version": "6.00",
|
||||
"release_date": "04/13/2018",
|
||||
"address": "0xEA490",
|
||||
"runtime_size": "88944 bytes",
|
||||
"rom_size": "64 kB",
|
||||
"characteristics": [
|
||||
"ISA is supported",
|
||||
"PCI is supported",
|
||||
"PC Card (PCMCIA) is supported",
|
||||
"PNP is supported",
|
||||
"APM is supported",
|
||||
"BIOS is upgradeable",
|
||||
"BIOS shadowing is allowed",
|
||||
"ESCD support is available",
|
||||
"Boot from CD is supported",
|
||||
"Selectable boot is supported",
|
||||
"EDD is supported",
|
||||
"Print screen service is supported (int 5h)",
|
||||
"8042 keyboard services are supported (int 9h)",
|
||||
"Serial services are supported (int 14h)",
|
||||
"Printer services are supported (int 17h)",
|
||||
"CGA/mono video services are supported (int 10h)",
|
||||
"ACPI is supported",
|
||||
"Smart battery is supported",
|
||||
"BIOS boot specification is supported",
|
||||
"Function key-initiated network boot is supported",
|
||||
"Targeted content distribution is supported"
|
||||
],
|
||||
"bios_revision": "4.6",
|
||||
"firmware_revision": "0.0"
|
||||
}
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
## info
|
||||
```python
|
||||
info(self, /, *args, **kwargs)
|
||||
```
|
||||
|
||||
## process
|
||||
```python
|
||||
process(proc_data)
|
||||
```
|
||||
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Structured data with the following schema:
|
||||
|
||||
[
|
||||
{
|
||||
"handle": string,
|
||||
"type": integer,
|
||||
"bytes": integer,
|
||||
"description": string,
|
||||
"values": { (null if empty)
|
||||
"lowercase_no_spaces_keys": string,
|
||||
"multiline_key_values": [
|
||||
string,
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
## parse
|
||||
```python
|
||||
parse(data, raw=False, quiet=False)
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) output preprocessed JSON if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Raw or processed structured data.
|
||||
|
||||
90
docs/parsers/file.md
Normal file
90
docs/parsers/file.md
Normal file
@@ -0,0 +1,90 @@
|
||||
# jc.parsers.file
|
||||
jc - JSON CLI output utility file command Parser
|
||||
|
||||
Usage:
|
||||
|
||||
specify --file as the first argument if the piped input is coming from file.
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux', 'aix', 'freebsd', 'darwin'
|
||||
|
||||
Examples:
|
||||
|
||||
$ file * | jc --file -p
|
||||
[
|
||||
{
|
||||
"filename": "Applications",
|
||||
"type": "directory"
|
||||
},
|
||||
{
|
||||
"filename": "another file with spaces",
|
||||
"type": "empty"
|
||||
},
|
||||
{
|
||||
"filename": "argstest.py",
|
||||
"type": "Python script text executable, ASCII text"
|
||||
},
|
||||
{
|
||||
"filename": "blkid-p.out",
|
||||
"type": "ASCII text"
|
||||
},
|
||||
{
|
||||
"filename": "blkid-pi.out",
|
||||
"type": "ASCII text, with very long lines"
|
||||
},
|
||||
{
|
||||
"filename": "cd_catalog.xml",
|
||||
"type": "XML 1.0 document text, ASCII text, with CRLF line terminators"
|
||||
},
|
||||
{
|
||||
"filename": "centosserial.sh",
|
||||
"type": "Bourne-Again shell script text executable, UTF-8 Unicode text"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
## info
|
||||
```python
|
||||
info(self, /, *args, **kwargs)
|
||||
```
|
||||
|
||||
## process
|
||||
```python
|
||||
process(proc_data)
|
||||
```
|
||||
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Structured data with the following schema:
|
||||
|
||||
[
|
||||
{
|
||||
"filename": string,
|
||||
"type ": string
|
||||
}
|
||||
]
|
||||
|
||||
## parse
|
||||
```python
|
||||
parse(data, raw=False, quiet=False)
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) output preprocessed JSON if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Raw or processed structured data.
|
||||
|
||||
@@ -147,6 +147,17 @@ Examples:
|
||||
info(self, /, *args, **kwargs)
|
||||
```
|
||||
|
||||
## IfconfigParser
|
||||
```python
|
||||
IfconfigParser(self, console_output)
|
||||
```
|
||||
|
||||
## InterfaceNotFound
|
||||
```python
|
||||
InterfaceNotFound(self, /, *args, **kwargs)
|
||||
```
|
||||
|
||||
|
||||
## process
|
||||
```python
|
||||
process(proc_data)
|
||||
|
||||
@@ -5,13 +5,18 @@ Usage:
|
||||
|
||||
Specify --netstat as the first argument if the piped input is coming from netstat
|
||||
|
||||
Caveats:
|
||||
|
||||
- Use of multiple 'l' options is not supported on OSX (e.g. 'netstat -rlll')
|
||||
- Use of the 'A' option is not supported on OSX when using the 'r' option (e.g. netstat -rA)
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux'
|
||||
'linux', 'darwin'
|
||||
|
||||
Examples:
|
||||
|
||||
$ sudo netstat -apee | jc --netstat -p
|
||||
# netstat -apee | jc --netstat -p
|
||||
[
|
||||
{
|
||||
"proto": "tcp",
|
||||
@@ -161,152 +166,73 @@ Examples:
|
||||
...
|
||||
]
|
||||
|
||||
$ sudo netstat -apee | jc --netstat -p -r
|
||||
$ netstat -r | jc --netstat -p
|
||||
[
|
||||
{
|
||||
"proto": "tcp",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "localhost",
|
||||
"foreign_address": "0.0.0.0",
|
||||
"state": "LISTEN",
|
||||
"user": "systemd-resolve",
|
||||
"inode": "26958",
|
||||
"program_name": "systemd-resolve",
|
||||
"kind": "network",
|
||||
"pid": "887",
|
||||
"local_port": "domain",
|
||||
"foreign_port": "*",
|
||||
"transport_protocol": "tcp",
|
||||
"network_protocol": "ipv4"
|
||||
"destination": "default",
|
||||
"gateway": "gateway",
|
||||
"genmask": "0.0.0.0",
|
||||
"route_flags": "UG",
|
||||
"mss": 0,
|
||||
"window": 0,
|
||||
"irtt": 0,
|
||||
"iface": "ens33",
|
||||
"kind": "route"
|
||||
},
|
||||
{
|
||||
"proto": "tcp",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "0.0.0.0",
|
||||
"foreign_address": "0.0.0.0",
|
||||
"state": "LISTEN",
|
||||
"user": "root",
|
||||
"inode": "30499",
|
||||
"program_name": "sshd",
|
||||
"kind": "network",
|
||||
"pid": "1186",
|
||||
"local_port": "ssh",
|
||||
"foreign_port": "*",
|
||||
"transport_protocol": "tcp",
|
||||
"network_protocol": "ipv4"
|
||||
"destination": "172.17.0.0",
|
||||
"gateway": "0.0.0.0",
|
||||
"genmask": "255.255.0.0",
|
||||
"route_flags": "U",
|
||||
"mss": 0,
|
||||
"window": 0,
|
||||
"irtt": 0,
|
||||
"iface": "docker0",
|
||||
"kind": "route"
|
||||
},
|
||||
{
|
||||
"proto": "tcp",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "localhost",
|
||||
"foreign_address": "localhost",
|
||||
"state": "ESTABLISHED",
|
||||
"user": "root",
|
||||
"inode": "46829",
|
||||
"program_name": "sshd: root",
|
||||
"kind": "network",
|
||||
"pid": "2242",
|
||||
"local_port": "ssh",
|
||||
"foreign_port": "52186",
|
||||
"transport_protocol": "tcp",
|
||||
"network_protocol": "ipv4"
|
||||
"destination": "192.168.71.0",
|
||||
"gateway": "0.0.0.0",
|
||||
"genmask": "255.255.255.0",
|
||||
"route_flags": "U",
|
||||
"mss": 0,
|
||||
"window": 0,
|
||||
"irtt": 0,
|
||||
"iface": "ens33",
|
||||
"kind": "route"
|
||||
}
|
||||
]
|
||||
|
||||
$ netstat -i | jc --netstat -p
|
||||
[
|
||||
{
|
||||
"iface": "ens33",
|
||||
"mtu": 1500,
|
||||
"rx_ok": 476,
|
||||
"rx_err": 0,
|
||||
"rx_drp": 0,
|
||||
"rx_ovr": 0,
|
||||
"tx_ok": 312,
|
||||
"tx_err": 0,
|
||||
"tx_drp": 0,
|
||||
"tx_ovr": 0,
|
||||
"flg": "BMRU",
|
||||
"kind": "interface"
|
||||
},
|
||||
{
|
||||
"proto": "tcp",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "localhost",
|
||||
"foreign_address": "localhost",
|
||||
"state": "ESTABLISHED",
|
||||
"user": "root",
|
||||
"inode": "46828",
|
||||
"program_name": "ssh",
|
||||
"kind": "network",
|
||||
"pid": "2241",
|
||||
"local_port": "52186",
|
||||
"foreign_port": "ssh",
|
||||
"transport_protocol": "tcp",
|
||||
"network_protocol": "ipv4"
|
||||
},
|
||||
{
|
||||
"proto": "tcp6",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "[::]",
|
||||
"foreign_address": "[::]",
|
||||
"state": "LISTEN",
|
||||
"user": "root",
|
||||
"inode": "30510",
|
||||
"program_name": "sshd",
|
||||
"kind": "network",
|
||||
"pid": "1186",
|
||||
"local_port": "ssh",
|
||||
"foreign_port": "*",
|
||||
"transport_protocol": "tcp",
|
||||
"network_protocol": "ipv6"
|
||||
},
|
||||
{
|
||||
"proto": "udp",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "localhost",
|
||||
"foreign_address": "0.0.0.0",
|
||||
"state": null,
|
||||
"user": "systemd-resolve",
|
||||
"inode": "26957",
|
||||
"program_name": "systemd-resolve",
|
||||
"kind": "network",
|
||||
"pid": "887",
|
||||
"local_port": "domain",
|
||||
"foreign_port": "*",
|
||||
"transport_protocol": "udp",
|
||||
"network_protocol": "ipv4"
|
||||
},
|
||||
{
|
||||
"proto": "raw6",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "[::]",
|
||||
"foreign_address": "[::]",
|
||||
"state": "7",
|
||||
"user": "systemd-network",
|
||||
"inode": "27001",
|
||||
"program_name": "systemd-network",
|
||||
"kind": "network",
|
||||
"pid": "867",
|
||||
"local_port": "ipv6-icmp",
|
||||
"foreign_port": "*",
|
||||
"transport_protocol": null,
|
||||
"network_protocol": "ipv6"
|
||||
},
|
||||
{
|
||||
"proto": "unix",
|
||||
"refcnt": "2",
|
||||
"flags": null,
|
||||
"type": "DGRAM",
|
||||
"state": null,
|
||||
"inode": "33322",
|
||||
"program_name": "systemd",
|
||||
"path": "/run/user/1000/systemd/notify",
|
||||
"kind": "socket",
|
||||
"pid": " 1607"
|
||||
},
|
||||
{
|
||||
"proto": "unix",
|
||||
"refcnt": "2",
|
||||
"flags": "ACC",
|
||||
"type": "SEQPACKET",
|
||||
"state": "LISTENING",
|
||||
"inode": "20835",
|
||||
"program_name": "init",
|
||||
"path": "/run/udev/control",
|
||||
"kind": "socket",
|
||||
"pid": " 1"
|
||||
},
|
||||
...
|
||||
"iface": "lo",
|
||||
"mtu": 65536,
|
||||
"rx_ok": 0,
|
||||
"rx_err": 0,
|
||||
"rx_drp": 0,
|
||||
"rx_ovr": 0,
|
||||
"tx_ok": 0,
|
||||
"tx_err": 0,
|
||||
"tx_drp": 0,
|
||||
"tx_ovr": 0,
|
||||
"flg": "LRU",
|
||||
"kind": "interface"
|
||||
}
|
||||
]
|
||||
|
||||
## info
|
||||
@@ -352,7 +278,52 @@ Returns:
|
||||
"type": string,
|
||||
"inode": integer,
|
||||
"path": string,
|
||||
"kind": string
|
||||
"kind": string,
|
||||
"address": string,
|
||||
"osx_inode": string,
|
||||
"conn": string,
|
||||
"refs": string,
|
||||
"nextref": string,
|
||||
"name": string,
|
||||
"unit": integer,
|
||||
"vendor": integer,
|
||||
"class": integer,
|
||||
"subcla": integer,
|
||||
"osx_flags": integer,
|
||||
"pcbcount": integer,
|
||||
"rcvbuf": integer,
|
||||
"sndbuf": integer,
|
||||
"rxbytes": integer,
|
||||
"txbytes": integer,
|
||||
"destination": string,
|
||||
"gateway": string,
|
||||
"route_flags": string,
|
||||
"route_refs": integer,
|
||||
"use": integer,
|
||||
"mtu": integer,
|
||||
"expire": string,
|
||||
"genmask": string,
|
||||
"mss": integer,
|
||||
"window": integer,
|
||||
"irtt": integer,
|
||||
"iface": string,
|
||||
"metric": integer,
|
||||
"network": string,
|
||||
"address": string,
|
||||
"ipkts": integer, - = null
|
||||
"ierrs": integer, - = null
|
||||
"opkts": integer, - = null
|
||||
"oerrs": integer, - = null
|
||||
"coll": integer, - = null
|
||||
"rx_ok": integer,
|
||||
"rx_err": integer,
|
||||
"rx_drp": integer,
|
||||
"rx_ovr": integer,
|
||||
"tx_ok": integer,
|
||||
"tx_err": integer,
|
||||
"tx_drp": integer,
|
||||
"tx_ovr": integer,
|
||||
"flg": string
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
235
docs/parsers/ntpq.md
Normal file
235
docs/parsers/ntpq.md
Normal file
@@ -0,0 +1,235 @@
|
||||
# jc.parsers.ntpq
|
||||
jc - JSON CLI output utility ntpq Parser
|
||||
|
||||
Usage:
|
||||
|
||||
specify --ntpq as the first argument if the piped input is coming from ntpq -p
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux'
|
||||
|
||||
Examples:
|
||||
|
||||
$ ntpq -p | jc --ntpq -p
|
||||
[
|
||||
{
|
||||
"remote": "44.190.6.254",
|
||||
"refid": "127.67.113.92",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 1,
|
||||
"poll": 64,
|
||||
"reach": 1,
|
||||
"delay": 23.399,
|
||||
"offset": -2.805,
|
||||
"jitter": 2.131,
|
||||
"state": null
|
||||
},
|
||||
{
|
||||
"remote": "ntp.wdc1.us.lea",
|
||||
"refid": "130.133.1.10",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": null,
|
||||
"poll": 64,
|
||||
"reach": 1,
|
||||
"delay": 93.053,
|
||||
"offset": -0.807,
|
||||
"jitter": 2.839,
|
||||
"state": null
|
||||
},
|
||||
{
|
||||
"remote": "clock.team-cymr",
|
||||
"refid": "204.9.54.119",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": null,
|
||||
"poll": 64,
|
||||
"reach": 1,
|
||||
"delay": 70.337,
|
||||
"offset": -2.909,
|
||||
"jitter": 2.6,
|
||||
"state": null
|
||||
},
|
||||
{
|
||||
"remote": "mirror1.sjc02.s",
|
||||
"refid": "216.218.254.202",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 2,
|
||||
"poll": 64,
|
||||
"reach": 1,
|
||||
"delay": 29.325,
|
||||
"offset": 1.044,
|
||||
"jitter": 4.069,
|
||||
"state": null,
|
||||
}
|
||||
]
|
||||
|
||||
$ ntpq -pn| jc --ntpq -p
|
||||
[
|
||||
{
|
||||
"remote": "44.190.6.254",
|
||||
"refid": "127.67.113.92",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 66,
|
||||
"poll": 64,
|
||||
"reach": 377,
|
||||
"delay": 22.69,
|
||||
"offset": -0.392,
|
||||
"jitter": 2.085,
|
||||
"state": "+"
|
||||
},
|
||||
{
|
||||
"remote": "108.59.2.24",
|
||||
"refid": "130.133.1.10",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 63,
|
||||
"poll": 64,
|
||||
"reach": 377,
|
||||
"delay": 90.805,
|
||||
"offset": 2.84,
|
||||
"jitter": 1.908,
|
||||
"state": "-"
|
||||
},
|
||||
{
|
||||
"remote": "38.229.71.1",
|
||||
"refid": "204.9.54.119",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 64,
|
||||
"poll": 64,
|
||||
"reach": 377,
|
||||
"delay": 68.699,
|
||||
"offset": -0.61,
|
||||
"jitter": 2.576,
|
||||
"state": "+"
|
||||
},
|
||||
{
|
||||
"remote": "72.5.72.15",
|
||||
"refid": "216.218.254.202",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 63,
|
||||
"poll": 64,
|
||||
"reach": 377,
|
||||
"delay": 22.654,
|
||||
"offset": 0.231,
|
||||
"jitter": 1.964,
|
||||
"state": "*"
|
||||
}
|
||||
]
|
||||
|
||||
$ ntpq -pn| jc --ntpq -p -r
|
||||
[
|
||||
{
|
||||
"s": "+",
|
||||
"remote": "44.190.6.254",
|
||||
"refid": "127.67.113.92",
|
||||
"st": "2",
|
||||
"t": "u",
|
||||
"when": "66",
|
||||
"poll": "64",
|
||||
"reach": "377",
|
||||
"delay": "22.690",
|
||||
"offset": "-0.392",
|
||||
"jitter": "2.085"
|
||||
},
|
||||
{
|
||||
"s": "-",
|
||||
"remote": "108.59.2.24",
|
||||
"refid": "130.133.1.10",
|
||||
"st": "2",
|
||||
"t": "u",
|
||||
"when": "63",
|
||||
"poll": "64",
|
||||
"reach": "377",
|
||||
"delay": "90.805",
|
||||
"offset": "2.840",
|
||||
"jitter": "1.908"
|
||||
},
|
||||
{
|
||||
"s": "+",
|
||||
"remote": "38.229.71.1",
|
||||
"refid": "204.9.54.119",
|
||||
"st": "2",
|
||||
"t": "u",
|
||||
"when": "64",
|
||||
"poll": "64",
|
||||
"reach": "377",
|
||||
"delay": "68.699",
|
||||
"offset": "-0.610",
|
||||
"jitter": "2.576"
|
||||
},
|
||||
{
|
||||
"s": "*",
|
||||
"remote": "72.5.72.15",
|
||||
"refid": "216.218.254.202",
|
||||
"st": "2",
|
||||
"t": "u",
|
||||
"when": "63",
|
||||
"poll": "64",
|
||||
"reach": "377",
|
||||
"delay": "22.654",
|
||||
"offset": "0.231",
|
||||
"jitter": "1.964"
|
||||
}
|
||||
]
|
||||
|
||||
## info
|
||||
```python
|
||||
info(self, /, *args, **kwargs)
|
||||
```
|
||||
|
||||
## process
|
||||
```python
|
||||
process(proc_data)
|
||||
```
|
||||
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Structured data with the following schema:
|
||||
|
||||
[
|
||||
{
|
||||
"state": string, # space/~ converted to null
|
||||
"remote": string,
|
||||
"refid": string,
|
||||
"st": integer,
|
||||
"t": string,
|
||||
"when": integer, # - converted to null
|
||||
"poll": integer,
|
||||
"reach": integer,
|
||||
"delay": float,
|
||||
"offset": float,
|
||||
"jitter": float
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
## parse
|
||||
```python
|
||||
parse(data, raw=False, quiet=False)
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) output preprocessed JSON if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Raw or processed structured data.
|
||||
|
||||
@@ -7,7 +7,7 @@ Usage:
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux'
|
||||
'linux', 'darwin'
|
||||
|
||||
Examples:
|
||||
|
||||
@@ -141,7 +141,11 @@ Returns:
|
||||
"access_time": string, # - = null
|
||||
"modify_time": string, # - = null
|
||||
"change_time": string, # - = null
|
||||
"birth_time": string # - = null
|
||||
"birth_time": string, # - = null
|
||||
"osx_device": integer,
|
||||
"rdev": integer,
|
||||
"block_size": integer,
|
||||
"osx_flags": string
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
87
docs/parsers/timedatectl.md
Normal file
87
docs/parsers/timedatectl.md
Normal file
@@ -0,0 +1,87 @@
|
||||
# jc.parsers.timedatectl
|
||||
jc - JSON CLI output utility timedatectl Parser
|
||||
|
||||
Usage:
|
||||
|
||||
specify --timedatectl as the first argument if the piped input is coming from timedatectl or timedatectl status
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux'
|
||||
|
||||
Examples:
|
||||
|
||||
$ timedatectl | jc --timedatectl -p
|
||||
{
|
||||
"local_time": "Tue 2020-03-10 17:53:21 PDT",
|
||||
"universal_time": "Wed 2020-03-11 00:53:21 UTC",
|
||||
"rtc_time": "Wed 2020-03-11 00:53:21",
|
||||
"time_zone": "America/Los_Angeles (PDT, -0700)",
|
||||
"ntp_enabled": true,
|
||||
"ntp_synchronized": true,
|
||||
"rtc_in_local_tz": false,
|
||||
"dst_active": true
|
||||
}
|
||||
|
||||
$ timedatectl | jc --timedatectl -p -r
|
||||
{
|
||||
"local_time": "Tue 2020-03-10 17:53:21 PDT",
|
||||
"universal_time": "Wed 2020-03-11 00:53:21 UTC",
|
||||
"rtc_time": "Wed 2020-03-11 00:53:21",
|
||||
"time_zone": "America/Los_Angeles (PDT, -0700)",
|
||||
"ntp_enabled": "yes",
|
||||
"ntp_synchronized": "yes",
|
||||
"rtc_in_local_tz": "no",
|
||||
"dst_active": "yes"
|
||||
}
|
||||
|
||||
## info
|
||||
```python
|
||||
info(self, /, *args, **kwargs)
|
||||
```
|
||||
|
||||
## process
|
||||
```python
|
||||
process(proc_data)
|
||||
```
|
||||
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Structured data with the following schema:
|
||||
|
||||
{
|
||||
"local_time": string,
|
||||
"universal_time": string,
|
||||
"rtc_time": string,
|
||||
"time_zone": string,
|
||||
"ntp_enabled": boolean,
|
||||
"ntp_synchronized": boolean,
|
||||
"system_clock_synchronized": boolean,
|
||||
"systemd-timesyncd.service_active": boolean,
|
||||
"rtc_in_local_tz": boolean,
|
||||
"dst_active": boolean
|
||||
}
|
||||
|
||||
## parse
|
||||
```python
|
||||
parse(data, raw=False, quiet=False)
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) output preprocessed JSON if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
114
jc/cli.py
114
jc/cli.py
@@ -1,4 +1,3 @@
|
||||
#!/usr/bin/env python3
|
||||
"""jc - JSON CLI output utility
|
||||
JC cli module
|
||||
"""
|
||||
@@ -9,11 +8,16 @@ import importlib
|
||||
import textwrap
|
||||
import signal
|
||||
import json
|
||||
from pygments import highlight
|
||||
from pygments.style import Style
|
||||
from pygments.token import (Name, Number, String, Keyword)
|
||||
from pygments.lexers import JsonLexer
|
||||
from pygments.formatters import Terminal256Formatter
|
||||
import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.8.1'
|
||||
version = '1.11.1'
|
||||
description = 'jc cli output JSON conversion tool'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -22,6 +26,8 @@ class info():
|
||||
__version__ = info.version
|
||||
|
||||
parsers = [
|
||||
'airport',
|
||||
'airport-s',
|
||||
'arp',
|
||||
'blkid',
|
||||
'crontab',
|
||||
@@ -29,8 +35,10 @@ parsers = [
|
||||
'csv',
|
||||
'df',
|
||||
'dig',
|
||||
'dmidecode',
|
||||
'du',
|
||||
'env',
|
||||
'file',
|
||||
'free',
|
||||
'fstab',
|
||||
'group',
|
||||
@@ -49,6 +57,7 @@ parsers = [
|
||||
'lsof',
|
||||
'mount',
|
||||
'netstat',
|
||||
'ntpq',
|
||||
'passwd',
|
||||
'pip-list',
|
||||
'pip-show',
|
||||
@@ -61,6 +70,7 @@ parsers = [
|
||||
'systemctl-lj',
|
||||
'systemctl-ls',
|
||||
'systemctl-luf',
|
||||
'timedatectl',
|
||||
'uname',
|
||||
'uptime',
|
||||
'w',
|
||||
@@ -70,6 +80,63 @@ parsers = [
|
||||
]
|
||||
|
||||
|
||||
def set_env_colors():
|
||||
"""
|
||||
Grab custom colors from JC_COLORS environment variable. JC_COLORS env variable takes 4 comma
|
||||
separated string values and should be in the format of:
|
||||
|
||||
JC_COLORS=<keyname_color>,<keyword_color>,<number_color>,<string_color>
|
||||
|
||||
Where colors are: black, red, green, yellow, blue, magenta, cyan, gray, brightblack, brightred,
|
||||
brightgreen, brightyellow, brightblue, brightmagenta, brightcyan, white, default
|
||||
|
||||
Default colors:
|
||||
|
||||
JC_COLORS=blue,brightblack,magenta,green
|
||||
or
|
||||
JC_COLORS=default,default,default,default
|
||||
|
||||
"""
|
||||
env_colors = os.getenv('JC_COLORS')
|
||||
input_error = False
|
||||
|
||||
if env_colors:
|
||||
color_list = env_colors.split(',')
|
||||
else:
|
||||
input_error = True
|
||||
|
||||
if env_colors and len(color_list) != 4:
|
||||
print('jc: Warning: could not parse JC_COLORS environment variable\n', file=sys.stderr)
|
||||
input_error = True
|
||||
|
||||
if env_colors:
|
||||
for color in color_list:
|
||||
if color not in ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'gray', 'brightblack', 'brightred',
|
||||
'brightgreen', 'brightyellow', 'brightblue', 'brightmagenta', 'brightcyan', 'white', 'default']:
|
||||
print('jc: Warning: could not parse JC_COLORS environment variable\n', file=sys.stderr)
|
||||
input_error = True
|
||||
|
||||
# if there is an issue with the env variable, just set all colors to default and move on
|
||||
if input_error:
|
||||
color_list = ['default', 'default', 'default', 'default']
|
||||
|
||||
# Try the color set in the JC_COLORS env variable first. If it is set to default, then fall back to default colors
|
||||
return {
|
||||
Name.Tag: f'bold ansi{color_list[0]}' if not color_list[0] == 'default' else f'bold ansiblue', # key names
|
||||
Keyword: f'ansi{color_list[1]}' if not color_list[1] == 'default' else f'ansibrightblack', # true, false, null
|
||||
Number: f'ansi{color_list[2]}' if not color_list[2] == 'default' else f'ansimagenta', # numbers
|
||||
String: f'ansi{color_list[3]}' if not color_list[3] == 'default' else f'ansigreen' # strings
|
||||
}
|
||||
|
||||
|
||||
def piped_output():
|
||||
"""returns False if stdout is a TTY. True if output is being piped to another program"""
|
||||
if sys.stdout.isatty():
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
def ctrlc(signum, frame):
|
||||
"""exit with error on SIGINT"""
|
||||
sys.exit(1)
|
||||
@@ -162,6 +229,7 @@ def helptext(message):
|
||||
Options:
|
||||
-a about jc
|
||||
-d debug - show trace messages
|
||||
-m monochrome output
|
||||
-p pretty print output
|
||||
-q quiet - suppress warnings
|
||||
-r raw JSON output
|
||||
@@ -176,11 +244,22 @@ def helptext(message):
|
||||
print(textwrap.dedent(helptext_string), file=sys.stderr)
|
||||
|
||||
|
||||
def json_out(data, pretty=False):
|
||||
if pretty:
|
||||
print(json.dumps(data, indent=2))
|
||||
def json_out(data, pretty=False, mono=False, piped_out=False):
|
||||
# set colors
|
||||
class JcStyle(Style):
|
||||
styles = set_env_colors()
|
||||
|
||||
|
||||
if not mono and not piped_out:
|
||||
if pretty:
|
||||
print(highlight(json.dumps(data, indent=2), JsonLexer(), Terminal256Formatter(style=JcStyle))[0:-1])
|
||||
else:
|
||||
print(highlight(json.dumps(data), JsonLexer(), Terminal256Formatter(style=JcStyle))[0:-1])
|
||||
else:
|
||||
print(json.dumps(data))
|
||||
if pretty:
|
||||
print(json.dumps(data, indent=2))
|
||||
else:
|
||||
print(json.dumps(data))
|
||||
|
||||
|
||||
def generate_magic_command(args):
|
||||
@@ -194,20 +273,18 @@ def generate_magic_command(args):
|
||||
return False, None
|
||||
|
||||
# correctly parse escape characters and spaces with shlex
|
||||
args_given = " ".join(map(shlex.quote, args[1:])).split()
|
||||
args_given = ' '.join(map(shlex.quote, args[1:])).split()
|
||||
options = []
|
||||
|
||||
# find the options
|
||||
popped = 0
|
||||
for i, arg in enumerate(args_given):
|
||||
for arg in list(args_given):
|
||||
# parser found - use standard syntax
|
||||
if arg.startswith('--'):
|
||||
return False, None
|
||||
|
||||
# option found - populate option list
|
||||
elif arg.startswith('-'):
|
||||
options.append(args_given.pop(i - popped)[1:])
|
||||
popped += 1
|
||||
options.extend(args_given.pop(0)[1:])
|
||||
|
||||
# command found if iterator didn't already stop - stop iterating
|
||||
else:
|
||||
@@ -245,7 +322,7 @@ def magic():
|
||||
valid_command, run_command = generate_magic_command(sys.argv)
|
||||
if valid_command:
|
||||
os.system(run_command)
|
||||
exit()
|
||||
sys.exit(0)
|
||||
elif run_command is None:
|
||||
return
|
||||
else:
|
||||
@@ -257,6 +334,12 @@ def main():
|
||||
# break on ctrl-c keyboard interrupt
|
||||
signal.signal(signal.SIGINT, ctrlc)
|
||||
|
||||
# break on pipe error. need try/except for windows compatibility
|
||||
try:
|
||||
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
# try magic syntax first: e.g. jc -p ls -al
|
||||
magic()
|
||||
|
||||
@@ -268,13 +351,14 @@ def main():
|
||||
options.extend(opt[1:])
|
||||
|
||||
debug = 'd' in options
|
||||
mono = 'm' in options
|
||||
pretty = 'p' in options
|
||||
quiet = 'q' in options
|
||||
raw = 'r' in options
|
||||
|
||||
if 'a' in options:
|
||||
json_out(about_jc(), pretty=pretty)
|
||||
exit()
|
||||
json_out(about_jc(), pretty=pretty, mono=mono, piped_out=piped_output())
|
||||
sys.exit(0)
|
||||
|
||||
if sys.stdin.isatty():
|
||||
helptext('missing piped data')
|
||||
@@ -314,7 +398,7 @@ def main():
|
||||
helptext('missing or incorrect arguments')
|
||||
sys.exit(1)
|
||||
|
||||
json_out(result, pretty=pretty)
|
||||
json_out(result, pretty=pretty, mono=mono, piped_out=piped_output())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
141
jc/parsers/airport.py
Normal file
141
jc/parsers/airport.py
Normal file
@@ -0,0 +1,141 @@
|
||||
"""jc - JSON CLI output utility airport -I Parser
|
||||
|
||||
Usage:
|
||||
|
||||
specify --airport as the first argument if the piped input is coming from airport -I (OSX)
|
||||
|
||||
This program can be found at:
|
||||
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
|
||||
|
||||
Compatibility:
|
||||
|
||||
'darwin'
|
||||
|
||||
Examples:
|
||||
|
||||
$ airport -I | jc --airport -p
|
||||
{
|
||||
"agrctlrssi": -66,
|
||||
"agrextrssi": 0,
|
||||
"agrctlnoise": -90,
|
||||
"agrextnoise": 0,
|
||||
"state": "running",
|
||||
"op_mode": "station",
|
||||
"lasttxrate": 195,
|
||||
"maxrate": 867,
|
||||
"lastassocstatus": 0,
|
||||
"802_11_auth": "open",
|
||||
"link_auth": "wpa2-psk",
|
||||
"bssid": "3c:37:86:15:ad:f9",
|
||||
"ssid": "SnazzleDazzle",
|
||||
"mcs": 0,
|
||||
"channel": "48,80"
|
||||
}
|
||||
|
||||
$ airport -I | jc --airport -p -r
|
||||
{
|
||||
"agrctlrssi": "-66",
|
||||
"agrextrssi": "0",
|
||||
"agrctlnoise": "-90",
|
||||
"agrextnoise": "0",
|
||||
"state": "running",
|
||||
"op_mode": "station",
|
||||
"lasttxrate": "195",
|
||||
"maxrate": "867",
|
||||
"lastassocstatus": "0",
|
||||
"802_11_auth": "open",
|
||||
"link_auth": "wpa2-psk",
|
||||
"bssid": "3c:37:86:15:ad:f9",
|
||||
"ssid": "SnazzleDazzle",
|
||||
"mcs": "0",
|
||||
"channel": "48,80"
|
||||
}
|
||||
"""
|
||||
import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
description = 'airport -I command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
# details = 'enter any other details here'
|
||||
|
||||
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
|
||||
compatible = ['darwin']
|
||||
magic_commands = ['airport -I']
|
||||
|
||||
|
||||
__version__ = info.version
|
||||
|
||||
|
||||
def process(proc_data):
|
||||
"""
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Structured data with the following schema:
|
||||
|
||||
{
|
||||
"agrctlrssi": integer,
|
||||
"agrextrssi": integer,
|
||||
"agrctlnoise": integer,
|
||||
"agrextnoise": integer,
|
||||
"state": string,
|
||||
"op_mode": string,
|
||||
"lasttxrate": integer,
|
||||
"maxrate": integer,
|
||||
"lastassocstatus": integer,
|
||||
"802_11_auth": string,
|
||||
"link_auth": string,
|
||||
"bssid": string,
|
||||
"ssid": string,
|
||||
"mcs": integer,
|
||||
"channel": string
|
||||
}
|
||||
"""
|
||||
# integer changes
|
||||
int_list = ['agrctlrssi', 'agrextrssi', 'agrctlnoise', 'agrextnoise',
|
||||
'lasttxrate', 'maxrate', 'lastassocstatus', 'mcs']
|
||||
for key in proc_data:
|
||||
if key in int_list:
|
||||
try:
|
||||
proc_data[key] = int(proc_data[key])
|
||||
except (ValueError):
|
||||
proc_data[key] = None
|
||||
|
||||
return proc_data
|
||||
|
||||
|
||||
def parse(data, raw=False, quiet=False):
|
||||
"""
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) output preprocessed JSON if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
"""
|
||||
if not quiet:
|
||||
jc.utils.compatibility(__name__, info.compatible)
|
||||
|
||||
raw_output = {}
|
||||
|
||||
for line in filter(None, data.splitlines()):
|
||||
linedata = line.split(':', maxsplit=1)
|
||||
raw_output[linedata[0].strip().lower().replace(' ', '_').replace('.', '_')] = linedata[1].strip()
|
||||
|
||||
if raw:
|
||||
return raw_output
|
||||
else:
|
||||
return process(raw_output)
|
||||
186
jc/parsers/airport_s.py
Normal file
186
jc/parsers/airport_s.py
Normal file
@@ -0,0 +1,186 @@
|
||||
"""jc - JSON CLI output utility airport -s Parser
|
||||
|
||||
Usage:
|
||||
|
||||
specify --airport as the first argument if the piped input is coming from airport -s (OSX)
|
||||
|
||||
This program can be found at:
|
||||
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
|
||||
|
||||
Compatibility:
|
||||
|
||||
'darwin'
|
||||
|
||||
Examples:
|
||||
|
||||
$ airport -s | jc --airport-s -p
|
||||
[
|
||||
{
|
||||
"ssid": "DIRECT-4A-HP OfficeJet 3830",
|
||||
"bssid": "00:67:eb:2a:a7:3b",
|
||||
"rssi": -90,
|
||||
"channel": "6",
|
||||
"ht": true,
|
||||
"cc": "--",
|
||||
"security": [
|
||||
"WPA2(PSK/AES/AES)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ssid": "Latitude38",
|
||||
"bssid": "c0:ff:d5:d2:7a:f3",
|
||||
"rssi": -85,
|
||||
"channel": "11",
|
||||
"ht": true,
|
||||
"cc": "US",
|
||||
"security": [
|
||||
"WPA2(PSK/AES/AES)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ssid": "xfinitywifi",
|
||||
"bssid": "6e:e3:0e:b8:45:99",
|
||||
"rssi": -83,
|
||||
"channel": "11",
|
||||
"ht": true,
|
||||
"cc": "US",
|
||||
"security": [
|
||||
"NONE"
|
||||
]
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ airport -s | jc --airport -p -r
|
||||
[
|
||||
{
|
||||
"ssid": "DIRECT-F3-HP ENVY 5660 series",
|
||||
"bssid": "b0:5a:da:6f:0a:d4",
|
||||
"rssi": "-93",
|
||||
"channel": "1",
|
||||
"ht": "Y",
|
||||
"cc": "--",
|
||||
"security": "WPA2(PSK/AES/AES)"
|
||||
},
|
||||
{
|
||||
"ssid": "YouAreInfected-5",
|
||||
"bssid": "5c:e3:0e:c2:85:da",
|
||||
"rssi": "-85",
|
||||
"channel": "36",
|
||||
"ht": "Y",
|
||||
"cc": "US",
|
||||
"security": "WPA(PSK/AES,TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP)"
|
||||
},
|
||||
{
|
||||
"ssid": "YuanFamily",
|
||||
"bssid": "5c:e3:0e:b8:5f:9a",
|
||||
"rssi": "-84",
|
||||
"channel": "11",
|
||||
"ht": "Y",
|
||||
"cc": "US",
|
||||
"security": "WPA(PSK/AES,TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP)"
|
||||
},
|
||||
...
|
||||
]
|
||||
"""
|
||||
import jc.utils
|
||||
import jc.parsers.universal
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
description = 'airport -s command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
# details = 'enter any other details here'
|
||||
|
||||
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
|
||||
compatible = ['darwin']
|
||||
magic_commands = ['airport -s']
|
||||
|
||||
|
||||
__version__ = info.version
|
||||
|
||||
|
||||
def process(proc_data):
|
||||
"""
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Structured data with the following schema:
|
||||
[
|
||||
{
|
||||
"ssid": string,
|
||||
"bssid": string,
|
||||
"rssi": integer,
|
||||
"channel": string,
|
||||
"ht": boolean,
|
||||
"cc": string,
|
||||
"security": [
|
||||
string,
|
||||
]
|
||||
}
|
||||
]
|
||||
"""
|
||||
for entry in proc_data:
|
||||
|
||||
# integers
|
||||
int_list = ['rssi']
|
||||
for key in int_list:
|
||||
if key in entry:
|
||||
try:
|
||||
entry[key] = int(entry[key])
|
||||
except (ValueError):
|
||||
entry[key] = None
|
||||
|
||||
# booleans
|
||||
bool_list = ['ht']
|
||||
for key in entry:
|
||||
if key in bool_list:
|
||||
try:
|
||||
entry[key] = True if entry[key] == 'Y' else False
|
||||
except (ValueError):
|
||||
entry[key] = None
|
||||
|
||||
if 'security' in entry:
|
||||
entry['security'] = entry['security'].split()
|
||||
|
||||
return proc_data
|
||||
|
||||
|
||||
def parse(data, raw=False, quiet=False):
|
||||
"""
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) output preprocessed JSON if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Raw or processed structured data.
|
||||
"""
|
||||
if not quiet:
|
||||
jc.utils.compatibility(__name__, info.compatible)
|
||||
|
||||
cleandata = data.splitlines()
|
||||
|
||||
# fix headers
|
||||
cleandata[0] = cleandata[0].lower()
|
||||
cleandata[0] = cleandata[0].replace('-', '_')
|
||||
cleandata[0] = cleandata[0].replace('security (auth/unicast/group)', 'security')
|
||||
|
||||
# parse the data
|
||||
raw_output = jc.parsers.universal.sparse_table_parse(cleandata)
|
||||
|
||||
if raw:
|
||||
return raw_output
|
||||
else:
|
||||
return process(raw_output)
|
||||
@@ -91,7 +91,7 @@ import jc.parsers.universal
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.1'
|
||||
version = '1.3'
|
||||
description = 'arp command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -156,20 +156,21 @@ def parse(data, raw=False, quiet=False):
|
||||
cleandata = data.splitlines()
|
||||
|
||||
# remove final Entries row if -v was used
|
||||
if cleandata[-1].find('Entries:') == 0:
|
||||
if cleandata[-1].startswith('Entries:'):
|
||||
cleandata.pop(-1)
|
||||
|
||||
# detect if osx style was used
|
||||
if cleandata[0].find(' ifscope ') != -1:
|
||||
if cleandata[0][-1] == ']':
|
||||
raw_output = []
|
||||
for line in cleandata:
|
||||
line = line.split()
|
||||
output_line = {}
|
||||
output_line['name'] = line[0]
|
||||
output_line['address'] = line[1].lstrip('(').rstrip(')')
|
||||
output_line['hwtype'] = line[-1].lstrip('[').rstrip(']')
|
||||
output_line['hwaddress'] = line[3]
|
||||
output_line['iface'] = line[5]
|
||||
splitline = line.split()
|
||||
output_line = {
|
||||
'name': splitline[0],
|
||||
'address': splitline[1].lstrip('(').rstrip(')'),
|
||||
'hwtype': splitline[-1].lstrip('[').rstrip(']'),
|
||||
'hwaddress': splitline[3],
|
||||
'iface': splitline[5]
|
||||
}
|
||||
raw_output.append(output_line)
|
||||
|
||||
if raw:
|
||||
@@ -178,7 +179,7 @@ def parse(data, raw=False, quiet=False):
|
||||
return process(raw_output)
|
||||
|
||||
# detect if linux style was used
|
||||
elif cleandata[0].find('Address') == 0:
|
||||
elif cleandata[0].startswith('Address'):
|
||||
|
||||
# fix header row to change Flags Mask to flags_mask
|
||||
cleandata[0] = cleandata[0].replace('Flags Mask', 'flags_mask')
|
||||
|
||||
@@ -132,7 +132,7 @@ import jc.parsers.universal
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.1'
|
||||
version = '1.2'
|
||||
description = 'crontab command and file parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -227,13 +227,13 @@ def parse(data, raw=False, quiet=False):
|
||||
|
||||
# Clear any commented lines
|
||||
for i, line in reversed(list(enumerate(cleandata))):
|
||||
if line.strip().find('#') == 0:
|
||||
if line.strip().startswith('#'):
|
||||
cleandata.pop(i)
|
||||
|
||||
# Pop any variable assignment lines
|
||||
cron_var = []
|
||||
for i, line in reversed(list(enumerate(cleandata))):
|
||||
if line.find('=') != -1:
|
||||
if '=' in line:
|
||||
var_line = cleandata.pop(i)
|
||||
var_name = var_line.split('=', maxsplit=1)[0].strip()
|
||||
var_value = var_line.split('=', maxsplit=1)[1].strip()
|
||||
|
||||
@@ -133,7 +133,7 @@ import jc.parsers.universal
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
description = 'crontab file parser with user support'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -228,13 +228,13 @@ def parse(data, raw=False, quiet=False):
|
||||
|
||||
# Clear any commented lines
|
||||
for i, line in reversed(list(enumerate(cleandata))):
|
||||
if line.strip().find('#') == 0:
|
||||
if line.strip().startswith('#'):
|
||||
cleandata.pop(i)
|
||||
|
||||
# Pop any variable assignment lines
|
||||
cron_var = []
|
||||
for i, line in reversed(list(enumerate(cleandata))):
|
||||
if line.find('=') != -1:
|
||||
if '=' in line:
|
||||
var_line = cleandata.pop(i)
|
||||
var_name = var_line.split('=', maxsplit=1)[0].strip()
|
||||
var_value = var_line.split('=', maxsplit=1)[1].strip()
|
||||
|
||||
@@ -73,7 +73,7 @@ import jc.parsers.universal
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.1'
|
||||
version = '1.2'
|
||||
description = 'df command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -135,7 +135,7 @@ def process(proc_data):
|
||||
|
||||
# change any entry for key with '_blocks' in the name to int
|
||||
for k in entry:
|
||||
if str(k).find('_blocks') != -1:
|
||||
if '_blocks' in str(k):
|
||||
try:
|
||||
blocks_int = int(entry[k])
|
||||
entry[k] = blocks_int
|
||||
|
||||
@@ -324,7 +324,7 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
version = '1.2'
|
||||
description = 'dig command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -361,6 +361,15 @@ def process(proc_data):
|
||||
"answer_num": integer,
|
||||
"authority_num": integer,
|
||||
"additional_num": integer,
|
||||
"axfr": [
|
||||
{
|
||||
"name": string,
|
||||
"class": string,
|
||||
"type": string,
|
||||
"ttl": integer,
|
||||
"data": string
|
||||
}
|
||||
],
|
||||
"question": {
|
||||
"name": string,
|
||||
"class": string,
|
||||
@@ -388,6 +397,7 @@ def process(proc_data):
|
||||
"server": string,
|
||||
"when": string,
|
||||
"rcvd": integer
|
||||
"size": string
|
||||
}
|
||||
]
|
||||
"""
|
||||
@@ -402,6 +412,14 @@ def process(proc_data):
|
||||
except (ValueError):
|
||||
entry[key] = None
|
||||
|
||||
if 'axfr' in entry:
|
||||
for ax in entry['axfr']:
|
||||
try:
|
||||
ttl_int = int(ax['ttl'])
|
||||
ax['ttl'] = ttl_int
|
||||
except (ValueError):
|
||||
ax['ttl'] = None
|
||||
|
||||
if 'answer' in entry:
|
||||
for ans in entry['answer']:
|
||||
try:
|
||||
@@ -508,6 +526,25 @@ def parse_answer(answer):
|
||||
'data': answer_data}
|
||||
|
||||
|
||||
def parse_axfr(axfr):
|
||||
# ; <<>> DiG 9.11.14-3-Debian <<>> @81.4.108.41 axfr zonetransfer.me +nocookie
|
||||
# ; (1 server found)
|
||||
# ;; global options: +cmd
|
||||
# zonetransfer.me. 7200 IN A 5.196.105.14
|
||||
axfr = axfr.split(maxsplit=4)
|
||||
axfr_name = axfr[0]
|
||||
axfr_ttl = axfr[1]
|
||||
axfr_class = axfr[2]
|
||||
axfr_type = axfr[3]
|
||||
axfr_data = axfr[4]
|
||||
|
||||
return {'name': axfr_name,
|
||||
'ttl': axfr_ttl,
|
||||
'class': axfr_class,
|
||||
'type': axfr_type,
|
||||
'data': axfr_data}
|
||||
|
||||
|
||||
def parse(data, raw=False, quiet=False):
|
||||
"""
|
||||
Main text parsing function
|
||||
@@ -534,23 +571,38 @@ def parse(data, raw=False, quiet=False):
|
||||
question = False
|
||||
authority = False
|
||||
answer = False
|
||||
axfr = False
|
||||
|
||||
output_entry = {}
|
||||
for line in cleandata:
|
||||
|
||||
if line.find(';; ->>HEADER<<-') == 0:
|
||||
if line.startswith('; <<>> ') and ' axfr ' in line.lower():
|
||||
question = False
|
||||
authority = False
|
||||
answer = False
|
||||
axfr = True
|
||||
axfr_list = []
|
||||
continue
|
||||
|
||||
if ';' not in line and axfr:
|
||||
axfr_list.append(parse_axfr(line))
|
||||
output_entry.update({'axfr': axfr_list})
|
||||
continue
|
||||
|
||||
if line.startswith(';; ->>HEADER<<-'):
|
||||
output_entry = {}
|
||||
output_entry.update(parse_header(line))
|
||||
continue
|
||||
|
||||
if line.find(';; flags:') == 0:
|
||||
if line.startswith(';; flags:'):
|
||||
output_entry.update(parse_flags_line(line))
|
||||
continue
|
||||
|
||||
if line.find(';; QUESTION SECTION:') == 0:
|
||||
if line.startswith(';; QUESTION SECTION:'):
|
||||
question = True
|
||||
authority = False
|
||||
answer = False
|
||||
axfr = False
|
||||
continue
|
||||
|
||||
if question:
|
||||
@@ -558,52 +610,60 @@ def parse(data, raw=False, quiet=False):
|
||||
question = False
|
||||
authority = False
|
||||
answer = False
|
||||
axfr = False
|
||||
continue
|
||||
|
||||
if line.find(';; AUTHORITY SECTION:') == 0:
|
||||
if line.startswith(';; AUTHORITY SECTION:'):
|
||||
question = False
|
||||
authority = True
|
||||
answer = False
|
||||
axfr = False
|
||||
authority_list = []
|
||||
continue
|
||||
|
||||
if line.find(';') == -1 and authority:
|
||||
if ';' not in line and authority:
|
||||
authority_list.append(parse_authority(line))
|
||||
output_entry.update({'authority': authority_list})
|
||||
continue
|
||||
|
||||
if line.find(';; ANSWER SECTION:') == 0:
|
||||
if line.startswith(';; ANSWER SECTION:'):
|
||||
question = False
|
||||
authority = False
|
||||
answer = True
|
||||
axfr = False
|
||||
answer_list = []
|
||||
continue
|
||||
|
||||
if line.find(';') == -1 and answer:
|
||||
if ';' not in line and answer:
|
||||
answer_list.append(parse_answer(line))
|
||||
output_entry.update({'answer': answer_list})
|
||||
continue
|
||||
|
||||
# footer consists of 4 lines
|
||||
# footer line 1
|
||||
if line.find(';; Query time:') == 0:
|
||||
if line.startswith(';; Query time:'):
|
||||
output_entry.update({'query_time': line.split(':')[1].lstrip()})
|
||||
continue
|
||||
|
||||
# footer line 2
|
||||
if line.find(';; SERVER:') == 0:
|
||||
if line.startswith(';; SERVER:'):
|
||||
output_entry.update({'server': line.split(':')[1].lstrip()})
|
||||
continue
|
||||
|
||||
# footer line 3
|
||||
if line.find(';; WHEN:') == 0:
|
||||
if line.startswith(';; WHEN:'):
|
||||
output_entry.update({'when': line.split(':', maxsplit=1)[1].lstrip()})
|
||||
continue
|
||||
|
||||
# footer line 4 (last line)
|
||||
if line.find(';; MSG SIZE rcvd:') == 0:
|
||||
if line.startswith(';; MSG SIZE rcvd:'):
|
||||
output_entry.update({'rcvd': line.split(':')[1].lstrip()})
|
||||
|
||||
if output_entry:
|
||||
raw_output.append(output_entry)
|
||||
elif line.startswith(';; XFR size:'):
|
||||
output_entry.update({'size': line.split(':')[1].lstrip()})
|
||||
|
||||
if output_entry:
|
||||
raw_output.append(output_entry)
|
||||
|
||||
|
||||
339
jc/parsers/dmidecode.py
Normal file
339
jc/parsers/dmidecode.py
Normal file
@@ -0,0 +1,339 @@
|
||||
"""jc - JSON CLI output utility dmidecode Parser
|
||||
|
||||
Usage:
|
||||
|
||||
specify --dmidecode as the first argument if the piped input is coming from dmidecode
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux'
|
||||
|
||||
Examples:
|
||||
|
||||
# dmidecode | jc --dmidecode -p
|
||||
[
|
||||
{
|
||||
"handle": "0x0000",
|
||||
"type": 0,
|
||||
"bytes": 24,
|
||||
"description": "BIOS Information",
|
||||
"values": {
|
||||
"vendor": "Phoenix Technologies LTD",
|
||||
"version": "6.00",
|
||||
"release_date": "04/13/2018",
|
||||
"address": "0xEA490",
|
||||
"runtime_size": "88944 bytes",
|
||||
"rom_size": "64 kB",
|
||||
"characteristics": [
|
||||
"ISA is supported",
|
||||
"PCI is supported",
|
||||
"PC Card (PCMCIA) is supported",
|
||||
"PNP is supported",
|
||||
"APM is supported",
|
||||
"BIOS is upgradeable",
|
||||
"BIOS shadowing is allowed",
|
||||
"ESCD support is available",
|
||||
"Boot from CD is supported",
|
||||
"Selectable boot is supported",
|
||||
"EDD is supported",
|
||||
"Print screen service is supported (int 5h)",
|
||||
"8042 keyboard services are supported (int 9h)",
|
||||
"Serial services are supported (int 14h)",
|
||||
"Printer services are supported (int 17h)",
|
||||
"CGA/mono video services are supported (int 10h)",
|
||||
"ACPI is supported",
|
||||
"Smart battery is supported",
|
||||
"BIOS boot specification is supported",
|
||||
"Function key-initiated network boot is supported",
|
||||
"Targeted content distribution is supported"
|
||||
],
|
||||
"bios_revision": "4.6",
|
||||
"firmware_revision": "0.0"
|
||||
}
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
# dmidecode | jc --dmidecode -p -r
|
||||
[
|
||||
{
|
||||
"handle": "0x0000",
|
||||
"type": "0",
|
||||
"bytes": "24",
|
||||
"description": "BIOS Information",
|
||||
"values": {
|
||||
"vendor": "Phoenix Technologies LTD",
|
||||
"version": "6.00",
|
||||
"release_date": "04/13/2018",
|
||||
"address": "0xEA490",
|
||||
"runtime_size": "88944 bytes",
|
||||
"rom_size": "64 kB",
|
||||
"characteristics": [
|
||||
"ISA is supported",
|
||||
"PCI is supported",
|
||||
"PC Card (PCMCIA) is supported",
|
||||
"PNP is supported",
|
||||
"APM is supported",
|
||||
"BIOS is upgradeable",
|
||||
"BIOS shadowing is allowed",
|
||||
"ESCD support is available",
|
||||
"Boot from CD is supported",
|
||||
"Selectable boot is supported",
|
||||
"EDD is supported",
|
||||
"Print screen service is supported (int 5h)",
|
||||
"8042 keyboard services are supported (int 9h)",
|
||||
"Serial services are supported (int 14h)",
|
||||
"Printer services are supported (int 17h)",
|
||||
"CGA/mono video services are supported (int 10h)",
|
||||
"ACPI is supported",
|
||||
"Smart battery is supported",
|
||||
"BIOS boot specification is supported",
|
||||
"Function key-initiated network boot is supported",
|
||||
"Targeted content distribution is supported"
|
||||
],
|
||||
"bios_revision": "4.6",
|
||||
"firmware_revision": "0.0"
|
||||
}
|
||||
},
|
||||
...
|
||||
]
|
||||
"""
|
||||
import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
description = 'dmidecode command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
# details = 'enter any other details here'
|
||||
|
||||
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
|
||||
compatible = ['linux']
|
||||
magic_commands = ['dmidecode']
|
||||
|
||||
|
||||
__version__ = info.version
|
||||
|
||||
|
||||
def process(proc_data):
|
||||
"""
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Structured data with the following schema:
|
||||
|
||||
[
|
||||
{
|
||||
"handle": string,
|
||||
"type": integer,
|
||||
"bytes": integer,
|
||||
"description": string,
|
||||
"values": { (null if empty)
|
||||
"lowercase_no_spaces_keys": string,
|
||||
"multiline_key_values": [
|
||||
string,
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
"""
|
||||
for entry in proc_data:
|
||||
int_list = ['type', 'bytes']
|
||||
for key in int_list:
|
||||
if key in entry:
|
||||
try:
|
||||
key_int = int(entry[key])
|
||||
entry[key] = key_int
|
||||
except (ValueError):
|
||||
entry[key] = None
|
||||
|
||||
if not entry['values']:
|
||||
entry['values'] = None
|
||||
|
||||
return proc_data
|
||||
|
||||
|
||||
def parse(data, raw=False, quiet=False):
|
||||
"""
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) output preprocessed JSON if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Raw or processed structured data.
|
||||
"""
|
||||
if not quiet:
|
||||
jc.utils.compatibility(__name__, info.compatible)
|
||||
|
||||
item_header = False
|
||||
item_values = False
|
||||
value_list = False
|
||||
|
||||
item = None
|
||||
header = None
|
||||
key = None
|
||||
val = None
|
||||
attribute = None
|
||||
values = None
|
||||
key_data = None
|
||||
|
||||
raw_output = []
|
||||
|
||||
data = data.splitlines()
|
||||
|
||||
# remove header rows
|
||||
for row in data.copy():
|
||||
if row:
|
||||
data.pop(0)
|
||||
else:
|
||||
break
|
||||
|
||||
# main parsing loop
|
||||
for line in data:
|
||||
# new item
|
||||
if not line:
|
||||
item_header = True
|
||||
item_values = False
|
||||
value_list = False
|
||||
|
||||
if item:
|
||||
if values:
|
||||
item['values'][attribute] = values
|
||||
if key_data:
|
||||
item['values'][f'{key}_data'] = key_data
|
||||
raw_output.append(item)
|
||||
|
||||
item = {}
|
||||
header = None
|
||||
key = None
|
||||
val = None
|
||||
attribute = None
|
||||
values = []
|
||||
key_data = []
|
||||
continue
|
||||
|
||||
# header
|
||||
if line.startswith('Handle ') and line.endswith('bytes'):
|
||||
|
||||
# Handle 0x0000, DMI type 0, 24 bytes
|
||||
header = line.replace(',', ' ').split()
|
||||
item = {
|
||||
'handle': header[1],
|
||||
'type': header[4],
|
||||
'bytes': header[5]
|
||||
}
|
||||
continue
|
||||
|
||||
# description
|
||||
if item_header:
|
||||
item_header = False
|
||||
item_values = True
|
||||
value_list = False
|
||||
|
||||
item['description'] = line
|
||||
item['values'] = {}
|
||||
continue
|
||||
|
||||
# new item if multiple descriptions in handle
|
||||
if not item_header and not line.startswith('\t'):
|
||||
item_header = False
|
||||
item_values = True
|
||||
value_list = False
|
||||
|
||||
if item:
|
||||
if values:
|
||||
item['values'][attribute] = values
|
||||
if key_data:
|
||||
item['values'][f'{key}_data'] = key_data
|
||||
raw_output.append(item)
|
||||
|
||||
item = {
|
||||
'handle': header[1],
|
||||
'type': header[4],
|
||||
'bytes': header[5],
|
||||
'description': line,
|
||||
'values': {}
|
||||
}
|
||||
|
||||
key = None
|
||||
val = None
|
||||
attribute = None
|
||||
values = []
|
||||
key_data = []
|
||||
continue
|
||||
|
||||
# keys and values
|
||||
if item_values \
|
||||
and len(line.split(':', maxsplit=1)) == 2 \
|
||||
and line.startswith('\t') \
|
||||
and not line.startswith('\t\t') \
|
||||
and not line.strip().endswith(':'):
|
||||
item_header = False
|
||||
item_values = True
|
||||
value_list = False
|
||||
|
||||
if values:
|
||||
item['values'][attribute] = values
|
||||
values = []
|
||||
if key_data:
|
||||
item['values'][f'{key}_data'] = key_data
|
||||
key_data = []
|
||||
|
||||
key = line.split(':', maxsplit=1)[0].strip().lower().replace(' ', '_')
|
||||
val = line.split(':', maxsplit=1)[1].strip()
|
||||
item['values'].update({key: val})
|
||||
continue
|
||||
|
||||
# multi-line key
|
||||
if item_values \
|
||||
and line.startswith('\t') \
|
||||
and not line.startswith('\t\t') \
|
||||
and line.strip().endswith(':'):
|
||||
item_header = False
|
||||
item_values = True
|
||||
value_list = True
|
||||
|
||||
if values:
|
||||
item['values'][attribute] = values
|
||||
values = []
|
||||
if key_data:
|
||||
item['values'][f'{key}_data'] = key_data
|
||||
key_data = []
|
||||
|
||||
attribute = line[:-1].strip().lower().replace(' ', '_')
|
||||
values = []
|
||||
continue
|
||||
|
||||
# multi-line values
|
||||
if value_list \
|
||||
and line.startswith('\t\t'):
|
||||
values.append(line.strip())
|
||||
continue
|
||||
|
||||
# data for hybrid multi-line objects
|
||||
if item_values \
|
||||
and not value_list \
|
||||
and line.startswith('\t\t'):
|
||||
if f'{key}_data' not in item['values']:
|
||||
item['values'][f'{key}_data'] = []
|
||||
key_data.append(line.strip())
|
||||
continue
|
||||
|
||||
if item:
|
||||
raw_output.append(item)
|
||||
|
||||
if raw:
|
||||
return raw_output
|
||||
else:
|
||||
return process(raw_output)
|
||||
128
jc/parsers/file.py
Normal file
128
jc/parsers/file.py
Normal file
@@ -0,0 +1,128 @@
|
||||
"""jc - JSON CLI output utility file command Parser
|
||||
|
||||
Usage:
|
||||
|
||||
specify --file as the first argument if the piped input is coming from file.
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux', 'aix', 'freebsd', 'darwin'
|
||||
|
||||
Examples:
|
||||
|
||||
$ file * | jc --file -p
|
||||
[
|
||||
{
|
||||
"filename": "Applications",
|
||||
"type": "directory"
|
||||
},
|
||||
{
|
||||
"filename": "another file with spaces",
|
||||
"type": "empty"
|
||||
},
|
||||
{
|
||||
"filename": "argstest.py",
|
||||
"type": "Python script text executable, ASCII text"
|
||||
},
|
||||
{
|
||||
"filename": "blkid-p.out",
|
||||
"type": "ASCII text"
|
||||
},
|
||||
{
|
||||
"filename": "blkid-pi.out",
|
||||
"type": "ASCII text, with very long lines"
|
||||
},
|
||||
{
|
||||
"filename": "cd_catalog.xml",
|
||||
"type": "XML 1.0 document text, ASCII text, with CRLF line terminators"
|
||||
},
|
||||
{
|
||||
"filename": "centosserial.sh",
|
||||
"type": "Bourne-Again shell script text executable, UTF-8 Unicode text"
|
||||
},
|
||||
...
|
||||
]
|
||||
"""
|
||||
import jc.utils
|
||||
import jc.parsers.universal
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.1'
|
||||
description = 'file command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
|
||||
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
|
||||
compatible = ['linux', 'aix', 'freebsd', 'darwin']
|
||||
magic_commands = ['file']
|
||||
|
||||
|
||||
__version__ = info.version
|
||||
|
||||
|
||||
def process(proc_data):
|
||||
"""
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Structured data with the following schema:
|
||||
|
||||
[
|
||||
{
|
||||
"filename": string,
|
||||
"type ": string
|
||||
}
|
||||
]
|
||||
"""
|
||||
# No further processing
|
||||
return proc_data
|
||||
|
||||
|
||||
def parse(data, raw=False, quiet=False):
|
||||
"""
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) output preprocessed JSON if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Raw or processed structured data.
|
||||
"""
|
||||
if not quiet:
|
||||
jc.utils.compatibility(__name__, info.compatible)
|
||||
|
||||
raw_output = []
|
||||
|
||||
warned = False
|
||||
for line in filter(None, data.splitlines()):
|
||||
linedata = line.rsplit(': ', maxsplit=1)
|
||||
|
||||
try:
|
||||
filename = linedata[0].strip()
|
||||
filetype = linedata[1].strip()
|
||||
|
||||
raw_output.append(
|
||||
{
|
||||
'filename': filename,
|
||||
'type': filetype
|
||||
}
|
||||
)
|
||||
except IndexError:
|
||||
if not warned:
|
||||
jc.utils.warning_message('Filenames with newline characters detected. Some filenames may be truncated.')
|
||||
warned = True
|
||||
|
||||
if raw:
|
||||
return raw_output
|
||||
else:
|
||||
return process(raw_output)
|
||||
@@ -70,7 +70,7 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
description = 'fstab file parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -145,7 +145,7 @@ def parse(data, raw=False, quiet=False):
|
||||
for line in cleandata:
|
||||
output_line = {}
|
||||
# ignore commented lines
|
||||
if line.strip().find('#') == 0:
|
||||
if line.strip().startswith('#'):
|
||||
continue
|
||||
|
||||
line_list = line.split(maxsplit=6)
|
||||
|
||||
@@ -80,21 +80,11 @@ def process(proc_data):
|
||||
# rebuild output for added semantic information
|
||||
processed = []
|
||||
for k, v in proc_data.items():
|
||||
proc_line = {}
|
||||
proc_line['line'] = k
|
||||
proc_line['command'] = v
|
||||
proc_line = {
|
||||
'line': int(k) if k.isdigit() else None,
|
||||
'command': v,
|
||||
}
|
||||
processed.append(proc_line)
|
||||
|
||||
for entry in processed:
|
||||
int_list = ['line']
|
||||
for key in int_list:
|
||||
if key in entry:
|
||||
try:
|
||||
key_int = int(entry[key])
|
||||
entry[key] = key_int
|
||||
except (ValueError):
|
||||
entry[key] = None
|
||||
|
||||
return processed
|
||||
|
||||
|
||||
@@ -121,17 +111,14 @@ def parse(data, raw=False, quiet=False):
|
||||
# split lines and clear out any non-ascii chars
|
||||
linedata = data.encode('ascii', errors='ignore').decode().splitlines()
|
||||
|
||||
# Clear any blank lines
|
||||
cleandata = list(filter(None, linedata))
|
||||
|
||||
if cleandata:
|
||||
for entry in cleandata:
|
||||
try:
|
||||
parsed_line = entry.split(maxsplit=1)
|
||||
raw_output[parsed_line[0]] = parsed_line[1]
|
||||
except IndexError:
|
||||
# need to catch indexerror in case there is weird input from prior commands
|
||||
pass
|
||||
# Skip any blank lines
|
||||
for entry in filter(None, linedata):
|
||||
try:
|
||||
parsed_line = entry.split(maxsplit=1)
|
||||
raw_output[parsed_line[0]] = parsed_line[1]
|
||||
except IndexError:
|
||||
# need to catch indexerror in case there is weird input from prior commands
|
||||
pass
|
||||
|
||||
if raw:
|
||||
return raw_output
|
||||
|
||||
@@ -61,7 +61,7 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
description = '/etc/hosts file parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -126,7 +126,7 @@ def parse(data, raw=False, quiet=False):
|
||||
for line in cleandata:
|
||||
output_line = {}
|
||||
# ignore commented lines
|
||||
if line.strip().find('#') == 0:
|
||||
if line.strip().startswith('#'):
|
||||
continue
|
||||
|
||||
line_list = line.split(maxsplit=1)
|
||||
@@ -136,7 +136,7 @@ def parse(data, raw=False, quiet=False):
|
||||
|
||||
comment_found = False
|
||||
for i, item in enumerate(hosts_list):
|
||||
if item.find('#') != -1:
|
||||
if '#' in item:
|
||||
comment_found = True
|
||||
comment_item = i
|
||||
break
|
||||
|
||||
@@ -141,16 +141,17 @@ Examples:
|
||||
}
|
||||
]
|
||||
"""
|
||||
import re
|
||||
from collections import namedtuple
|
||||
import jc.utils
|
||||
from ifconfigparser import IfconfigParser
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.5'
|
||||
version = '1.7'
|
||||
description = 'ifconfig command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
details = 'Using ifconfig-parser package from https://github.com/KnightWhoSayNi/ifconfig-parser'
|
||||
details = 'Using ifconfig-parser from https://github.com/KnightWhoSayNi/ifconfig-parser'
|
||||
|
||||
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
|
||||
compatible = ['linux', 'aix', 'freebsd', 'darwin']
|
||||
@@ -160,6 +161,222 @@ class info():
|
||||
__version__ = info.version
|
||||
|
||||
|
||||
class IfconfigParser(object):
|
||||
# Author: threeheadedknight@protonmail.com
|
||||
# Date created: 30.06.2018 17:03
|
||||
# Python Version: 3.7
|
||||
|
||||
# MIT License
|
||||
|
||||
# Copyright (c) 2018 threeheadedknight@protonmail.com
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
attributes = ['name', 'type', 'mac_addr', 'ipv4_addr', 'ipv4_bcast', 'ipv4_mask', 'ipv6_addr', 'ipv6_mask',
|
||||
'ipv6_scope', 'state', 'mtu', 'metric', 'rx_packets', 'rx_errors', 'rx_dropped', 'rx_overruns',
|
||||
'rx_frame', 'tx_packets', 'tx_errors', 'tx_dropped', 'tx_overruns', 'tx_carrier', 'tx_collisions',
|
||||
'rx_bytes', 'tx_bytes']
|
||||
|
||||
def __init__(self, console_output):
|
||||
"""
|
||||
:param console_output:
|
||||
"""
|
||||
|
||||
if isinstance(console_output, list):
|
||||
source_data = " ".join(console_output)
|
||||
else:
|
||||
source_data = console_output.replace("\n", " ")
|
||||
self.interfaces = self.parser(source_data=source_data)
|
||||
|
||||
def list_interfaces(self):
|
||||
"""
|
||||
:return:
|
||||
"""
|
||||
return sorted(self.interfaces.keys())
|
||||
|
||||
def count_interfaces(self):
|
||||
"""
|
||||
:return:
|
||||
"""
|
||||
return len(self.interfaces.keys())
|
||||
|
||||
def filter_interfaces(self, **kwargs):
|
||||
"""
|
||||
:param kwargs:
|
||||
:return:
|
||||
"""
|
||||
for attr in kwargs.keys():
|
||||
if attr not in IfconfigParser.attributes:
|
||||
raise ValueError("Attribute [{}] not supported.".format(attr))
|
||||
|
||||
filtered_interfaces = []
|
||||
for name, details in self.interfaces.items():
|
||||
|
||||
if all(getattr(details, attr) == kwargs[attr] for attr in kwargs.keys()):
|
||||
filtered_interfaces.append(name)
|
||||
|
||||
return sorted(filtered_interfaces)
|
||||
|
||||
def get_interface(self, name):
|
||||
"""
|
||||
:param name:
|
||||
:return:
|
||||
"""
|
||||
if name in self.list_interfaces():
|
||||
return self.interfaces[name]
|
||||
else:
|
||||
raise InterfaceNotFound("Interface [{}] not found.".format(name))
|
||||
|
||||
def get_interfaces(self):
|
||||
"""
|
||||
:return:
|
||||
"""
|
||||
return self.interfaces
|
||||
|
||||
def is_available(self, name):
|
||||
"""
|
||||
:param name:
|
||||
:return:
|
||||
"""
|
||||
return name in self.interfaces
|
||||
|
||||
def parser(self, source_data):
|
||||
"""
|
||||
:param source_data:
|
||||
:return:
|
||||
"""
|
||||
|
||||
# Linux syntax
|
||||
re_linux_interface = re.compile(
|
||||
r"(?P<name>[a-zA-Z0-9:._-]+)\s+Link encap:(?P<type>\S+\s?\S+)(\s+HWaddr\s+\b"
|
||||
r"(?P<mac_addr>[0-9A-Fa-f:?]+))?",
|
||||
re.I)
|
||||
re_linux_ipv4 = re.compile(
|
||||
r"inet addr:(?P<ipv4_addr>(?:[0-9]{1,3}\.){3}[0-9]{1,3})(\s+Bcast:"
|
||||
r"(?P<ipv4_bcast>(?:[0-9]{1,3}\.){3}[0-9]{1,3}))?\s+Mask:(?P<ipv4_mask>(?:[0-9]{1,3}\.){3}[0-9]{1,3})",
|
||||
re.I)
|
||||
re_linux_ipv6 = re.compile(
|
||||
r"inet6 addr:\s+(?P<ipv6_addr>\S+)/(?P<ipv6_mask>[0-9]+)\s+Scope:(?P<ipv6_scope>Link|Host)",
|
||||
re.I)
|
||||
re_linux_state = re.compile(
|
||||
r"\W+(?P<state>(?:\w+\s)+)(?:\s+)?MTU:(?P<mtu>[0-9]+)\s+Metric:(?P<metric>[0-9]+)", re.I)
|
||||
re_linux_rx = re.compile(
|
||||
r"RX packets:(?P<rx_packets>[0-9]+)\s+errors:(?P<rx_errors>[0-9]+)\s+dropped:"
|
||||
r"(?P<rx_dropped>[0-9]+)\s+overruns:(?P<rx_overruns>[0-9]+)\s+frame:(?P<rx_frame>[0-9]+)",
|
||||
re.I)
|
||||
re_linux_tx = re.compile(
|
||||
r"TX packets:(?P<tx_packets>[0-9]+)\s+errors:(?P<tx_errors>[0-9]+)\s+dropped:"
|
||||
r"(?P<tx_dropped>[0-9]+)\s+overruns:(?P<tx_overruns>[0-9]+)\s+carrier:(?P<tx_carrier>[0-9]+)",
|
||||
re.I)
|
||||
re_linux_bytes = re.compile(r"\W+RX bytes:(?P<rx_bytes>\d+)\s+\(.*\)\s+TX bytes:(?P<tx_bytes>\d+)\s+\(.*\)", re.I)
|
||||
re_linux_tx_stats = re.compile(r"collisions:(?P<tx_collisions>[0-9]+)\s+txqueuelen:[0-9]+", re.I)
|
||||
re_linux = [re_linux_interface, re_linux_ipv4, re_linux_ipv6, re_linux_state, re_linux_rx, re_linux_tx,
|
||||
re_linux_bytes, re_linux_tx_stats]
|
||||
|
||||
# OpenBSD syntax
|
||||
re_openbsd_interface = re.compile(
|
||||
r"(?P<name>[a-zA-Z0-9:._-]+):\s+flags=(?P<flags>[0-9]+)<(?P<state>\S+)?>\s+mtu\s+(?P<mtu>[0-9]+)",
|
||||
re.I)
|
||||
re_openbsd_ipv4 = re.compile(
|
||||
r"inet (?P<ipv4_addr>(?:[0-9]{1,3}\.){3}[0-9]{1,3})\s+netmask\s+"
|
||||
r"(?P<ipv4_mask>(?:[0-9]{1,3}\.){3}[0-9]{1,3})(\s+broadcast\s+"
|
||||
r"(?P<ipv4_bcast>(?:[0-9]{1,3}\.){3}[0-9]{1,3}))?",
|
||||
re.I)
|
||||
re_openbsd_ipv6 = re.compile(
|
||||
r"inet6\s+(?P<ipv6_addr>\S+)\s+prefixlen\s+(?P<ipv6_mask>[0-9]+)\s+scopeid\s+(?P<ipv6_scope>\w+x\w+)<"
|
||||
r"(?:link|host)>",
|
||||
re.I)
|
||||
re_openbsd_details = re.compile(
|
||||
r"\S+\s+(?:(?P<mac_addr>[0-9A-Fa-f:?]+)\s+)?txqueuelen\s+[0-9]+\s+\((?P<type>\S+\s?\S+)\)", re.I)
|
||||
re_openbsd_rx = re.compile(r"RX packets (?P<rx_packets>[0-9]+)\s+bytes\s+(?P<rx_bytes>\d+)\s+.*", re.I)
|
||||
re_openbsd_rx_stats = re.compile(
|
||||
r"RX errors (?P<rx_errors>[0-9]+)\s+dropped\s+(?P<rx_dropped>[0-9]+)\s+overruns\s+"
|
||||
r"(?P<rx_overruns>[0-9]+)\s+frame\s+(?P<rx_frame>[0-9]+)",
|
||||
re.I)
|
||||
re_openbsd_tx = re.compile(r"TX packets (?P<tx_packets>[0-9]+)\s+bytes\s+(?P<tx_bytes>\d+)\s+.*", re.I)
|
||||
re_openbsd_tx_stats = re.compile(
|
||||
r"TX errors (?P<tx_errors>[0-9]+)\s+dropped\s+(?P<tx_dropped>[0-9]+)\s+overruns\s+"
|
||||
r"(?P<tx_overruns>[0-9]+)\s+carrier\s+(?P<tx_carrier>[0-9]+)\s+collisions\s+(?P<tx_collisions>[0-9]+)",
|
||||
re.I)
|
||||
re_openbsd = [re_openbsd_interface, re_openbsd_ipv4, re_openbsd_ipv6, re_openbsd_details, re_openbsd_rx,
|
||||
re_openbsd_rx_stats, re_openbsd_tx, re_openbsd_tx_stats]
|
||||
|
||||
# FreeBSD syntax
|
||||
re_freebsd_interface = re.compile(
|
||||
r"(?P<name>[a-zA-Z0-9:._-]+):\s+flags=(?P<flags>[0-9]+)<(?P<state>\S+)>\s+metric\s+"
|
||||
r"(?P<metric>[0-9]+)\s+mtu\s+(?P<mtu>[0-9]+)",
|
||||
re.I)
|
||||
re_freebsd_ipv4 = re.compile(
|
||||
r"inet (?P<ipv4_addr>(?:[0-9]{1,3}\.){3}[0-9]{1,3})\s+netmask\s+(?P<ipv4_mask>0x\S+)(\s+broadcast\s+"
|
||||
r"(?P<ipv4_bcast>(?:[0-9]{1,3}\.){3}[0-9]{1,3}))?",
|
||||
re.I)
|
||||
re_freebsd_ipv6 = re.compile(r"\s?inet6\s(?P<ipv6_addr>.*)(?:\%\w+\d+)\sprefixlen\s(?P<ipv6_mask>\d+)(?:\s\w+)?\sscopeid\s(?P<ipv6_scope>\w+x\w+)", re.I)
|
||||
re_freebsd_details = re.compile(r"ether\s+(?P<mac_addr>[0-9A-Fa-f:?]+)", re.I)
|
||||
re_freebsd = [re_freebsd_interface, re_freebsd_ipv4, re_freebsd_ipv6, re_freebsd_details]
|
||||
|
||||
available_interfaces = dict()
|
||||
|
||||
for pattern in [re_linux_interface, re_openbsd_interface, re_freebsd_interface]:
|
||||
network_interfaces = re.finditer(pattern, source_data)
|
||||
positions = []
|
||||
while True:
|
||||
try:
|
||||
pos = next(network_interfaces)
|
||||
positions.append(max(pos.start() - 1, 0))
|
||||
except StopIteration:
|
||||
break
|
||||
if positions:
|
||||
positions.append(len(source_data))
|
||||
break
|
||||
|
||||
if not positions:
|
||||
return available_interfaces
|
||||
|
||||
for l, r in zip(positions, positions[1:]):
|
||||
chunk = source_data[l:r]
|
||||
_interface = dict()
|
||||
for pattern in re_linux + re_openbsd + re_freebsd:
|
||||
match = re.search(pattern, chunk.replace('\t', '\n'))
|
||||
if match:
|
||||
details = match.groupdict()
|
||||
for k, v in details.items():
|
||||
if isinstance(v, str): details[k] = v.strip()
|
||||
_interface.update(details)
|
||||
if _interface is not None:
|
||||
available_interfaces[_interface['name']] = self.update_interface_details(_interface)
|
||||
|
||||
return available_interfaces
|
||||
|
||||
@staticmethod
|
||||
def update_interface_details(interface):
|
||||
for attr in IfconfigParser.attributes:
|
||||
if attr not in interface:
|
||||
interface[attr] = None
|
||||
return namedtuple('Interface', interface.keys())(**interface)
|
||||
|
||||
|
||||
class InterfaceNotFound(Exception):
|
||||
"""
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def process(proc_data):
|
||||
"""
|
||||
Final processing to conform to the schema.
|
||||
@@ -220,7 +437,7 @@ def process(proc_data):
|
||||
# convert OSX-style subnet mask to dotted quad
|
||||
if 'ipv4_mask' in entry:
|
||||
try:
|
||||
if entry['ipv4_mask'].find('0x') == 0:
|
||||
if entry['ipv4_mask'].startswith('0x'):
|
||||
new_mask = entry['ipv4_mask']
|
||||
new_mask = new_mask.lstrip('0x')
|
||||
new_mask = '.'.join(str(int(i, 16)) for i in [new_mask[i:i + 2] for i in range(0, len(new_mask), 2)])
|
||||
|
||||
@@ -134,7 +134,7 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.1'
|
||||
version = '1.2'
|
||||
description = 'iptables command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -247,7 +247,7 @@ def parse(data, raw=False, quiet=False):
|
||||
|
||||
for line in cleandata:
|
||||
|
||||
if line.find('Chain') == 0:
|
||||
if line.startswith('Chain'):
|
||||
raw_output.append(chain)
|
||||
chain = {}
|
||||
headers = []
|
||||
@@ -259,7 +259,7 @@ def parse(data, raw=False, quiet=False):
|
||||
|
||||
continue
|
||||
|
||||
elif line.find('target') == 0 or line.find('pkts') == 1 or line.find('num') == 0:
|
||||
elif line.startswith('target') or line.find('pkts') == 1 or line.startswith('num'):
|
||||
headers = []
|
||||
headers = [h for h in ' '.join(line.lower().strip().split()).split() if h]
|
||||
headers.append("options")
|
||||
|
||||
@@ -77,7 +77,7 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
description = 'jobs command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -176,11 +176,11 @@ def parse(data, raw=False, quiet=False):
|
||||
parsed_line.insert(0, job_number)
|
||||
|
||||
# check for + or - in first field
|
||||
if parsed_line[0].find('+') != -1:
|
||||
if '+' in parsed_line[0]:
|
||||
job_history = 'current'
|
||||
parsed_line[0] = parsed_line[0].rstrip('+')
|
||||
|
||||
if parsed_line[0].find('-') != -1:
|
||||
if '-' in parsed_line[0]:
|
||||
job_history = 'previous'
|
||||
parsed_line[0] = parsed_line[0].rstrip('-')
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
description = 'last and lastb command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -122,6 +122,9 @@ def process(proc_data):
|
||||
if 'logout' in entry and entry['logout'] == 'still_logged_in':
|
||||
entry['logout'] = 'still logged in'
|
||||
|
||||
if 'logout' in entry and entry['logout'] == 'gone_-_no_logout':
|
||||
entry['logout'] = 'gone - no logout'
|
||||
|
||||
return proc_data
|
||||
|
||||
|
||||
@@ -157,6 +160,7 @@ def parse(data, raw=False, quiet=False):
|
||||
|
||||
entry = entry.replace('system boot', 'system_boot')
|
||||
entry = entry.replace(' still logged in', '- still_logged_in')
|
||||
entry = entry.replace(' gone - no logout', '- gone_-_no_logout')
|
||||
|
||||
linedata = entry.split()
|
||||
if re.match(r'[MTWFS][ouerha][nedritnu] [JFMASOND][aepuco][nbrynlgptvc]', ' '.join(linedata[2:4])):
|
||||
|
||||
@@ -149,7 +149,7 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.3'
|
||||
version = '1.4'
|
||||
description = 'ls command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -235,8 +235,9 @@ def parse(data, raw=False, quiet=False):
|
||||
if not re.match(r'[-dclpsbDCMnP?]([-r][-w][-xsS]){2}([-r][-w][-xtT])[+]?', linedata[0]) \
|
||||
and linedata[0].endswith(':'):
|
||||
parent = linedata.pop(0)[:-1]
|
||||
# Pop following total line
|
||||
linedata.pop(0)
|
||||
# Pop following total line if it exists
|
||||
if re.match(r'total [0-9]+', linedata[0]):
|
||||
linedata.pop(0)
|
||||
|
||||
if linedata:
|
||||
# Check if -l was used to parse extra data
|
||||
|
||||
@@ -97,7 +97,7 @@ import jc.parsers.universal
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
description = 'lsof command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -180,47 +180,6 @@ def parse(data, raw=False, quiet=False):
|
||||
|
||||
raw_output = jc.parsers.universal.sparse_table_parse(cleandata)
|
||||
|
||||
'''
|
||||
# find column value of last character of each header
|
||||
header_text = cleandata.pop(0).lower()
|
||||
|
||||
# clean up 'size/off' header
|
||||
# even though forward slash in a key is valid json, it can make things difficult
|
||||
header_row = header_text.replace('/', '_')
|
||||
|
||||
headers = header_row.split()
|
||||
|
||||
header_spec = []
|
||||
for i, h in enumerate(headers):
|
||||
# header tuple is (index, header_name, col)
|
||||
header_spec.append((i, h, header_row.find(h) + len(h)))
|
||||
|
||||
# parse lines
|
||||
for entry in cleandata:
|
||||
output_line = {}
|
||||
|
||||
# normalize data by inserting Null for missing data
|
||||
temp_line = entry.split(maxsplit=len(headers) - 1)
|
||||
|
||||
for spec in header_spec:
|
||||
|
||||
index = spec[0]
|
||||
header_name = spec[1]
|
||||
col = spec[2] - 1 # subtract one since column starts at 0 instead of 1
|
||||
|
||||
if header_name == 'command' or header_name == 'name':
|
||||
continue
|
||||
if entry[col] in string.whitespace:
|
||||
temp_line.insert(index, None)
|
||||
|
||||
name = ' '.join(temp_line[9:])
|
||||
fixed_line = temp_line[0:9]
|
||||
fixed_line.append(name)
|
||||
|
||||
output_line = dict(zip(headers, fixed_line))
|
||||
raw_output.append(output_line)
|
||||
'''
|
||||
|
||||
if raw:
|
||||
return raw_output
|
||||
else:
|
||||
|
||||
@@ -56,7 +56,7 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.1'
|
||||
version = '1.2'
|
||||
description = 'mount command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -165,7 +165,7 @@ def parse(data, raw=False, quiet=False):
|
||||
|
||||
if cleandata:
|
||||
# check for OSX output
|
||||
if cleandata[0].find(' type ') == -1:
|
||||
if ' type ' not in cleandata[0]:
|
||||
raw_output = osx_parse(cleandata)
|
||||
|
||||
else:
|
||||
|
||||
@@ -4,13 +4,18 @@ Usage:
|
||||
|
||||
Specify --netstat as the first argument if the piped input is coming from netstat
|
||||
|
||||
Caveats:
|
||||
|
||||
- Use of multiple 'l' options is not supported on OSX (e.g. 'netstat -rlll')
|
||||
- Use of the 'A' option is not supported on OSX when using the 'r' option (e.g. netstat -rA)
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux'
|
||||
'linux', 'darwin'
|
||||
|
||||
Examples:
|
||||
|
||||
$ sudo netstat -apee | jc --netstat -p
|
||||
# netstat -apee | jc --netstat -p
|
||||
[
|
||||
{
|
||||
"proto": "tcp",
|
||||
@@ -160,166 +165,85 @@ Examples:
|
||||
...
|
||||
]
|
||||
|
||||
$ sudo netstat -apee | jc --netstat -p -r
|
||||
$ netstat -r | jc --netstat -p
|
||||
[
|
||||
{
|
||||
"proto": "tcp",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "localhost",
|
||||
"foreign_address": "0.0.0.0",
|
||||
"state": "LISTEN",
|
||||
"user": "systemd-resolve",
|
||||
"inode": "26958",
|
||||
"program_name": "systemd-resolve",
|
||||
"kind": "network",
|
||||
"pid": "887",
|
||||
"local_port": "domain",
|
||||
"foreign_port": "*",
|
||||
"transport_protocol": "tcp",
|
||||
"network_protocol": "ipv4"
|
||||
"destination": "default",
|
||||
"gateway": "gateway",
|
||||
"genmask": "0.0.0.0",
|
||||
"route_flags": "UG",
|
||||
"mss": 0,
|
||||
"window": 0,
|
||||
"irtt": 0,
|
||||
"iface": "ens33",
|
||||
"kind": "route"
|
||||
},
|
||||
{
|
||||
"proto": "tcp",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "0.0.0.0",
|
||||
"foreign_address": "0.0.0.0",
|
||||
"state": "LISTEN",
|
||||
"user": "root",
|
||||
"inode": "30499",
|
||||
"program_name": "sshd",
|
||||
"kind": "network",
|
||||
"pid": "1186",
|
||||
"local_port": "ssh",
|
||||
"foreign_port": "*",
|
||||
"transport_protocol": "tcp",
|
||||
"network_protocol": "ipv4"
|
||||
"destination": "172.17.0.0",
|
||||
"gateway": "0.0.0.0",
|
||||
"genmask": "255.255.0.0",
|
||||
"route_flags": "U",
|
||||
"mss": 0,
|
||||
"window": 0,
|
||||
"irtt": 0,
|
||||
"iface": "docker0",
|
||||
"kind": "route"
|
||||
},
|
||||
{
|
||||
"proto": "tcp",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "localhost",
|
||||
"foreign_address": "localhost",
|
||||
"state": "ESTABLISHED",
|
||||
"user": "root",
|
||||
"inode": "46829",
|
||||
"program_name": "sshd: root",
|
||||
"kind": "network",
|
||||
"pid": "2242",
|
||||
"local_port": "ssh",
|
||||
"foreign_port": "52186",
|
||||
"transport_protocol": "tcp",
|
||||
"network_protocol": "ipv4"
|
||||
"destination": "192.168.71.0",
|
||||
"gateway": "0.0.0.0",
|
||||
"genmask": "255.255.255.0",
|
||||
"route_flags": "U",
|
||||
"mss": 0,
|
||||
"window": 0,
|
||||
"irtt": 0,
|
||||
"iface": "ens33",
|
||||
"kind": "route"
|
||||
}
|
||||
]
|
||||
|
||||
$ netstat -i | jc --netstat -p
|
||||
[
|
||||
{
|
||||
"iface": "ens33",
|
||||
"mtu": 1500,
|
||||
"rx_ok": 476,
|
||||
"rx_err": 0,
|
||||
"rx_drp": 0,
|
||||
"rx_ovr": 0,
|
||||
"tx_ok": 312,
|
||||
"tx_err": 0,
|
||||
"tx_drp": 0,
|
||||
"tx_ovr": 0,
|
||||
"flg": "BMRU",
|
||||
"kind": "interface"
|
||||
},
|
||||
{
|
||||
"proto": "tcp",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "localhost",
|
||||
"foreign_address": "localhost",
|
||||
"state": "ESTABLISHED",
|
||||
"user": "root",
|
||||
"inode": "46828",
|
||||
"program_name": "ssh",
|
||||
"kind": "network",
|
||||
"pid": "2241",
|
||||
"local_port": "52186",
|
||||
"foreign_port": "ssh",
|
||||
"transport_protocol": "tcp",
|
||||
"network_protocol": "ipv4"
|
||||
},
|
||||
{
|
||||
"proto": "tcp6",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "[::]",
|
||||
"foreign_address": "[::]",
|
||||
"state": "LISTEN",
|
||||
"user": "root",
|
||||
"inode": "30510",
|
||||
"program_name": "sshd",
|
||||
"kind": "network",
|
||||
"pid": "1186",
|
||||
"local_port": "ssh",
|
||||
"foreign_port": "*",
|
||||
"transport_protocol": "tcp",
|
||||
"network_protocol": "ipv6"
|
||||
},
|
||||
{
|
||||
"proto": "udp",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "localhost",
|
||||
"foreign_address": "0.0.0.0",
|
||||
"state": null,
|
||||
"user": "systemd-resolve",
|
||||
"inode": "26957",
|
||||
"program_name": "systemd-resolve",
|
||||
"kind": "network",
|
||||
"pid": "887",
|
||||
"local_port": "domain",
|
||||
"foreign_port": "*",
|
||||
"transport_protocol": "udp",
|
||||
"network_protocol": "ipv4"
|
||||
},
|
||||
{
|
||||
"proto": "raw6",
|
||||
"recv_q": "0",
|
||||
"send_q": "0",
|
||||
"local_address": "[::]",
|
||||
"foreign_address": "[::]",
|
||||
"state": "7",
|
||||
"user": "systemd-network",
|
||||
"inode": "27001",
|
||||
"program_name": "systemd-network",
|
||||
"kind": "network",
|
||||
"pid": "867",
|
||||
"local_port": "ipv6-icmp",
|
||||
"foreign_port": "*",
|
||||
"transport_protocol": null,
|
||||
"network_protocol": "ipv6"
|
||||
},
|
||||
{
|
||||
"proto": "unix",
|
||||
"refcnt": "2",
|
||||
"flags": null,
|
||||
"type": "DGRAM",
|
||||
"state": null,
|
||||
"inode": "33322",
|
||||
"program_name": "systemd",
|
||||
"path": "/run/user/1000/systemd/notify",
|
||||
"kind": "socket",
|
||||
"pid": " 1607"
|
||||
},
|
||||
{
|
||||
"proto": "unix",
|
||||
"refcnt": "2",
|
||||
"flags": "ACC",
|
||||
"type": "SEQPACKET",
|
||||
"state": "LISTENING",
|
||||
"inode": "20835",
|
||||
"program_name": "init",
|
||||
"path": "/run/udev/control",
|
||||
"kind": "socket",
|
||||
"pid": " 1"
|
||||
},
|
||||
...
|
||||
"iface": "lo",
|
||||
"mtu": 65536,
|
||||
"rx_ok": 0,
|
||||
"rx_err": 0,
|
||||
"rx_drp": 0,
|
||||
"rx_ovr": 0,
|
||||
"tx_ok": 0,
|
||||
"tx_err": 0,
|
||||
"tx_drp": 0,
|
||||
"tx_ovr": 0,
|
||||
"flg": "LRU",
|
||||
"kind": "interface"
|
||||
}
|
||||
]
|
||||
"""
|
||||
import string
|
||||
import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.2'
|
||||
version = '1.5'
|
||||
description = 'netstat command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
|
||||
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
|
||||
compatible = ['linux']
|
||||
compatible = ['linux', 'darwin']
|
||||
magic_commands = ['netstat']
|
||||
|
||||
|
||||
@@ -361,13 +285,62 @@ def process(proc_data):
|
||||
"type": string,
|
||||
"inode": integer,
|
||||
"path": string,
|
||||
"kind": string
|
||||
"kind": string,
|
||||
"address": string,
|
||||
"osx_inode": string,
|
||||
"conn": string,
|
||||
"refs": string,
|
||||
"nextref": string,
|
||||
"name": string,
|
||||
"unit": integer,
|
||||
"vendor": integer,
|
||||
"class": integer,
|
||||
"subcla": integer,
|
||||
"osx_flags": integer,
|
||||
"pcbcount": integer,
|
||||
"rcvbuf": integer,
|
||||
"sndbuf": integer,
|
||||
"rxbytes": integer,
|
||||
"txbytes": integer,
|
||||
"destination": string,
|
||||
"gateway": string,
|
||||
"route_flags": string,
|
||||
"route_refs": integer,
|
||||
"use": integer,
|
||||
"mtu": integer,
|
||||
"expire": string,
|
||||
"genmask": string,
|
||||
"mss": integer,
|
||||
"window": integer,
|
||||
"irtt": integer,
|
||||
"iface": string,
|
||||
"metric": integer,
|
||||
"network": string,
|
||||
"address": string,
|
||||
"ipkts": integer, - = null
|
||||
"ierrs": integer, - = null
|
||||
"opkts": integer, - = null
|
||||
"oerrs": integer, - = null
|
||||
"coll": integer, - = null
|
||||
"rx_ok": integer,
|
||||
"rx_err": integer,
|
||||
"rx_drp": integer,
|
||||
"rx_ovr": integer,
|
||||
"tx_ok": integer,
|
||||
"tx_err": integer,
|
||||
"tx_drp": integer,
|
||||
"tx_ovr": integer,
|
||||
"flg": string
|
||||
}
|
||||
]
|
||||
"""
|
||||
for entry in proc_data:
|
||||
# integer changes
|
||||
int_list = ['recv_q', 'send_q', 'pid', 'refcnt', 'inode']
|
||||
int_list = ['recv_q', 'send_q', 'pid', 'refcnt', 'inode', 'unit', 'vendor', 'class',
|
||||
'osx_flags', 'subcla', 'pcbcount', 'rcvbuf', 'sndbuf', 'rxbytes', 'txbytes',
|
||||
'route_refs', 'use', 'mtu', 'mss', 'window', 'irtt', 'metric', 'ipkts',
|
||||
'ierrs', 'opkts', 'oerrs', 'coll', 'rx_ok', 'rx_err', 'rx_drp', 'rx_ovr',
|
||||
'tx_ok', 'tx_err', 'tx_drp', 'tx_ovr']
|
||||
for key in int_list:
|
||||
if key in entry:
|
||||
try:
|
||||
@@ -391,128 +364,6 @@ def process(proc_data):
|
||||
return proc_data
|
||||
|
||||
|
||||
def normalize_headers(header):
|
||||
header = header.lower()
|
||||
header = header.replace('local address', 'local_address')
|
||||
header = header.replace('foreign address', 'foreign_address')
|
||||
header = header.replace('pid/program name', 'program_name')
|
||||
header = header.replace('security context', 'security_context')
|
||||
header = header.replace('i-node', 'inode')
|
||||
header = header.replace('-', '_')
|
||||
|
||||
return header
|
||||
|
||||
|
||||
def parse_network(headers, entry):
|
||||
# Count words in header
|
||||
# if len of line is one less than len of header, then insert None in field 5
|
||||
entry = entry.split(maxsplit=len(headers) - 1)
|
||||
|
||||
if len(entry) == len(headers) - 1:
|
||||
entry.insert(5, None)
|
||||
|
||||
output_line = dict(zip(headers, entry))
|
||||
output_line['kind'] = 'network'
|
||||
|
||||
return output_line
|
||||
|
||||
|
||||
def parse_socket(header_text, headers, entry):
|
||||
output_line = {}
|
||||
# get the column # of first letter of "state"
|
||||
state_col = header_text.find('state')
|
||||
# get the program name column area
|
||||
pn_start = header_text.find('program_name')
|
||||
pn_end = header_text.find('path') - 1
|
||||
|
||||
# remove [ and ] from each line
|
||||
entry = entry.replace('[ ]', '---')
|
||||
entry = entry.replace('[', ' ').replace(']', ' ')
|
||||
|
||||
# find program_name column area and substitute spaces with \u2063 there
|
||||
old_pn = entry[pn_start:pn_end]
|
||||
new_pn = old_pn.replace(' ', '\u2063')
|
||||
entry = entry.replace(old_pn, new_pn)
|
||||
|
||||
entry_list = entry.split(maxsplit=len(headers) - 1)
|
||||
# check column # to see if state column is populated
|
||||
if entry[state_col] in string.whitespace:
|
||||
entry_list.insert(4, None)
|
||||
|
||||
output_line = dict(zip(headers, entry_list))
|
||||
output_line['kind'] = 'socket'
|
||||
|
||||
# fix program_name field to turn \u2063 back to spaces
|
||||
if 'program_name' in output_line:
|
||||
if output_line['program_name']:
|
||||
old_d_pn = output_line['program_name']
|
||||
new_d_pn = old_d_pn.replace('\u2063', ' ')
|
||||
output_line['program_name'] = new_d_pn
|
||||
|
||||
return output_line
|
||||
|
||||
|
||||
def parse_post(raw_data):
|
||||
# clean up trailing whitespace on each item in each entry
|
||||
# flags --- = null
|
||||
# program_name - = null
|
||||
# split pid and program name and ip addresses and ports
|
||||
# create network and transport protocol fields
|
||||
|
||||
for entry in raw_data:
|
||||
for item in entry:
|
||||
try:
|
||||
entry[item] = entry[item].rstrip()
|
||||
except (AttributeError):
|
||||
# skips trying to rstrip Null entries
|
||||
pass
|
||||
|
||||
if 'flags' in entry:
|
||||
if entry['flags'] == '---':
|
||||
entry['flags'] = None
|
||||
|
||||
if 'program_name' in entry:
|
||||
entry['program_name'] = entry['program_name'].strip()
|
||||
if entry['program_name'] == '-':
|
||||
entry['program_name'] = None
|
||||
|
||||
if entry['program_name']:
|
||||
pid = entry['program_name'].split('/', maxsplit=1)[0]
|
||||
name = entry['program_name'].split('/', maxsplit=1)[1]
|
||||
entry['pid'] = pid
|
||||
entry['program_name'] = name
|
||||
|
||||
if 'local_address' in entry:
|
||||
if entry['local_address']:
|
||||
ladd = entry['local_address'].rsplit(':', maxsplit=1)[0]
|
||||
lport = entry['local_address'].rsplit(':', maxsplit=1)[1]
|
||||
entry['local_address'] = ladd
|
||||
entry['local_port'] = lport
|
||||
|
||||
if 'foreign_address' in entry:
|
||||
if entry['foreign_address']:
|
||||
fadd = entry['foreign_address'].rsplit(':', maxsplit=1)[0]
|
||||
fport = entry['foreign_address'].rsplit(':', maxsplit=1)[1]
|
||||
entry['foreign_address'] = fadd
|
||||
entry['foreign_port'] = fport
|
||||
|
||||
if 'proto' in entry and 'kind' in entry:
|
||||
if entry['kind'] == 'network':
|
||||
if entry['proto'].find('tcp') != -1:
|
||||
entry['transport_protocol'] = 'tcp'
|
||||
elif entry['proto'].find('udp') != -1:
|
||||
entry['transport_protocol'] = 'udp'
|
||||
else:
|
||||
entry['transport_protocol'] = None
|
||||
|
||||
if entry['proto'].find('6') != -1:
|
||||
entry['network_protocol'] = 'ipv6'
|
||||
else:
|
||||
entry['network_protocol'] = 'ipv4'
|
||||
|
||||
return raw_data
|
||||
|
||||
|
||||
def parse(data, raw=False, quiet=False):
|
||||
"""
|
||||
Main text parsing function
|
||||
@@ -527,51 +378,32 @@ def parse(data, raw=False, quiet=False):
|
||||
|
||||
List of dictionaries. Raw or processed structured data.
|
||||
"""
|
||||
import jc.utils
|
||||
if not quiet:
|
||||
jc.utils.compatibility(__name__, info.compatible)
|
||||
|
||||
cleandata = data.splitlines()
|
||||
cleandata = list(filter(None, cleandata))
|
||||
|
||||
raw_output = []
|
||||
network = False
|
||||
socket = False
|
||||
headers = ''
|
||||
network_list = []
|
||||
socket_list = []
|
||||
|
||||
for line in cleandata:
|
||||
# check for OSX vs Linux
|
||||
# is this from OSX?
|
||||
if cleandata[0] == 'Active Internet connections' \
|
||||
or cleandata[0] == 'Active Internet connections (including servers)' \
|
||||
or cleandata[0] == 'Active Multipath Internet connections' \
|
||||
or cleandata[0] == 'Active LOCAL (UNIX) domain sockets' \
|
||||
or cleandata[0] == 'Registered kernel control modules' \
|
||||
or cleandata[0] == 'Active kernel event sockets' \
|
||||
or cleandata[0] == 'Active kernel control sockets' \
|
||||
or cleandata[0] == 'Routing tables' \
|
||||
or cleandata[0] == 'Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll':
|
||||
import jc.parsers.netstat_osx
|
||||
raw_output = jc.parsers.netstat_osx.parse(cleandata)
|
||||
|
||||
if line.find('Active Internet') == 0:
|
||||
network_list = []
|
||||
network = True
|
||||
socket = False
|
||||
continue
|
||||
|
||||
if line.find('Active UNIX') == 0:
|
||||
socket_list = []
|
||||
network = False
|
||||
socket = True
|
||||
continue
|
||||
|
||||
if line.find('Proto') == 0:
|
||||
header_text = normalize_headers(line)
|
||||
headers = header_text.split()
|
||||
continue
|
||||
|
||||
if network:
|
||||
network_list.append(parse_network(headers, line))
|
||||
continue
|
||||
|
||||
if socket:
|
||||
socket_list.append(parse_socket(header_text, headers, line))
|
||||
continue
|
||||
|
||||
for item in [network_list, socket_list]:
|
||||
for entry in item:
|
||||
raw_output.append(entry)
|
||||
|
||||
raw_output = parse_post(raw_output)
|
||||
# use linux parser
|
||||
else:
|
||||
import jc.parsers.netstat_linux
|
||||
raw_output = jc.parsers.netstat_linux.parse(cleandata)
|
||||
|
||||
if raw:
|
||||
return raw_output
|
||||
|
||||
257
jc/parsers/netstat_linux.py
Normal file
257
jc/parsers/netstat_linux.py
Normal file
@@ -0,0 +1,257 @@
|
||||
"""jc - JSON CLI output utility Linux netstat Parser"""
|
||||
import string
|
||||
|
||||
|
||||
def normalize_headers(header):
|
||||
header = header.lower()
|
||||
header = header.replace('local address', 'local_address')
|
||||
header = header.replace('foreign address', 'foreign_address')
|
||||
header = header.replace('pid/program name', 'program_name')
|
||||
header = header.replace('security context', 'security_context')
|
||||
header = header.replace('i-node', 'inode')
|
||||
header = header.replace('-', '_')
|
||||
|
||||
return header
|
||||
|
||||
|
||||
def normalize_route_headers(header):
|
||||
header = header.lower()
|
||||
header = header.replace('flags', 'route_flags')
|
||||
header = header.replace('ref', 'route_refs')
|
||||
header = header.replace('-', '_')
|
||||
|
||||
return header
|
||||
|
||||
|
||||
def normalize_interface_headers(header):
|
||||
header = header.lower()
|
||||
header = header.replace('-', '_')
|
||||
|
||||
return header
|
||||
|
||||
|
||||
def parse_network(headers, entry):
|
||||
# Count words in header
|
||||
# if len of line is one less than len of header, then insert None in field 5
|
||||
entry = entry.split(maxsplit=len(headers) - 1)
|
||||
|
||||
if len(entry) == len(headers) - 1:
|
||||
entry.insert(5, None)
|
||||
|
||||
output_line = dict(zip(headers, entry))
|
||||
output_line['kind'] = 'network'
|
||||
|
||||
return output_line
|
||||
|
||||
|
||||
def parse_socket(header_text, headers, entry):
|
||||
# get the column # of first letter of "state"
|
||||
state_col = header_text.find('state')
|
||||
# get the program name column area
|
||||
pn_start = header_text.find('program_name')
|
||||
pn_end = header_text.find('path') - 1
|
||||
|
||||
# remove [ and ] from each line
|
||||
entry = entry.replace('[ ]', '---')
|
||||
entry = entry.replace('[', ' ').replace(']', ' ')
|
||||
|
||||
# find program_name column area and substitute spaces with \u2063 there
|
||||
old_pn = entry[pn_start:pn_end]
|
||||
new_pn = old_pn.replace(' ', '\u2063')
|
||||
entry = entry.replace(old_pn, new_pn)
|
||||
|
||||
entry_list = entry.split(maxsplit=len(headers) - 1)
|
||||
# check column # to see if state column is populated
|
||||
if entry[state_col] in string.whitespace:
|
||||
entry_list.insert(4, None)
|
||||
|
||||
output_line = dict(zip(headers, entry_list))
|
||||
output_line['kind'] = 'socket'
|
||||
|
||||
# fix program_name field to turn \u2063 back to spaces
|
||||
if 'program_name' in output_line:
|
||||
if output_line['program_name']:
|
||||
old_d_pn = output_line['program_name']
|
||||
new_d_pn = old_d_pn.replace('\u2063', ' ')
|
||||
output_line['program_name'] = new_d_pn
|
||||
|
||||
return output_line
|
||||
|
||||
|
||||
def parse_route(headers, entry):
|
||||
entry = entry.split(maxsplit=len(headers) - 1)
|
||||
output_line = dict(zip(headers, entry))
|
||||
output_line['kind'] = 'route'
|
||||
|
||||
return output_line
|
||||
|
||||
|
||||
def parse_interface(headers, entry):
|
||||
entry = entry.split(maxsplit=len(headers) - 1)
|
||||
output_line = dict(zip(headers, entry))
|
||||
output_line['kind'] = 'interface'
|
||||
|
||||
return output_line
|
||||
|
||||
|
||||
def parse_post(raw_data):
|
||||
# clean up trailing whitespace on each item in each entry
|
||||
# flags --- = null
|
||||
# program_name - = null
|
||||
# split pid and program name and ip addresses and ports
|
||||
# create network and transport protocol fields
|
||||
|
||||
for entry in raw_data:
|
||||
for item in entry:
|
||||
try:
|
||||
entry[item] = entry[item].rstrip()
|
||||
except (AttributeError):
|
||||
# skips trying to rstrip Null entries
|
||||
pass
|
||||
|
||||
if 'flags' in entry:
|
||||
if entry['flags'] == '---':
|
||||
entry['flags'] = None
|
||||
|
||||
if 'program_name' in entry:
|
||||
entry['program_name'] = entry['program_name'].strip()
|
||||
if entry['program_name'] == '-':
|
||||
entry['program_name'] = None
|
||||
|
||||
if entry['program_name']:
|
||||
pid = entry['program_name'].split('/', maxsplit=1)[0]
|
||||
name = entry['program_name'].split('/', maxsplit=1)[1]
|
||||
entry['pid'] = pid
|
||||
entry['program_name'] = name
|
||||
|
||||
if 'local_address' in entry:
|
||||
if entry['local_address']:
|
||||
ladd = entry['local_address'].rsplit(':', maxsplit=1)[0]
|
||||
lport = entry['local_address'].rsplit(':', maxsplit=1)[1]
|
||||
entry['local_address'] = ladd
|
||||
entry['local_port'] = lport
|
||||
|
||||
if 'foreign_address' in entry:
|
||||
if entry['foreign_address']:
|
||||
fadd = entry['foreign_address'].rsplit(':', maxsplit=1)[0]
|
||||
fport = entry['foreign_address'].rsplit(':', maxsplit=1)[1]
|
||||
entry['foreign_address'] = fadd
|
||||
entry['foreign_port'] = fport
|
||||
|
||||
if 'proto' in entry and 'kind' in entry:
|
||||
if entry['kind'] == 'network':
|
||||
if 'tcp' in entry['proto']:
|
||||
entry['transport_protocol'] = 'tcp'
|
||||
elif 'udp' in entry['proto']:
|
||||
entry['transport_protocol'] = 'udp'
|
||||
else:
|
||||
entry['transport_protocol'] = None
|
||||
|
||||
if '6' in entry['proto']:
|
||||
entry['network_protocol'] = 'ipv6'
|
||||
else:
|
||||
entry['network_protocol'] = 'ipv4'
|
||||
|
||||
return raw_data
|
||||
|
||||
|
||||
def parse(cleandata):
|
||||
"""
|
||||
Main text parsing function for OSX netstat
|
||||
|
||||
Parameters:
|
||||
|
||||
cleandata: (string) text data to parse
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Raw structured data.
|
||||
"""
|
||||
raw_output = []
|
||||
network = False
|
||||
socket = False
|
||||
bluetooth = False
|
||||
routing_table = False
|
||||
interface_table = False
|
||||
headers = None
|
||||
|
||||
for line in cleandata:
|
||||
|
||||
if line.startswith('Active Internet'):
|
||||
network = True
|
||||
socket = False
|
||||
bluetooth = False
|
||||
routing_table = False
|
||||
interface_table = False
|
||||
continue
|
||||
|
||||
if line.startswith('Active UNIX'):
|
||||
network = False
|
||||
socket = True
|
||||
bluetooth = False
|
||||
routing_table = False
|
||||
interface_table = False
|
||||
continue
|
||||
|
||||
if line.startswith('Active Bluetooth'):
|
||||
network = False
|
||||
socket = False
|
||||
bluetooth = True
|
||||
routing_table = False
|
||||
interface_table = False
|
||||
continue
|
||||
|
||||
if line.startswith('Kernel IP routing table'):
|
||||
network = False
|
||||
socket = False
|
||||
bluetooth = False
|
||||
routing_table = True
|
||||
interface_table = False
|
||||
continue
|
||||
|
||||
if line.startswith('Kernel Interface table'):
|
||||
network = False
|
||||
socket = False
|
||||
bluetooth = False
|
||||
routing_table = False
|
||||
interface_table = True
|
||||
continue
|
||||
|
||||
# get headers
|
||||
if line.startswith('Proto'):
|
||||
header_text = normalize_headers(line)
|
||||
headers = header_text.split()
|
||||
continue
|
||||
|
||||
if line.startswith('Destination '):
|
||||
header_text = normalize_route_headers(line)
|
||||
headers = header_text.split()
|
||||
continue
|
||||
|
||||
if line.startswith('Iface '):
|
||||
header_text = normalize_interface_headers(line)
|
||||
headers = header_text.split()
|
||||
continue
|
||||
|
||||
# parse items
|
||||
if network:
|
||||
raw_output.append(parse_network(headers, line))
|
||||
continue
|
||||
|
||||
if socket:
|
||||
raw_output.append(parse_socket(header_text, headers, line))
|
||||
continue
|
||||
|
||||
if bluetooth:
|
||||
# not implemented
|
||||
continue
|
||||
|
||||
if routing_table:
|
||||
raw_output.append(parse_route(headers, line))
|
||||
continue
|
||||
|
||||
if interface_table:
|
||||
raw_output.append(parse_interface(headers, line))
|
||||
continue
|
||||
|
||||
return parse_post(raw_output)
|
||||
273
jc/parsers/netstat_osx.py
Normal file
273
jc/parsers/netstat_osx.py
Normal file
@@ -0,0 +1,273 @@
|
||||
"""jc - JSON CLI output utility OSX netstat Parser"""
|
||||
|
||||
|
||||
def normalize_headers(header):
|
||||
header = header.lower()
|
||||
header = header.replace('local address', 'local_address')
|
||||
header = header.replace('foreign address', 'foreign_address')
|
||||
header = header.replace('(state)', 'state')
|
||||
header = header.replace('inode', 'osx_inode')
|
||||
header = header.replace('flags', 'osx_flags')
|
||||
header = header.replace('-', '_')
|
||||
|
||||
return header
|
||||
|
||||
|
||||
def normalize_route_headers(header):
|
||||
header = header.lower()
|
||||
header = header.replace('flags', 'route_flags')
|
||||
header = header.replace('refs', 'route_refs')
|
||||
header = header.replace('netif', 'iface')
|
||||
header = header.replace('-', '_')
|
||||
|
||||
return header
|
||||
|
||||
|
||||
def normalize_interface_headers(header):
|
||||
header = header.lower()
|
||||
header = header.replace('name', 'iface')
|
||||
header = header.replace('-', '_')
|
||||
|
||||
return header
|
||||
|
||||
|
||||
def parse_item(headers, entry, kind):
|
||||
entry = entry.split(maxsplit=len(headers) - 1)
|
||||
|
||||
# fixup udp records with no state field entry
|
||||
if kind == 'network' and entry[0].startswith('udp'):
|
||||
entry.insert(5, None)
|
||||
if kind == 'network' and 'socket' in headers and 'udp' in str(entry):
|
||||
entry.insert(7, None)
|
||||
|
||||
# fixup interface records with no address field entry
|
||||
if kind == 'interface' and len(entry) == 8:
|
||||
entry.insert(3, None)
|
||||
|
||||
output_line = dict(zip(headers, entry))
|
||||
output_line['kind'] = kind
|
||||
|
||||
return output_line
|
||||
|
||||
|
||||
def parse_post(raw_data):
|
||||
for entry in raw_data:
|
||||
# fixup name field in Registered kernel control module
|
||||
if 'name' in entry:
|
||||
if entry['name']:
|
||||
entry['name'] = entry['name'].strip()
|
||||
|
||||
# create network and transport protocol fields
|
||||
if 'local_address' in entry:
|
||||
if entry['local_address']:
|
||||
ladd = entry['local_address'].rsplit('.', maxsplit=1)[0]
|
||||
lport = entry['local_address'].rsplit('.', maxsplit=1)[1]
|
||||
entry['local_address'] = ladd
|
||||
entry['local_port'] = lport
|
||||
|
||||
if 'foreign_address' in entry:
|
||||
if entry['foreign_address']:
|
||||
fadd = entry['foreign_address'].rsplit('.', maxsplit=1)[0]
|
||||
fport = entry['foreign_address'].rsplit('.', maxsplit=1)[1]
|
||||
entry['foreign_address'] = fadd
|
||||
entry['foreign_port'] = fport
|
||||
|
||||
if 'proto' in entry and 'kind' in entry:
|
||||
if entry['kind'] == 'network':
|
||||
if entry['proto'] == 'udp46':
|
||||
entry['transport_protocol'] = entry['proto'][:-2]
|
||||
elif entry['proto'].startswith('icm'):
|
||||
entry['transport_protocol'] = 'icmp'
|
||||
else:
|
||||
entry['transport_protocol'] = entry['proto'][:-1]
|
||||
|
||||
if '6' in entry['proto']:
|
||||
entry['network_protocol'] = 'ipv6'
|
||||
else:
|
||||
entry['network_protocol'] = 'ipv4'
|
||||
|
||||
return raw_data
|
||||
|
||||
|
||||
def parse(cleandata):
|
||||
"""
|
||||
Main text parsing function for OSX netstat
|
||||
|
||||
Parameters:
|
||||
|
||||
cleandata: (string) text data to parse
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Raw structured data.
|
||||
"""
|
||||
raw_output = []
|
||||
network = False
|
||||
multipath = False
|
||||
socket = False
|
||||
reg_kernel_control = False
|
||||
active_kernel_event = False
|
||||
active_kernel_control = False
|
||||
routing_table = False
|
||||
interface_table = False
|
||||
|
||||
for line in cleandata:
|
||||
|
||||
if line.startswith('Active Internet'):
|
||||
network = True
|
||||
multipath = False
|
||||
socket = False
|
||||
reg_kernel_control = False
|
||||
active_kernel_event = False
|
||||
active_kernel_control = False
|
||||
routing_table = False
|
||||
interface_table = False
|
||||
continue
|
||||
|
||||
if line.startswith('Active Multipath Internet connections'):
|
||||
network = False
|
||||
multipath = True
|
||||
socket = False
|
||||
reg_kernel_control = False
|
||||
active_kernel_event = False
|
||||
active_kernel_control = False
|
||||
routing_table = False
|
||||
interface_table = False
|
||||
continue
|
||||
|
||||
if line.startswith('Active LOCAL (UNIX) domain sockets'):
|
||||
network = False
|
||||
multipath = False
|
||||
socket = True
|
||||
reg_kernel_control = False
|
||||
active_kernel_event = False
|
||||
active_kernel_control = False
|
||||
routing_table = False
|
||||
interface_table = False
|
||||
continue
|
||||
|
||||
if line.startswith('Registered kernel control modules'):
|
||||
network = False
|
||||
multipath = False
|
||||
socket = False
|
||||
reg_kernel_control = True
|
||||
active_kernel_event = False
|
||||
active_kernel_control = False
|
||||
routing_table = False
|
||||
interface_table = False
|
||||
continue
|
||||
|
||||
if line.startswith('Active kernel event sockets'):
|
||||
network = False
|
||||
multipath = False
|
||||
socket = False
|
||||
reg_kernel_control = False
|
||||
active_kernel_event = True
|
||||
active_kernel_control = False
|
||||
routing_table = False
|
||||
interface_table = False
|
||||
continue
|
||||
|
||||
if line.startswith('Active kernel control sockets'):
|
||||
network = False
|
||||
multipath = False
|
||||
socket = False
|
||||
reg_kernel_control = False
|
||||
active_kernel_event = False
|
||||
active_kernel_control = True
|
||||
routing_table = False
|
||||
interface_table = False
|
||||
continue
|
||||
|
||||
if line.startswith('Routing tables'):
|
||||
network = False
|
||||
multipath = False
|
||||
socket = False
|
||||
reg_kernel_control = False
|
||||
active_kernel_event = False
|
||||
active_kernel_control = False
|
||||
routing_table = True
|
||||
interface_table = False
|
||||
continue
|
||||
|
||||
if line.startswith('Name Mtu '):
|
||||
network = False
|
||||
multipath = False
|
||||
socket = False
|
||||
reg_kernel_control = False
|
||||
active_kernel_event = False
|
||||
active_kernel_control = False
|
||||
routing_table = False
|
||||
interface_table = True
|
||||
# don't continue since there is no real header row for this table
|
||||
|
||||
# get headers
|
||||
if network and (line.startswith('Socket ') or line.startswith('Proto ')):
|
||||
header_text = normalize_headers(line)
|
||||
headers = header_text.split()
|
||||
continue
|
||||
|
||||
if socket and line.startswith('Address '):
|
||||
header_text = normalize_headers(line)
|
||||
headers = header_text.split()
|
||||
continue
|
||||
|
||||
if reg_kernel_control and (line.startswith('id ') or line.startswith('kctlref ')):
|
||||
header_text = normalize_headers(line)
|
||||
headers = header_text.split()
|
||||
continue
|
||||
|
||||
if active_kernel_event and (line.startswith('Proto ') or line.startswith(' pcb ')):
|
||||
header_text = normalize_headers(line)
|
||||
headers = header_text.split()
|
||||
continue
|
||||
|
||||
if active_kernel_control and (line.startswith('Proto ') or line.startswith(' pcb ')):
|
||||
header_text = normalize_headers(line)
|
||||
headers = header_text.split()
|
||||
continue
|
||||
|
||||
if routing_table and line.startswith('Destination '):
|
||||
header_text = normalize_route_headers(line)
|
||||
headers = header_text.split()
|
||||
continue
|
||||
|
||||
if interface_table and line.startswith('Name Mtu '):
|
||||
header_text = normalize_interface_headers(line)
|
||||
headers = header_text.split()
|
||||
continue
|
||||
|
||||
# get items
|
||||
if network:
|
||||
raw_output.append(parse_item(headers, line, 'network'))
|
||||
continue
|
||||
|
||||
if multipath:
|
||||
# not implemented
|
||||
continue
|
||||
|
||||
if socket:
|
||||
raw_output.append(parse_item(headers, line, 'socket'))
|
||||
continue
|
||||
|
||||
if reg_kernel_control:
|
||||
raw_output.append(parse_item(headers, line, 'Registered kernel control module'))
|
||||
continue
|
||||
|
||||
if active_kernel_event:
|
||||
raw_output.append(parse_item(headers, line, 'Active kernel event socket'))
|
||||
continue
|
||||
|
||||
if active_kernel_control:
|
||||
raw_output.append(parse_item(headers, line, 'Active kernel control socket'))
|
||||
continue
|
||||
|
||||
if routing_table and not (line.startswith('Internet:') or line.startswith('Internet6:')):
|
||||
raw_output.append(parse_item(headers, line, 'route'))
|
||||
continue
|
||||
|
||||
if interface_table:
|
||||
raw_output.append(parse_item(headers, line, 'interface'))
|
||||
continue
|
||||
|
||||
return parse_post(raw_output)
|
||||
297
jc/parsers/ntpq.py
Normal file
297
jc/parsers/ntpq.py
Normal file
@@ -0,0 +1,297 @@
|
||||
"""jc - JSON CLI output utility ntpq Parser
|
||||
|
||||
Usage:
|
||||
|
||||
specify --ntpq as the first argument if the piped input is coming from ntpq -p
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux'
|
||||
|
||||
Examples:
|
||||
|
||||
$ ntpq -p | jc --ntpq -p
|
||||
[
|
||||
{
|
||||
"remote": "44.190.6.254",
|
||||
"refid": "127.67.113.92",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 1,
|
||||
"poll": 64,
|
||||
"reach": 1,
|
||||
"delay": 23.399,
|
||||
"offset": -2.805,
|
||||
"jitter": 2.131,
|
||||
"state": null
|
||||
},
|
||||
{
|
||||
"remote": "ntp.wdc1.us.lea",
|
||||
"refid": "130.133.1.10",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": null,
|
||||
"poll": 64,
|
||||
"reach": 1,
|
||||
"delay": 93.053,
|
||||
"offset": -0.807,
|
||||
"jitter": 2.839,
|
||||
"state": null
|
||||
},
|
||||
{
|
||||
"remote": "clock.team-cymr",
|
||||
"refid": "204.9.54.119",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": null,
|
||||
"poll": 64,
|
||||
"reach": 1,
|
||||
"delay": 70.337,
|
||||
"offset": -2.909,
|
||||
"jitter": 2.6,
|
||||
"state": null
|
||||
},
|
||||
{
|
||||
"remote": "mirror1.sjc02.s",
|
||||
"refid": "216.218.254.202",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 2,
|
||||
"poll": 64,
|
||||
"reach": 1,
|
||||
"delay": 29.325,
|
||||
"offset": 1.044,
|
||||
"jitter": 4.069,
|
||||
"state": null,
|
||||
}
|
||||
]
|
||||
|
||||
$ ntpq -pn| jc --ntpq -p
|
||||
[
|
||||
{
|
||||
"remote": "44.190.6.254",
|
||||
"refid": "127.67.113.92",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 66,
|
||||
"poll": 64,
|
||||
"reach": 377,
|
||||
"delay": 22.69,
|
||||
"offset": -0.392,
|
||||
"jitter": 2.085,
|
||||
"state": "+"
|
||||
},
|
||||
{
|
||||
"remote": "108.59.2.24",
|
||||
"refid": "130.133.1.10",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 63,
|
||||
"poll": 64,
|
||||
"reach": 377,
|
||||
"delay": 90.805,
|
||||
"offset": 2.84,
|
||||
"jitter": 1.908,
|
||||
"state": "-"
|
||||
},
|
||||
{
|
||||
"remote": "38.229.71.1",
|
||||
"refid": "204.9.54.119",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 64,
|
||||
"poll": 64,
|
||||
"reach": 377,
|
||||
"delay": 68.699,
|
||||
"offset": -0.61,
|
||||
"jitter": 2.576,
|
||||
"state": "+"
|
||||
},
|
||||
{
|
||||
"remote": "72.5.72.15",
|
||||
"refid": "216.218.254.202",
|
||||
"st": 2,
|
||||
"t": "u",
|
||||
"when": 63,
|
||||
"poll": 64,
|
||||
"reach": 377,
|
||||
"delay": 22.654,
|
||||
"offset": 0.231,
|
||||
"jitter": 1.964,
|
||||
"state": "*"
|
||||
}
|
||||
]
|
||||
|
||||
$ ntpq -pn| jc --ntpq -p -r
|
||||
[
|
||||
{
|
||||
"s": "+",
|
||||
"remote": "44.190.6.254",
|
||||
"refid": "127.67.113.92",
|
||||
"st": "2",
|
||||
"t": "u",
|
||||
"when": "66",
|
||||
"poll": "64",
|
||||
"reach": "377",
|
||||
"delay": "22.690",
|
||||
"offset": "-0.392",
|
||||
"jitter": "2.085"
|
||||
},
|
||||
{
|
||||
"s": "-",
|
||||
"remote": "108.59.2.24",
|
||||
"refid": "130.133.1.10",
|
||||
"st": "2",
|
||||
"t": "u",
|
||||
"when": "63",
|
||||
"poll": "64",
|
||||
"reach": "377",
|
||||
"delay": "90.805",
|
||||
"offset": "2.840",
|
||||
"jitter": "1.908"
|
||||
},
|
||||
{
|
||||
"s": "+",
|
||||
"remote": "38.229.71.1",
|
||||
"refid": "204.9.54.119",
|
||||
"st": "2",
|
||||
"t": "u",
|
||||
"when": "64",
|
||||
"poll": "64",
|
||||
"reach": "377",
|
||||
"delay": "68.699",
|
||||
"offset": "-0.610",
|
||||
"jitter": "2.576"
|
||||
},
|
||||
{
|
||||
"s": "*",
|
||||
"remote": "72.5.72.15",
|
||||
"refid": "216.218.254.202",
|
||||
"st": "2",
|
||||
"t": "u",
|
||||
"when": "63",
|
||||
"poll": "64",
|
||||
"reach": "377",
|
||||
"delay": "22.654",
|
||||
"offset": "0.231",
|
||||
"jitter": "1.964"
|
||||
}
|
||||
]
|
||||
"""
|
||||
import jc.utils
|
||||
import jc.parsers.universal
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
description = 'ntpq -p command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
|
||||
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
|
||||
compatible = ['linux']
|
||||
magic_commands = ['ntpq']
|
||||
|
||||
|
||||
__version__ = info.version
|
||||
|
||||
|
||||
def process(proc_data):
|
||||
"""
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Structured data with the following schema:
|
||||
|
||||
[
|
||||
{
|
||||
"state": string, # space/~ converted to null
|
||||
"remote": string,
|
||||
"refid": string,
|
||||
"st": integer,
|
||||
"t": string,
|
||||
"when": integer, # - converted to null
|
||||
"poll": integer,
|
||||
"reach": integer,
|
||||
"delay": float,
|
||||
"offset": float,
|
||||
"jitter": float
|
||||
},
|
||||
]
|
||||
|
||||
"""
|
||||
for entry in proc_data:
|
||||
|
||||
if entry['s'] == '~':
|
||||
entry['s'] = None
|
||||
|
||||
entry['state'] = entry.pop('s')
|
||||
|
||||
int_list = ['st', 'when', 'poll', 'reach']
|
||||
for key in int_list:
|
||||
if key in entry:
|
||||
try:
|
||||
entry[key] = int(entry[key])
|
||||
except (ValueError):
|
||||
entry[key] = None
|
||||
|
||||
float_list = ['delay', 'offset', 'jitter']
|
||||
for key in float_list:
|
||||
if key in entry:
|
||||
try:
|
||||
entry[key] = float(entry[key])
|
||||
except (ValueError):
|
||||
entry[key] = None
|
||||
|
||||
return proc_data
|
||||
|
||||
|
||||
def parse(data, raw=False, quiet=False):
|
||||
"""
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) output preprocessed JSON if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
List of dictionaries. Raw or processed structured data.
|
||||
"""
|
||||
if not quiet:
|
||||
jc.utils.compatibility(__name__, info.compatible)
|
||||
|
||||
raw_output = []
|
||||
|
||||
cleandata = data.splitlines()
|
||||
cleandata[0] = 's ' + cleandata[0]
|
||||
cleandata[0] = cleandata[0].lower()
|
||||
|
||||
# delete header delimiter
|
||||
del cleandata[1]
|
||||
|
||||
# separate first character with a space for easier parsing
|
||||
for i, line in list(enumerate(cleandata[1:])):
|
||||
if line[0] == ' ':
|
||||
# fixup for no-state
|
||||
cleandata[i + 1] = '~ ' + line[1:]
|
||||
else:
|
||||
# fixup - realign columns since we added the 's' column
|
||||
cleandata[i + 1] = line[:1] + ' ' + line[1:]
|
||||
|
||||
# fixup for occaisional ip/hostname fields with a space
|
||||
cleandata[i + 1] = cleandata[i + 1].replace(' (', '_(')
|
||||
|
||||
raw_output = jc.parsers.universal.simple_table_parse(cleandata)
|
||||
|
||||
if raw:
|
||||
return raw_output
|
||||
else:
|
||||
return process(raw_output)
|
||||
@@ -32,7 +32,7 @@ import jc.parsers.universal
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
description = 'pip list command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -94,7 +94,7 @@ def parse(data, raw=False, quiet=False):
|
||||
cleandata = list(filter(None, linedata))
|
||||
|
||||
# detect legacy output type
|
||||
if cleandata[0].find(' (') != -1:
|
||||
if ' (' in cleandata[0]:
|
||||
for row in cleandata:
|
||||
raw_output.append({'package': row.split(' (')[0],
|
||||
'version': row.split(' (')[1].rstrip(')')})
|
||||
@@ -103,7 +103,7 @@ def parse(data, raw=False, quiet=False):
|
||||
else:
|
||||
# clear separator line
|
||||
for i, line in reversed(list(enumerate(cleandata))):
|
||||
if line.find('---') != -1:
|
||||
if '---' in line:
|
||||
cleandata.pop(i)
|
||||
|
||||
cleandata[0] = cleandata[0].lower()
|
||||
|
||||
@@ -6,7 +6,7 @@ Usage:
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux'
|
||||
'linux', 'darwin'
|
||||
|
||||
Examples:
|
||||
|
||||
@@ -100,17 +100,18 @@ Examples:
|
||||
..
|
||||
]
|
||||
"""
|
||||
import shlex
|
||||
import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
version = '1.3'
|
||||
description = 'stat command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
|
||||
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
|
||||
compatible = ['linux']
|
||||
compatible = ['linux', 'darwin']
|
||||
magic_commands = ['stat']
|
||||
|
||||
|
||||
@@ -149,12 +150,16 @@ def process(proc_data):
|
||||
"access_time": string, # - = null
|
||||
"modify_time": string, # - = null
|
||||
"change_time": string, # - = null
|
||||
"birth_time": string # - = null
|
||||
"birth_time": string, # - = null
|
||||
"osx_device": integer,
|
||||
"rdev": integer,
|
||||
"block_size": integer,
|
||||
"osx_flags": string
|
||||
}
|
||||
]
|
||||
"""
|
||||
for entry in proc_data:
|
||||
int_list = ['size', 'blocks', 'io_blocks', 'inode', 'links', 'uid', 'gid']
|
||||
int_list = ['size', 'blocks', 'io_blocks', 'inode', 'links', 'uid', 'gid', 'osx_device', 'rdev', 'block_size']
|
||||
for key in int_list:
|
||||
if key in entry:
|
||||
try:
|
||||
@@ -198,81 +203,109 @@ def parse(data, raw=False, quiet=False):
|
||||
cleandata = list(filter(None, cleandata))
|
||||
|
||||
if cleandata:
|
||||
# stats output contains 8 lines
|
||||
for line in cleandata:
|
||||
|
||||
# line #1
|
||||
if line.find('File:') == 2:
|
||||
output_line = {}
|
||||
line_list = line.split(maxsplit=1)
|
||||
output_line['file'] = line_list[1]
|
||||
# linux output
|
||||
if cleandata[0].startswith(' File: '):
|
||||
# stats output contains 8 lines
|
||||
for line in cleandata:
|
||||
|
||||
# populate link_to field if -> found
|
||||
if output_line['file'].find(' -> ') != -1:
|
||||
filename = output_line['file'].split(' -> ')[0].strip('\u2018').rstrip('\u2019')
|
||||
link = output_line['file'].split(' -> ')[1].strip('\u2018').rstrip('\u2019')
|
||||
output_line['file'] = filename
|
||||
output_line['link_to'] = link
|
||||
else:
|
||||
filename = output_line['file'].split(' -> ')[0].strip('\u2018').rstrip('\u2019')
|
||||
output_line['file'] = filename
|
||||
# line #1
|
||||
if line.find('File:') == 2:
|
||||
output_line = {}
|
||||
line_list = line.split(maxsplit=1)
|
||||
output_line['file'] = line_list[1]
|
||||
|
||||
continue
|
||||
# populate link_to field if -> found
|
||||
if ' -> ' in output_line['file']:
|
||||
filename = output_line['file'].split(' -> ')[0].strip('\u2018').rstrip('\u2019')
|
||||
link = output_line['file'].split(' -> ')[1].strip('\u2018').rstrip('\u2019')
|
||||
output_line['file'] = filename
|
||||
output_line['link_to'] = link
|
||||
else:
|
||||
filename = output_line['file'].split(' -> ')[0].strip('\u2018').rstrip('\u2019')
|
||||
output_line['file'] = filename
|
||||
|
||||
# line #2
|
||||
if line.find('Size:') == 2:
|
||||
line_list = line.split(maxsplit=7)
|
||||
output_line['size'] = line_list[1]
|
||||
output_line['blocks'] = line_list[3]
|
||||
output_line['io_blocks'] = line_list[6]
|
||||
output_line['type'] = line_list[7]
|
||||
continue
|
||||
continue
|
||||
|
||||
# line #3
|
||||
if line.find('Device:') == 0:
|
||||
line_list = line.split()
|
||||
output_line['device'] = line_list[1]
|
||||
output_line['inode'] = line_list[3]
|
||||
output_line['links'] = line_list[5]
|
||||
continue
|
||||
# line #2
|
||||
if line.find('Size:') == 2:
|
||||
line_list = line.split(maxsplit=7)
|
||||
output_line['size'] = line_list[1]
|
||||
output_line['blocks'] = line_list[3]
|
||||
output_line['io_blocks'] = line_list[6]
|
||||
output_line['type'] = line_list[7]
|
||||
continue
|
||||
|
||||
# line #4
|
||||
if line.find('Access: (') == 0:
|
||||
line = line.replace('(', ' ').replace(')', ' ').replace('/', ' ')
|
||||
line_list = line.split()
|
||||
output_line['access'] = line_list[1]
|
||||
output_line['flags'] = line_list[2]
|
||||
output_line['uid'] = line_list[4]
|
||||
output_line['user'] = line_list[5]
|
||||
output_line['gid'] = line_list[7]
|
||||
output_line['group'] = line_list[8]
|
||||
continue
|
||||
# line #3
|
||||
if line.startswith('Device:'):
|
||||
line_list = line.split()
|
||||
output_line['device'] = line_list[1]
|
||||
output_line['inode'] = line_list[3]
|
||||
output_line['links'] = line_list[5]
|
||||
continue
|
||||
|
||||
# line #5
|
||||
if line.find('Access: 2') == 0:
|
||||
line_list = line.split(maxsplit=1)
|
||||
output_line['access_time'] = line_list[1]
|
||||
continue
|
||||
# line #4
|
||||
if line.startswith('Access: ('):
|
||||
line = line.replace('(', ' ').replace(')', ' ').replace('/', ' ')
|
||||
line_list = line.split()
|
||||
output_line['access'] = line_list[1]
|
||||
output_line['flags'] = line_list[2]
|
||||
output_line['uid'] = line_list[4]
|
||||
output_line['user'] = line_list[5]
|
||||
output_line['gid'] = line_list[7]
|
||||
output_line['group'] = line_list[8]
|
||||
continue
|
||||
|
||||
# line #6
|
||||
if line.find('Modify:') == 0:
|
||||
line_list = line.split(maxsplit=1)
|
||||
output_line['modify_time'] = line_list[1]
|
||||
continue
|
||||
# line #5
|
||||
if line.startswith('Access: 2'):
|
||||
line_list = line.split(maxsplit=1)
|
||||
output_line['access_time'] = line_list[1]
|
||||
continue
|
||||
|
||||
# line #7
|
||||
if line.find('Change:') == 0:
|
||||
line_list = line.split(maxsplit=1)
|
||||
output_line['change_time'] = line_list[1]
|
||||
continue
|
||||
# line #6
|
||||
if line.startswith('Modify:'):
|
||||
line_list = line.split(maxsplit=1)
|
||||
output_line['modify_time'] = line_list[1]
|
||||
continue
|
||||
|
||||
# line #8
|
||||
if line.find('Birth:') == 1:
|
||||
line_list = line.split(maxsplit=1)
|
||||
output_line['birth_time'] = line_list[1]
|
||||
# line #7
|
||||
if line.startswith('Change:'):
|
||||
line_list = line.split(maxsplit=1)
|
||||
output_line['change_time'] = line_list[1]
|
||||
continue
|
||||
|
||||
# line #8
|
||||
if line.find('Birth:') == 1:
|
||||
line_list = line.split(maxsplit=1)
|
||||
output_line['birth_time'] = line_list[1]
|
||||
|
||||
raw_output.append(output_line)
|
||||
continue
|
||||
|
||||
# OSX output
|
||||
else:
|
||||
for line in cleandata:
|
||||
value = shlex.split(line)
|
||||
output_line = {
|
||||
'file': value[15],
|
||||
'device': value[0],
|
||||
'inode': value[1],
|
||||
'flags': value[2],
|
||||
'links': value[3],
|
||||
'user': value[4],
|
||||
'group': value[5],
|
||||
'rdev': value[6],
|
||||
'size': value[7],
|
||||
'access_time': value[8],
|
||||
'modify_time': value[9],
|
||||
'change_time': value[10],
|
||||
'birth_time': value[11],
|
||||
'block_size': value[12],
|
||||
'blocks': value[13],
|
||||
'osx_flags': value[14]
|
||||
}
|
||||
|
||||
raw_output.append(output_line)
|
||||
continue
|
||||
|
||||
if raw:
|
||||
return raw_output
|
||||
|
||||
@@ -40,7 +40,7 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
description = 'systemctl command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -110,7 +110,7 @@ def parse(data, raw=False, quiet=False):
|
||||
raw_output = []
|
||||
|
||||
for entry in cleandata[1:]:
|
||||
if entry.find('LOAD = ') != -1:
|
||||
if 'LOAD = ' in entry:
|
||||
break
|
||||
|
||||
else:
|
||||
|
||||
@@ -59,7 +59,7 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
description = 'systemctl list-jobs command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -137,7 +137,7 @@ def parse(data, raw=False, quiet=False):
|
||||
raw_output = []
|
||||
|
||||
for entry in cleandata[1:]:
|
||||
if entry.find('No jobs running.') != -1 or entry.find('jobs listed.') != -1:
|
||||
if 'No jobs running.' in entry or 'jobs listed.' in entry:
|
||||
break
|
||||
|
||||
else:
|
||||
|
||||
@@ -34,7 +34,7 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
description = 'systemctl list-sockets command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -102,7 +102,7 @@ def parse(data, raw=False, quiet=False):
|
||||
raw_output = []
|
||||
|
||||
for entry in cleandata[1:]:
|
||||
if entry.find('sockets listed.') != -1:
|
||||
if 'sockets listed.' in entry:
|
||||
break
|
||||
|
||||
else:
|
||||
|
||||
@@ -31,7 +31,7 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
description = 'systemctl list-unit-files command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -99,7 +99,7 @@ def parse(data, raw=False, quiet=False):
|
||||
raw_output = []
|
||||
|
||||
for entry in cleandata[1:]:
|
||||
if entry.find('unit files listed.') != -1:
|
||||
if 'unit files listed.' in entry:
|
||||
break
|
||||
|
||||
else:
|
||||
|
||||
122
jc/parsers/timedatectl.py
Normal file
122
jc/parsers/timedatectl.py
Normal file
@@ -0,0 +1,122 @@
|
||||
"""jc - JSON CLI output utility timedatectl Parser
|
||||
|
||||
Usage:
|
||||
|
||||
specify --timedatectl as the first argument if the piped input is coming from timedatectl or timedatectl status
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux'
|
||||
|
||||
Examples:
|
||||
|
||||
$ timedatectl | jc --timedatectl -p
|
||||
{
|
||||
"local_time": "Tue 2020-03-10 17:53:21 PDT",
|
||||
"universal_time": "Wed 2020-03-11 00:53:21 UTC",
|
||||
"rtc_time": "Wed 2020-03-11 00:53:21",
|
||||
"time_zone": "America/Los_Angeles (PDT, -0700)",
|
||||
"ntp_enabled": true,
|
||||
"ntp_synchronized": true,
|
||||
"rtc_in_local_tz": false,
|
||||
"dst_active": true
|
||||
}
|
||||
|
||||
$ timedatectl | jc --timedatectl -p -r
|
||||
{
|
||||
"local_time": "Tue 2020-03-10 17:53:21 PDT",
|
||||
"universal_time": "Wed 2020-03-11 00:53:21 UTC",
|
||||
"rtc_time": "Wed 2020-03-11 00:53:21",
|
||||
"time_zone": "America/Los_Angeles (PDT, -0700)",
|
||||
"ntp_enabled": "yes",
|
||||
"ntp_synchronized": "yes",
|
||||
"rtc_in_local_tz": "no",
|
||||
"dst_active": "yes"
|
||||
}
|
||||
"""
|
||||
import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
description = 'timedatectl status command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
# details = 'enter any other details here'
|
||||
|
||||
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
|
||||
compatible = ['linux']
|
||||
magic_commands = ['timedatectl', 'timedatectl status']
|
||||
|
||||
|
||||
__version__ = info.version
|
||||
|
||||
|
||||
def process(proc_data):
|
||||
"""
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Structured data with the following schema:
|
||||
|
||||
{
|
||||
"local_time": string,
|
||||
"universal_time": string,
|
||||
"rtc_time": string,
|
||||
"time_zone": string,
|
||||
"ntp_enabled": boolean,
|
||||
"ntp_synchronized": boolean,
|
||||
"system_clock_synchronized": boolean,
|
||||
"systemd-timesyncd.service_active": boolean,
|
||||
"rtc_in_local_tz": boolean,
|
||||
"dst_active": boolean
|
||||
}
|
||||
"""
|
||||
# boolean changes
|
||||
bool_list = ['ntp_enabled', 'ntp_synchronized', 'rtc_in_local_tz', 'dst_active',
|
||||
'system_clock_synchronized', 'systemd-timesyncd.service_active']
|
||||
for key in proc_data:
|
||||
if key in bool_list:
|
||||
try:
|
||||
proc_data[key] = True if proc_data[key] == 'yes' else False
|
||||
except (ValueError):
|
||||
proc_data[key] = None
|
||||
|
||||
return proc_data
|
||||
|
||||
|
||||
def parse(data, raw=False, quiet=False):
|
||||
"""
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) output preprocessed JSON if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
"""
|
||||
if not quiet:
|
||||
jc.utils.compatibility(__name__, info.compatible)
|
||||
|
||||
raw_output = {}
|
||||
|
||||
for line in filter(None, data.splitlines()):
|
||||
linedata = line.split(':', maxsplit=1)
|
||||
raw_output[linedata[0].strip().lower().replace(' ', '_')] = linedata[1].strip()
|
||||
|
||||
if linedata[0].strip() == 'DST active':
|
||||
break
|
||||
|
||||
if raw:
|
||||
return raw_output
|
||||
else:
|
||||
return process(raw_output)
|
||||
@@ -1,3 +1,3 @@
|
||||
ifconfig-parser>=0.0.5
|
||||
ruamel.yaml>=0.15.0
|
||||
xmltodict>=0.12.0
|
||||
Pygments>=2.4.2
|
||||
|
||||
11
setup.py
11
setup.py
@@ -5,22 +5,21 @@ with open('README.md', 'r') as f:
|
||||
|
||||
setuptools.setup(
|
||||
name='jc',
|
||||
version='1.8.1',
|
||||
version='1.11.1',
|
||||
author='Kelly Brazil',
|
||||
author_email='kellyjonbrazil@gmail.com',
|
||||
description='This tool serializes the output of popular command line tools and filetypes to structured JSON output.',
|
||||
description='Converts the output of popular command-line tools and file-types to JSON.',
|
||||
install_requires=[
|
||||
'ifconfig-parser>=0.0.5',
|
||||
'ruamel.yaml>=0.15.0',
|
||||
'xmltodict>=0.12.0'
|
||||
'xmltodict>=0.12.0',
|
||||
'Pygments>=2.4.2'
|
||||
],
|
||||
license='MIT',
|
||||
long_description=long_description,
|
||||
long_description_content_type='text/markdown',
|
||||
python_requires='>=3.6',
|
||||
url='https://github.com/kellyjonbrazil/jc',
|
||||
packages=setuptools.find_packages(),
|
||||
include_package_data=True,
|
||||
packages=setuptools.find_packages(exclude=['*.tests', '*.tests.*', 'tests.*', 'tests']),
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'jc=jc.cli:main'
|
||||
|
||||
1
tests/fixtures/centos-7.7/dig-axfr.json
vendored
Normal file
1
tests/fixtures/centos-7.7/dig-axfr.json
vendored
Normal file
File diff suppressed because one or more lines are too long
60
tests/fixtures/centos-7.7/dig-axfr.out
vendored
Normal file
60
tests/fixtures/centos-7.7/dig-axfr.out
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
|
||||
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-9.P2.el7 <<>> @81.4.108.41 AXFR zonetransfer.me +nocookie
|
||||
; (1 server found)
|
||||
;; global options: +cmd
|
||||
zonetransfer.me. 7200 IN SOA nsztm1.digi.ninja. robin.digi.ninja. 2019100801 172800 900 1209600 3600
|
||||
zonetransfer.me. 300 IN HINFO "Casio fx-700G" "Windows XP"
|
||||
zonetransfer.me. 301 IN TXT "google-site-verification=tyP28J7JAUHA9fw2sHXMgcCC0I6XBmmoVi04VlMewxA"
|
||||
zonetransfer.me. 7200 IN MX 0 ASPMX.L.GOOGLE.COM.
|
||||
zonetransfer.me. 7200 IN MX 10 ALT1.ASPMX.L.GOOGLE.COM.
|
||||
zonetransfer.me. 7200 IN MX 10 ALT2.ASPMX.L.GOOGLE.COM.
|
||||
zonetransfer.me. 7200 IN MX 20 ASPMX2.GOOGLEMAIL.COM.
|
||||
zonetransfer.me. 7200 IN MX 20 ASPMX3.GOOGLEMAIL.COM.
|
||||
zonetransfer.me. 7200 IN MX 20 ASPMX4.GOOGLEMAIL.COM.
|
||||
zonetransfer.me. 7200 IN MX 20 ASPMX5.GOOGLEMAIL.COM.
|
||||
zonetransfer.me. 7200 IN A 5.196.105.14
|
||||
zonetransfer.me. 7200 IN NS nsztm1.digi.ninja.
|
||||
zonetransfer.me. 7200 IN NS nsztm2.digi.ninja.
|
||||
_acme-challenge.zonetransfer.me. 301 IN TXT "6Oa05hbUJ9xSsvYy7pApQvwCUSSGgxvrbdizjePEsZI"
|
||||
_sip._tcp.zonetransfer.me. 14000 IN SRV 0 0 5060 www.zonetransfer.me.
|
||||
14.105.196.5.IN-ADDR.ARPA.zonetransfer.me. 7200 IN PTR www.zonetransfer.me.
|
||||
asfdbauthdns.zonetransfer.me. 7900 IN AFSDB 1 asfdbbox.zonetransfer.me.
|
||||
asfdbbox.zonetransfer.me. 7200 IN A 127.0.0.1
|
||||
asfdbvolume.zonetransfer.me. 7800 IN AFSDB 1 asfdbbox.zonetransfer.me.
|
||||
canberra-office.zonetransfer.me. 7200 IN A 202.14.81.230
|
||||
cmdexec.zonetransfer.me. 300 IN TXT "; ls"
|
||||
contact.zonetransfer.me. 2592000 IN TXT "Remember to call or email Pippa on +44 123 4567890 or pippa@zonetransfer.me when making DNS changes"
|
||||
dc-office.zonetransfer.me. 7200 IN A 143.228.181.132
|
||||
deadbeef.zonetransfer.me. 7201 IN AAAA dead:beaf::
|
||||
dr.zonetransfer.me. 300 IN LOC 53 20 56.558 N 1 38 33.526 W 0.00m 1m 10000m 10m
|
||||
DZC.zonetransfer.me. 7200 IN TXT "AbCdEfG"
|
||||
email.zonetransfer.me. 2222 IN NAPTR 1 1 "P" "E2U+email" "" email.zonetransfer.me.zonetransfer.me.
|
||||
email.zonetransfer.me. 7200 IN A 74.125.206.26
|
||||
Hello.zonetransfer.me. 7200 IN TXT "Hi to Josh and all his class"
|
||||
home.zonetransfer.me. 7200 IN A 127.0.0.1
|
||||
Info.zonetransfer.me. 7200 IN TXT "ZoneTransfer.me service provided by Robin Wood - robin@digi.ninja. See http://digi.ninja/projects/zonetransferme.php for more information."
|
||||
internal.zonetransfer.me. 300 IN NS intns1.zonetransfer.me.
|
||||
internal.zonetransfer.me. 300 IN NS intns2.zonetransfer.me.
|
||||
intns1.zonetransfer.me. 300 IN A 81.4.108.41
|
||||
intns2.zonetransfer.me. 300 IN A 167.88.42.94
|
||||
office.zonetransfer.me. 7200 IN A 4.23.39.254
|
||||
ipv6actnow.org.zonetransfer.me. 7200 IN AAAA 2001:67c:2e8:11::c100:1332
|
||||
owa.zonetransfer.me. 7200 IN A 207.46.197.32
|
||||
robinwood.zonetransfer.me. 302 IN TXT "Robin Wood"
|
||||
rp.zonetransfer.me. 321 IN RP robin.zonetransfer.me. robinwood.zonetransfer.me.
|
||||
sip.zonetransfer.me. 3333 IN NAPTR 2 3 "P" "E2U+sip" "!^.*$!sip:customer-service@zonetransfer.me!" .
|
||||
sqli.zonetransfer.me. 300 IN TXT "' or 1=1 --"
|
||||
sshock.zonetransfer.me. 7200 IN TXT "() { :]}; echo ShellShocked"
|
||||
staging.zonetransfer.me. 7200 IN CNAME www.sydneyoperahouse.com.
|
||||
alltcpportsopen.firewall.test.zonetransfer.me. 301 IN A 127.0.0.1
|
||||
testing.zonetransfer.me. 301 IN CNAME www.zonetransfer.me.
|
||||
vpn.zonetransfer.me. 4000 IN A 174.36.59.154
|
||||
www.zonetransfer.me. 7200 IN A 5.196.105.14
|
||||
xss.zonetransfer.me. 300 IN TXT "'><script>alert('Boo')</script>"
|
||||
zonetransfer.me. 7200 IN SOA nsztm1.digi.ninja. robin.digi.ninja. 2019100801 172800 900 1209600 3600
|
||||
;; Query time: 182 msec
|
||||
;; SERVER: 81.4.108.41#53(81.4.108.41)
|
||||
;; WHEN: Wed Mar 25 20:01:47 PDT 2020
|
||||
;; XFR size: 50 records (messages 1, bytes 1994)
|
||||
|
||||
|
||||
1
tests/fixtures/centos-7.7/dmidecode.json
vendored
Normal file
1
tests/fixtures/centos-7.7/dmidecode.json
vendored
Normal file
File diff suppressed because one or more lines are too long
11810
tests/fixtures/centos-7.7/dmidecode.out
vendored
Normal file
11810
tests/fixtures/centos-7.7/dmidecode.out
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
tests/fixtures/centos-7.7/file.json
vendored
Normal file
1
tests/fixtures/centos-7.7/file.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[{"filename": "bin", "type": "directory"}, {"filename": "digout", "type": "ASCII text"}, {"filename": "file with spaces in the name", "type": "empty"}, {"filename": "git", "type": "directory"}, {"filename": "id-centos.out", "type": "ASCII text"}, {"filename": "ifcfg.json", "type": "ASCII text, with very long lines"}, {"filename": "ifconfig.out", "type": "ASCII text"}, {"filename": "iptables-tests", "type": "directory"}, {"filename": "journaljson", "type": "ASCII text, with very long lines"}, {"filename": "jp", "type": "ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped"}, {"filename": "jp_1.1.12_linux_x86_64.zip", "type": "Zip archive data, at least v2.0 to extract"}, {"filename": "lastb.out", "type": "ASCII text"}, {"filename": "lsblk-cols", "type": "UTF-8 Unicode text"}, {"filename": "psfile.txt", "type": "ASCII text, with very long lines"}, {"filename": "resizeterm.sh", "type": "Bourne-Again shell script, ASCII text executable"}, {"filename": "routeout", "type": "ASCII text"}, {"filename": "ss-aeep.out", "type": "ASCII text"}, {"filename": "ssout", "type": "ASCII text"}, {"filename": "systemctl.out", "type": "UTF-8 Unicode text"}, {"filename": "testfiles", "type": "directory"}, {"filename": "tmp", "type": "directory"}, {"filename": "top.out", "type": "ASCII text, with escape sequences"}, {"filename": "who-aH.out", "type": "ASCII text"}, {"filename": "who.out", "type": "ASCII text"}, {"filename": "whotext", "type": "ASCII text"}]
|
||||
25
tests/fixtures/centos-7.7/file.out
vendored
Normal file
25
tests/fixtures/centos-7.7/file.out
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
bin: directory
|
||||
digout: ASCII text
|
||||
file with spaces in the name: empty
|
||||
git: directory
|
||||
id-centos.out: ASCII text
|
||||
ifcfg.json: ASCII text, with very long lines
|
||||
ifconfig.out: ASCII text
|
||||
iptables-tests: directory
|
||||
journaljson: ASCII text, with very long lines
|
||||
jp: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
|
||||
jp_1.1.12_linux_x86_64.zip: Zip archive data, at least v2.0 to extract
|
||||
lastb.out: ASCII text
|
||||
lsblk-cols: UTF-8 Unicode text
|
||||
psfile.txt: ASCII text, with very long lines
|
||||
resizeterm.sh: Bourne-Again shell script, ASCII text executable
|
||||
routeout: ASCII text
|
||||
ss-aeep.out: ASCII text
|
||||
ssout: ASCII text
|
||||
systemctl.out: UTF-8 Unicode text
|
||||
testfiles: directory
|
||||
tmp: directory
|
||||
top.out: ASCII text, with escape sequences
|
||||
who-aH.out: ASCII text
|
||||
who.out: ASCII text
|
||||
whotext: ASCII text
|
||||
2
tests/fixtures/centos-7.7/ls-R-newlines.json
vendored
2
tests/fixtures/centos-7.7/ls-R-newlines.json
vendored
@@ -1 +1 @@
|
||||
[{"filename": "systemd-private-016de60725a3426792b93fc9f120b8f0-chronyd.service-oZqq4u", "parent": "."}, {"filename": "systemd-private-a30a5a178daa4042b42dfaf5ff9e5f68-chronyd.service-a1tpxv", "parent": "."}, {"filename": "systemd-private-af69d7360f3e40cfa947358c0fb5a6f8-chronyd.service-T3MQ4j", "parent": "."}, {"filename": "tmp.CvALl2jE6u", "parent": "."}, {"filename": "tmp.e7AlxSxY5a", "parent": "."}, {"filename": "tmp.uXm9yegjwj", "parent": "."}, {"filename": "a regular filename", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "a combination", "parent": "./lstest"}, {"filename": "of everything", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "a newline inside", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "four contiguous newlines inside", "parent": "./lstest"}, {"filename": "this file", "parent": "./lstest"}, {"filename": "has", "parent": "./lstest"}, {"filename": "six", "parent": "./lstest"}, {"filename": "newlines", "parent": "./lstest"}, {"filename": "within", "parent": "./lstest"}, {"filename": "this file starts with four newlines", "parent": "./lstest"}, {"filename": "this file starts with one newline", "parent": "./lstest"}]
|
||||
[{"filename": "lstest", "parent": "."}, {"filename": "systemd-private-016de60725a3426792b93fc9f120b8f0-chronyd.service-oZqq4u", "parent": "."}, {"filename": "systemd-private-a30a5a178daa4042b42dfaf5ff9e5f68-chronyd.service-a1tpxv", "parent": "."}, {"filename": "systemd-private-af69d7360f3e40cfa947358c0fb5a6f8-chronyd.service-T3MQ4j", "parent": "."}, {"filename": "tmp.CvALl2jE6u", "parent": "."}, {"filename": "tmp.e7AlxSxY5a", "parent": "."}, {"filename": "tmp.uXm9yegjwj", "parent": "."}, {"filename": "a regular filename", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "a combination", "parent": "./lstest"}, {"filename": "of everything", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "a newline inside", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "four contiguous newlines inside", "parent": "./lstest"}, {"filename": "this file", "parent": "./lstest"}, {"filename": "has", "parent": "./lstest"}, {"filename": "six", "parent": "./lstest"}, {"filename": "newlines", "parent": "./lstest"}, {"filename": "within", "parent": "./lstest"}, {"filename": "this file starts with four newlines", "parent": "./lstest"}, {"filename": "this file starts with one newline", "parent": "./lstest"}]
|
||||
|
||||
2
tests/fixtures/centos-7.7/ls-R.json
vendored
2
tests/fixtures/centos-7.7/ls-R.json
vendored
File diff suppressed because one or more lines are too long
2
tests/fixtures/centos-7.7/ls-glob.json
vendored
2
tests/fixtures/centos-7.7/ls-glob.json
vendored
File diff suppressed because one or more lines are too long
1
tests/fixtures/centos-7.7/netstat-i.json
vendored
Normal file
1
tests/fixtures/centos-7.7/netstat-i.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[{"iface": "docker0", "mtu": 1500, "rx_ok": 0, "rx_err": 0, "rx_drp": 0, "rx_ovr": 0, "tx_ok": 0, "tx_err": 0, "tx_drp": 0, "tx_ovr": 0, "flg": "BMU", "kind": "interface"}, {"iface": "ens33", "mtu": 1500, "rx_ok": 476, "rx_err": 0, "rx_drp": 0, "rx_ovr": 0, "tx_ok": 312, "tx_err": 0, "tx_drp": 0, "tx_ovr": 0, "flg": "BMRU", "kind": "interface"}, {"iface": "lo", "mtu": 65536, "rx_ok": 0, "rx_err": 0, "rx_drp": 0, "rx_ovr": 0, "tx_ok": 0, "tx_err": 0, "tx_drp": 0, "tx_ovr": 0, "flg": "LRU", "kind": "interface"}]
|
||||
5
tests/fixtures/centos-7.7/netstat-i.out
vendored
Normal file
5
tests/fixtures/centos-7.7/netstat-i.out
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
Kernel Interface table
|
||||
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
|
||||
docker0 1500 0 0 0 0 0 0 0 0 BMU
|
||||
ens33 1500 476 0 0 0 312 0 0 0 BMRU
|
||||
lo 65536 0 0 0 0 0 0 0 0 LRU
|
||||
1
tests/fixtures/centos-7.7/netstat-r.json
vendored
Normal file
1
tests/fixtures/centos-7.7/netstat-r.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[{"destination": "default", "gateway": "gateway", "genmask": "0.0.0.0", "route_flags": "UG", "mss": 0, "window": 0, "irtt": 0, "iface": "ens33", "kind": "route"}, {"destination": "172.17.0.0", "gateway": "0.0.0.0", "genmask": "255.255.0.0", "route_flags": "U", "mss": 0, "window": 0, "irtt": 0, "iface": "docker0", "kind": "route"}, {"destination": "192.168.71.0", "gateway": "0.0.0.0", "genmask": "255.255.255.0", "route_flags": "U", "mss": 0, "window": 0, "irtt": 0, "iface": "ens33", "kind": "route"}]
|
||||
5
tests/fixtures/centos-7.7/netstat-r.out
vendored
Normal file
5
tests/fixtures/centos-7.7/netstat-r.out
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
Kernel IP routing table
|
||||
Destination Gateway Genmask Flags MSS Window irtt Iface
|
||||
default gateway 0.0.0.0 UG 0 0 0 ens33
|
||||
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
|
||||
192.168.71.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33
|
||||
1
tests/fixtures/centos-7.7/netstat-rne.json
vendored
Normal file
1
tests/fixtures/centos-7.7/netstat-rne.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[{"destination": "0.0.0.0", "gateway": "192.168.71.2", "genmask": "0.0.0.0", "route_flags": "UG", "metric": 100, "route_refs": 0, "use": 0, "iface": "ens33", "kind": "route"}, {"destination": "172.17.0.0", "gateway": "0.0.0.0", "genmask": "255.255.0.0", "route_flags": "U", "metric": 0, "route_refs": 0, "use": 0, "iface": "docker0", "kind": "route"}, {"destination": "192.168.71.0", "gateway": "0.0.0.0", "genmask": "255.255.255.0", "route_flags": "U", "metric": 100, "route_refs": 0, "use": 0, "iface": "ens33", "kind": "route"}]
|
||||
5
tests/fixtures/centos-7.7/netstat-rne.out
vendored
Normal file
5
tests/fixtures/centos-7.7/netstat-rne.out
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
Kernel IP routing table
|
||||
Destination Gateway Genmask Flags Metric Ref Use Iface
|
||||
0.0.0.0 192.168.71.2 0.0.0.0 UG 100 0 0 ens33
|
||||
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
|
||||
192.168.71.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33
|
||||
1
tests/fixtures/centos-7.7/netstat-rnee.json
vendored
Normal file
1
tests/fixtures/centos-7.7/netstat-rnee.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[{"destination": "0.0.0.0", "gateway": "192.168.71.2", "genmask": "0.0.0.0", "route_flags": "UG", "metric": 100, "route_refs": 0, "use": 0, "iface": "ens33", "mss": 0, "window": 0, "irtt": 0, "kind": "route"}, {"destination": "172.17.0.0", "gateway": "0.0.0.0", "genmask": "255.255.0.0", "route_flags": "U", "metric": 0, "route_refs": 0, "use": 0, "iface": "docker", "mss": 0, "window": 0, "irtt": 0, "kind": "route"}, {"destination": "192.168.71.0", "gateway": "0.0.0.0", "genmask": "255.255.255.0", "route_flags": "U", "metric": 100, "route_refs": 0, "use": 0, "iface": "ens33", "mss": 0, "window": 0, "irtt": 0, "kind": "route"}]
|
||||
5
tests/fixtures/centos-7.7/netstat-rnee.out
vendored
Normal file
5
tests/fixtures/centos-7.7/netstat-rnee.out
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
Kernel IP routing table
|
||||
Destination Gateway Genmask Flags Metric Ref Use Iface MSS Window irtt
|
||||
0.0.0.0 192.168.71.2 0.0.0.0 UG 100 0 0 ens33 0 0 0
|
||||
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker 0 0 0
|
||||
192.168.71.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33 0 0 0
|
||||
1
tests/fixtures/centos-7.7/ntpq-p.json
vendored
Normal file
1
tests/fixtures/centos-7.7/ntpq-p.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[{"state": null, "remote": "44.190.6.254", "refid": "127.67.113.92", "st": 2, "t": "u", "when": 1, "poll": 64, "reach": 1, "delay": 23.399, "offset": -2.805, "jitter": 2.131}, {"state": null, "remote": "ntp.wdc1.us.lea", "refid": "130.133.1.10", "st": 2, "t": "u", "when": null, "poll": 64, "reach": 1, "delay": 93.053, "offset": -0.807, "jitter": 2.839}, {"state": null, "remote": "clock.team-cymr", "refid": "204.9.54.119", "st": 2, "t": "u", "when": null, "poll": 64, "reach": 1, "delay": 70.337, "offset": -2.909, "jitter": 2.6}, {"state": null, "remote": "mirror1.sjc02.s", "refid": "216.218.254.202", "st": 2, "t": "u", "when": 2, "poll": 64, "reach": 1, "delay": 29.325, "offset": 1.044, "jitter": 4.069}]
|
||||
6
tests/fixtures/centos-7.7/ntpq-p.out
vendored
Normal file
6
tests/fixtures/centos-7.7/ntpq-p.out
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
remote refid st t when poll reach delay offset jitter
|
||||
==============================================================================
|
||||
44.190.6.254 127.67.113.92 2 u 1 64 1 23.399 -2.805 2.131
|
||||
ntp.wdc1.us.lea 130.133.1.10 2 u - 64 1 93.053 -0.807 2.839
|
||||
clock.team-cymr 204.9.54.119 2 u - 64 1 70.337 -2.909 2.600
|
||||
mirror1.sjc02.s 216.218.254.202 2 u 2 64 1 29.325 1.044 4.069
|
||||
1
tests/fixtures/centos-7.7/ntpq-pn.json
vendored
Normal file
1
tests/fixtures/centos-7.7/ntpq-pn.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[{"state": "+", "remote": "44.190.6.254", "refid": "127.67.113.92", "st": 2, "t": "u", "when": 66, "poll": 64, "reach": 377, "delay": 22.69, "offset": -0.392, "jitter": 2.085}, {"state": "-", "remote": "108.59.2.24", "refid": "130.133.1.10", "st": 2, "t": "u", "when": 63, "poll": 64, "reach": 377, "delay": 90.805, "offset": 2.84, "jitter": 1.908}, {"state": "+", "remote": "38.229.71.1", "refid": "204.9.54.119", "st": 2, "t": "u", "when": 64, "poll": 64, "reach": 377, "delay": 68.699, "offset": -0.61, "jitter": 2.576}, {"state": "*", "remote": "72.5.72.15", "refid": "216.218.254.202", "st": 2, "t": "u", "when": 63, "poll": 64, "reach": 377, "delay": 22.654, "offset": 0.231, "jitter": 1.964}]
|
||||
6
tests/fixtures/centos-7.7/ntpq-pn.out
vendored
Normal file
6
tests/fixtures/centos-7.7/ntpq-pn.out
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
remote refid st t when poll reach delay offset jitter
|
||||
==============================================================================
|
||||
+44.190.6.254 127.67.113.92 2 u 66 64 377 22.690 -0.392 2.085
|
||||
-108.59.2.24 130.133.1.10 2 u 63 64 377 90.805 2.840 1.908
|
||||
+38.229.71.1 204.9.54.119 2 u 64 64 377 68.699 -0.610 2.576
|
||||
*72.5.72.15 216.218.254.202 2 u 63 64 377 22.654 0.231 1.964
|
||||
1
tests/fixtures/centos-7.7/timedatectl.json
vendored
Normal file
1
tests/fixtures/centos-7.7/timedatectl.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"local_time": "Tue 2020-03-10 17:53:21 PDT", "universal_time": "Wed 2020-03-11 00:53:21 UTC", "rtc_time": "Wed 2020-03-11 00:53:21", "time_zone": "America/Los_Angeles (PDT, -0700)", "ntp_enabled": true, "ntp_synchronized": true, "rtc_in_local_tz": false, "dst_active": true}
|
||||
14
tests/fixtures/centos-7.7/timedatectl.out
vendored
Normal file
14
tests/fixtures/centos-7.7/timedatectl.out
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
Local time: Tue 2020-03-10 17:53:21 PDT
|
||||
Universal time: Wed 2020-03-11 00:53:21 UTC
|
||||
RTC time: Wed 2020-03-11 00:53:21
|
||||
Time zone: America/Los_Angeles (PDT, -0700)
|
||||
NTP enabled: yes
|
||||
NTP synchronized: yes
|
||||
RTC in local TZ: no
|
||||
DST active: yes
|
||||
Last DST change: DST began at
|
||||
Sun 2020-03-08 01:59:59 PST
|
||||
Sun 2020-03-08 03:00:00 PDT
|
||||
Next DST change: DST ends (the clock jumps one hour backwards) at
|
||||
Sun 2020-11-01 01:59:59 PDT
|
||||
Sun 2020-11-01 01:00:00 PST
|
||||
1
tests/fixtures/fedora32/dmidecode.json
vendored
Normal file
1
tests/fixtures/fedora32/dmidecode.json
vendored
Normal file
File diff suppressed because one or more lines are too long
11810
tests/fixtures/fedora32/dmidecode.out
vendored
Normal file
11810
tests/fixtures/fedora32/dmidecode.out
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
tests/fixtures/fedora32/last.json
vendored
Normal file
1
tests/fixtures/fedora32/last.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[{"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Fri May 1 15:25", "logout": "gone - no logout"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Fri May 1 15:24", "logout": "gone - no logout"}, {"user": "reboot", "tty": "system boot", "hostname": "5.6.6-300.fc32.x", "login": "Fri May 1 15:24", "logout": "running"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Thu Apr 30 15:27", "logout": "15:22", "duration": "23:55"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Thu Apr 30 15:25", "logout": "down", "duration": "23:57"}, {"user": "reboot", "tty": "system boot", "hostname": "5.6.6-300.fc32.x", "login": "Thu Apr 30 15:22", "logout": "15:22", "duration": "1+00:00"}]
|
||||
8
tests/fixtures/fedora32/last.out
vendored
Normal file
8
tests/fixtures/fedora32/last.out
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
kbrazil pts/0 192.168.71.1 Fri May 1 15:25 gone - no logout
|
||||
kbrazil tty1 Fri May 1 15:24 gone - no logout
|
||||
reboot system boot 5.6.6-300.fc32.x Fri May 1 15:24 still running
|
||||
kbrazil pts/0 192.168.71.1 Thu Apr 30 15:27 - 15:22 (23:55)
|
||||
kbrazil tty1 Thu Apr 30 15:25 - down (23:57)
|
||||
reboot system boot 5.6.6-300.fc32.x Thu Apr 30 15:22 - 15:22 (1+00:00)
|
||||
|
||||
wtmp begins Thu Apr 30 15:22:02 2020
|
||||
1
tests/fixtures/fedora32/netstat.json
vendored
Normal file
1
tests/fixtures/fedora32/netstat.json
vendored
Normal file
File diff suppressed because one or more lines are too long
139
tests/fixtures/fedora32/netstat.out
vendored
Normal file
139
tests/fixtures/fedora32/netstat.out
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
Active Internet connections (w/o servers)
|
||||
Proto Recv-Q Send-Q Local Address Foreign Address State
|
||||
tcp 0 0 localhost.localdoma:ssh 192.168.71.1:52882 ESTABLISHED
|
||||
udp 0 0 localhost.locald:bootpc 192.168.71.254:bootps ESTABLISHED
|
||||
Active UNIX domain sockets (w/o servers)
|
||||
Proto RefCnt Flags Type State I-Node Path
|
||||
unix 2 [ ] DGRAM 36371 /run/user/1000/systemd/notify
|
||||
unix 3 [ ] DGRAM 15453 /run/systemd/notify
|
||||
unix 9 [ ] DGRAM 15471 /run/systemd/journal/dev-log
|
||||
unix 2 [ ] DGRAM 165956 @userdb-9bf8f59ca8f2bcce47a377edbaf8985d
|
||||
unix 12 [ ] DGRAM 15479 /run/systemd/journal/socket
|
||||
unix 2 [ ] DGRAM 29064 /var/run/chrony/chronyd.sock
|
||||
unix 2 [ ] DGRAM 165866 @userdb-3f208fa7c8c6d98822a696ee7ca5e3ad
|
||||
unix 2 [ ] DGRAM 165863 @userdb-da253950013f5ea3bc51a4049480d04e
|
||||
unix 2 [ ] DGRAM 165865
|
||||
unix 3 [ ] STREAM CONNECTED 36476
|
||||
unix 3 [ ] STREAM CONNECTED 31389
|
||||
unix 3 [ ] STREAM CONNECTED 30999 /var/lib/sss/pipes/private/sbus-dp_implicit_files.692
|
||||
unix 3 [ ] STREAM CONNECTED 33770 /run/dbus/system_bus_socket
|
||||
unix 3 [ ] STREAM CONNECTED 30731
|
||||
unix 2 [ ] DGRAM 24653
|
||||
unix 3 [ ] STREAM CONNECTED 31370 /var/lib/sss/pipes/private/sbus-dp_implicit_files.692
|
||||
unix 2 [ ] DGRAM 165862
|
||||
unix 2 [ ] DGRAM 33725
|
||||
unix 3 [ ] STREAM CONNECTED 33885
|
||||
unix 3 [ ] STREAM CONNECTED 31173
|
||||
unix 3 [ ] STREAM CONNECTED 31019
|
||||
unix 3 [ ] STREAM CONNECTED 33886
|
||||
unix 3 [ ] STREAM CONNECTED 30735 /var/lib/sss/pipes/private/sbus-monitor
|
||||
unix 3 [ ] STREAM CONNECTED 166231
|
||||
unix 2 [ ] DGRAM 30987
|
||||
unix 2 [ ] DGRAM 24745
|
||||
unix 2 [ ] DGRAM 165955
|
||||
unix 2 [ ] DGRAM 30575
|
||||
unix 3 [ ] STREAM CONNECTED 31062 /run/dbus/system_bus_socket
|
||||
unix 2 [ ] STREAM CONNECTED 35419
|
||||
unix 3 [ ] STREAM CONNECTED 31399 /run/dbus/system_bus_socket
|
||||
unix 2 [ ] DGRAM 32430
|
||||
unix 2 [ ] DGRAM 29403
|
||||
unix 3 [ ] STREAM CONNECTED 166232 /var/lib/sss/pipes/nss
|
||||
unix 2 [ ] DGRAM 31127
|
||||
unix 2 [ ] DGRAM 29538
|
||||
unix 2 [ ] STREAM CONNECTED 33876
|
||||
unix 3 [ ] STREAM CONNECTED 31020 /var/lib/sss/pipes/private/sbus-monitor
|
||||
unix 3 [ ] STREAM CONNECTED 30998
|
||||
unix 3 [ ] STREAM CONNECTED 36475
|
||||
unix 2 [ ] DGRAM 36002
|
||||
unix 3 [ ] STREAM CONNECTED 33769
|
||||
unix 3 [ ] STREAM CONNECTED 31390 /var/lib/sss/pipes/private/sbus-monitor
|
||||
unix 2 [ ] STREAM CONNECTED 33132
|
||||
unix 3 [ ] STREAM CONNECTED 31398
|
||||
unix 3 [ ] STREAM CONNECTED 30022
|
||||
unix 3 [ ] DGRAM 24748
|
||||
unix 3 [ ] DGRAM 24747
|
||||
unix 2 [ ] DGRAM 36348
|
||||
unix 2 [ ] DGRAM 32085
|
||||
unix 3 [ ] STREAM CONNECTED 31168 /run/systemd/journal/stdout
|
||||
unix 3 [ ] DGRAM 15455
|
||||
unix 3 [ ] STREAM CONNECTED 30830
|
||||
unix 3 [ ] STREAM CONNECTED 26911
|
||||
unix 3 [ ] STREAM CONNECTED 35960
|
||||
unix 2 [ ] DGRAM 24662
|
||||
unix 2 [ ] STREAM CONNECTED 36345
|
||||
unix 3 [ ] STREAM CONNECTED 32538
|
||||
unix 3 [ ] STREAM CONNECTED 28747
|
||||
unix 3 [ ] STREAM CONNECTED 31026
|
||||
unix 3 [ ] DGRAM 28615
|
||||
unix 3 [ ] STREAM CONNECTED 31713 /run/dbus/system_bus_socket
|
||||
unix 3 [ ] STREAM CONNECTED 31167
|
||||
unix 3 [ ] STREAM CONNECTED 35989 /run/systemd/journal/stdout
|
||||
unix 3 [ ] STREAM CONNECTED 36303 /run/systemd/journal/stdout
|
||||
unix 3 [ ] STREAM CONNECTED 31809 /run/systemd/journal/stdout
|
||||
unix 3 [ ] STREAM CONNECTED 29396 /run/systemd/journal/stdout
|
||||
unix 2 [ ] STREAM CONNECTED 34911
|
||||
unix 3 [ ] DGRAM 36374
|
||||
unix 2 [ ] STREAM CONNECTED 32241
|
||||
unix 3 [ ] STREAM CONNECTED 32057 /run/dbus/system_bus_socket
|
||||
unix 3 [ ] STREAM CONNECTED 32000 /run/systemd/journal/stdout
|
||||
unix 2 [ ] DGRAM 33083
|
||||
unix 3 [ ] STREAM CONNECTED 31017
|
||||
unix 3 [ ] DGRAM 36373
|
||||
unix 3 [ ] STREAM CONNECTED 34101
|
||||
unix 3 [ ] STREAM CONNECTED 32539 /run/systemd/journal/stdout
|
||||
unix 3 [ ] STREAM CONNECTED 26914
|
||||
unix 3 [ ] STREAM CONNECTED 29395
|
||||
unix 3 [ ] STREAM CONNECTED 31022
|
||||
unix 3 [ ] DGRAM 15456
|
||||
unix 3 [ ] STREAM CONNECTED 29251 /run/systemd/journal/stdout
|
||||
unix 3 [ ] STREAM CONNECTED 26915
|
||||
unix 2 [ ] STREAM CONNECTED 33052
|
||||
unix 3 [ ] STREAM CONNECTED 31999
|
||||
unix 2 [ ] DGRAM 29496
|
||||
unix 3 [ ] STREAM CONNECTED 28400
|
||||
unix 3 [ ] STREAM CONNECTED 36378 /run/dbus/system_bus_socket
|
||||
unix 3 [ ] STREAM CONNECTED 31808
|
||||
unix 3 [ ] STREAM CONNECTED 29250
|
||||
unix 3 [ ] STREAM CONNECTED 24582
|
||||
unix 3 [ ] STREAM CONNECTED 32056
|
||||
unix 3 [ ] STREAM CONNECTED 31347
|
||||
unix 3 [ ] STREAM CONNECTED 28678 /run/systemd/journal/stdout
|
||||
unix 2 [ ] DGRAM 30980
|
||||
unix 3 [ ] STREAM CONNECTED 31348 /run/systemd/journal/stdout
|
||||
unix 3 [ ] STREAM CONNECTED 28677
|
||||
unix 3 [ ] STREAM CONNECTED 34102 /run/dbus/system_bus_socket
|
||||
unix 3 [ ] STREAM CONNECTED 24805 /run/systemd/journal/stdout
|
||||
unix 3 [ ] STREAM CONNECTED 29322 /run/systemd/journal/stdout
|
||||
unix 2 [ ] DGRAM 36357
|
||||
unix 3 [ ] STREAM CONNECTED 30832 /run/systemd/journal/stdout
|
||||
unix 2 [ ] DGRAM 26913
|
||||
unix 2 [ ] STREAM CONNECTED 32010
|
||||
unix 3 [ ] STREAM CONNECTED 28748 /run/systemd/journal/stdout
|
||||
unix 2 [ ] DGRAM 28602
|
||||
unix 3 [ ] STREAM CONNECTED 28401 /run/systemd/journal/stdout
|
||||
unix 3 [ ] STREAM CONNECTED 31069 /run/dbus/system_bus_socket
|
||||
unix 3 [ ] DGRAM 28616
|
||||
unix 3 [ ] STREAM CONNECTED 32334 /run/systemd/journal/stdout
|
||||
unix 3 [ ] STREAM CONNECTED 31712
|
||||
unix 3 [ ] STREAM CONNECTED 36302
|
||||
unix 3 [ ] STREAM CONNECTED 32333
|
||||
unix 3 [ ] STREAM CONNECTED 32093
|
||||
unix 3 [ ] STREAM CONNECTED 26912
|
||||
unix 2 [ ] STREAM CONNECTED 35774
|
||||
unix 3 [ ] STREAM CONNECTED 29321
|
||||
unix 3 [ ] STREAM CONNECTED 31025
|
||||
unix 3 [ ] STREAM CONNECTED 28470
|
||||
unix 3 [ ] STREAM CONNECTED 32094 /run/dbus/system_bus_socket
|
||||
unix 3 [ ] STREAM CONNECTED 31259 /run/systemd/journal/stdout
|
||||
unix 2 [ ] DGRAM 36471
|
||||
unix 3 [ ] STREAM CONNECTED 31054
|
||||
unix 3 [ ] STREAM CONNECTED 31064 /run/dbus/system_bus_socket
|
||||
unix 3 [ ] STREAM CONNECTED 28471 /run/systemd/journal/stdout
|
||||
unix 3 [ ] STREAM CONNECTED 36377
|
||||
unix 2 [ ] STREAM CONNECTED 35788
|
||||
unix 3 [ ] STREAM CONNECTED 31258
|
||||
unix 3 [ ] STREAM CONNECTED 31065 /run/dbus/system_bus_socket
|
||||
Active Bluetooth connections (w/o servers)
|
||||
Proto Destination Source State PSM DCID SCID IMTU OMTU Security
|
||||
Proto Destination Source State Channel
|
||||
|
||||
91
tests/fixtures/generic/oscar_age_male.csv
vendored
91
tests/fixtures/generic/oscar_age_male.csv
vendored
@@ -1,91 +0,0 @@
|
||||
"Index", "Year", "Age", "Name", "Movie"
|
||||
1, 1928, 44, "Emil Jannings", "The Last Command, The Way of All Flesh"
|
||||
2, 1929, 41, "Warner Baxter", "In Old Arizona"
|
||||
3, 1930, 62, "George Arliss", "Disraeli"
|
||||
4, 1931, 53, "Lionel Barrymore", "A Free Soul"
|
||||
5, 1932, 47, "Wallace Beery", "The Champ"
|
||||
6, 1933, 35, "Fredric March", "Dr. Jekyll and Mr. Hyde"
|
||||
7, 1934, 34, "Charles Laughton", "The Private Life of Henry VIII"
|
||||
8, 1935, 34, "Clark Gable", "It Happened One Night"
|
||||
9, 1936, 49, "Victor McLaglen", "The Informer"
|
||||
10, 1937, 41, "Paul Muni", "The Story of Louis Pasteur"
|
||||
11, 1938, 37, "Spencer Tracy", "Captains Courageous"
|
||||
12, 1939, 38, "Spencer Tracy", "Boys Town"
|
||||
13, 1940, 34, "Robert Donat", "Goodbye, Mr. Chips"
|
||||
14, 1941, 32, "James Stewart", "The Philadelphia Story"
|
||||
15, 1942, 40, "Gary Cooper", "Sergeant York"
|
||||
16, 1943, 43, "James Cagney", "Yankee Doodle Dandy"
|
||||
17, 1944, 48, "Paul Lukas", "Watch on the Rhine"
|
||||
18, 1945, 41, "Bing Crosby", "Going My Way"
|
||||
19, 1946, 39, "Ray Milland", "The Lost Weekend"
|
||||
20, 1947, 49, "Fredric March", "The Best Years of Our Lives"
|
||||
21, 1948, 57, "Ronald Colman", "A Double Life"
|
||||
22, 1949, 41, "Laurence Olivier", "Hamlet"
|
||||
23, 1950, 38, "Broderick Crawford", "All the King's Men"
|
||||
24, 1951, 39, "José Ferrer", "Cyrano de Bergerac"
|
||||
25, 1952, 52, "Humphrey Bogart", "The African Queen"
|
||||
26, 1953, 51, "Gary Cooper", "High Noon"
|
||||
27, 1954, 35, "William Holden", "Stalag 17"
|
||||
28, 1955, 30, "Marlon Brando", "On the Waterfront"
|
||||
29, 1956, 39, "Ernest Borgnine", "Marty"
|
||||
30, 1957, 36, "Yul Brynner", "The King and I"
|
||||
31, 1958, 43, "Alec Guinness", "The Bridge on the River Kwai"
|
||||
32, 1959, 49, "David Niven", "Separate Tables"
|
||||
33, 1960, 36, "Charlton Heston", "Ben-Hur"
|
||||
34, 1961, 47, "Burt Lancaster", "Elmer Gantry"
|
||||
35, 1962, 31, "Maximilian Schell", "Judgment at Nuremberg"
|
||||
36, 1963, 47, "Gregory Peck", "To Kill a Mockingbird"
|
||||
37, 1964, 37, "Sidney Poitier", "Lilies of the Field"
|
||||
38, 1965, 57, "Rex Harrison", "My Fair Lady"
|
||||
39, 1966, 42, "Lee Marvin", "Cat Ballou"
|
||||
40, 1967, 45, "Paul Scofield", "A Man for All Seasons"
|
||||
41, 1968, 42, "Rod Steiger", "In the Heat of the Night"
|
||||
42, 1969, 45, "Cliff Robertson", "Charly"
|
||||
43, 1970, 62, "John Wayne", "True Grit"
|
||||
44, 1971, 43, "George C. Scott", "Patton"
|
||||
45, 1972, 42, "Gene Hackman", "The French Connection"
|
||||
46, 1973, 48, "Marlon Brando", "The Godfather"
|
||||
47, 1974, 49, "Jack Lemmon", "Save the Tiger"
|
||||
48, 1975, 56, "Art Carney", "Harry and Tonto"
|
||||
49, 1976, 38, "Jack Nicholson", "One Flew Over the Cuckoo's Nest"
|
||||
50, 1977, 60, "Peter Finch", "Network"
|
||||
51, 1978, 30, "Richard Dreyfuss", "The Goodbye Girl"
|
||||
52, 1979, 40, "Jon Voight", "Coming Home"
|
||||
53, 1980, 42, "Dustin Hoffman", "Kramer vs. Kramer"
|
||||
54, 1981, 37, "Robert De Niro", "Raging Bull"
|
||||
55, 1982, 76, "Henry Fonda", "On Golden Pond"
|
||||
56, 1983, 39, "Ben Kingsley", "Gandhi"
|
||||
57, 1984, 53, "Robert Duvall", "Tender Mercies"
|
||||
58, 1985, 45, "F. Murray Abraham", "Amadeus"
|
||||
59, 1986, 36, "William Hurt", "Kiss of the Spider Woman"
|
||||
60, 1987, 62, "Paul Newman", "The Color of Money"
|
||||
61, 1988, 43, "Michael Douglas", "Wall Street"
|
||||
62, 1989, 51, "Dustin Hoffman", "Rain Man"
|
||||
63, 1990, 32, "Daniel Day-Lewis", "My Left Foot"
|
||||
64, 1991, 42, "Jeremy Irons", "Reversal of Fortune"
|
||||
65, 1992, 54, "Anthony Hopkins", "The Silence of the Lambs"
|
||||
66, 1993, 52, "Al Pacino", "Scent of a Woman"
|
||||
67, 1994, 37, "Tom Hanks", "Philadelphia"
|
||||
68, 1995, 38, "Tom Hanks", "Forrest Gump"
|
||||
69, 1996, 32, "Nicolas Cage", "Leaving Las Vegas"
|
||||
70, 1997, 45, "Geoffrey Rush", "Shine"
|
||||
71, 1998, 60, "Jack Nicholson", "As Good as It Gets"
|
||||
72, 1999, 46, "Roberto Benigni", "Life Is Beautiful"
|
||||
73, 2000, 40, "Kevin Spacey", "American Beauty"
|
||||
74, 2001, 36, "Russell Crowe", "Gladiator"
|
||||
75, 2002, 47, "Denzel Washington", "Training Day"
|
||||
76, 2003, 29, "Adrien Brody", "The Pianist"
|
||||
77, 2004, 43, "Sean Penn", "Mystic River"
|
||||
78, 2005, 37, "Jamie Foxx", "Ray"
|
||||
79, 2006, 38, "Philip Seymour Hoffman", "Capote"
|
||||
80, 2007, 45, "Forest Whitaker", "The Last King of Scotland"
|
||||
81, 2008, 50, "Daniel Day-Lewis", "There Will Be Blood"
|
||||
82, 2009, 48, "Sean Penn", "Milk"
|
||||
83, 2010, 60, "Jeff Bridges", "Crazy Heart"
|
||||
84, 2011, 50, "Colin Firth", "The King's Speech"
|
||||
85, 2012, 39, "Jean Dujardin", "The Artist"
|
||||
86, 2013, 55, "Daniel Day-Lewis", "Lincoln"
|
||||
87, 2014, 44, "Matthew McConaughey", "Dallas Buyers Club"
|
||||
88, 2015, 33, "Eddie Redmayne", "The Theory of Everything"
|
||||
89, 2016, 41, "Leonardo DiCaprio", "The Revenant"
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 10 and column 47.
|
2
tests/fixtures/osx-10.11.6/du.json
vendored
2
tests/fixtures/osx-10.11.6/du.json
vendored
File diff suppressed because one or more lines are too long
7
tests/fixtures/osx-10.11.6/du.out
vendored
7
tests/fixtures/osx-10.11.6/du.out
vendored
@@ -911,13 +911,6 @@
|
||||
112 /usr/local/Homebrew/Library/Homebrew/rubocops/cask
|
||||
40 /usr/local/Homebrew/Library/Homebrew/rubocops/extend
|
||||
344 /usr/local/Homebrew/Library/Homebrew/rubocops
|
||||
288 /usr/local/Homebrew/Library/Homebrew/shims/linux/super
|
||||
288 /usr/local/Homebrew/Library/Homebrew/shims/linux
|
||||
344 /usr/local/Homebrew/Library/Homebrew/shims/mac/super
|
||||
344 /usr/local/Homebrew/Library/Homebrew/shims/mac
|
||||
16 /usr/local/Homebrew/Library/Homebrew/shims/scm
|
||||
280 /usr/local/Homebrew/Library/Homebrew/shims/super
|
||||
928 /usr/local/Homebrew/Library/Homebrew/shims
|
||||
24 /usr/local/Homebrew/Library/Homebrew/test/cask/artifact/shared_examples
|
||||
144 /usr/local/Homebrew/Library/Homebrew/test/cask/artifact
|
||||
24 /usr/local/Homebrew/Library/Homebrew/test/cask/cask_loader
|
||||
|
||||
1
tests/fixtures/osx-10.14.6/airport-I.json
vendored
Normal file
1
tests/fixtures/osx-10.14.6/airport-I.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"agrctlrssi": -66, "agrextrssi": 0, "agrctlnoise": -90, "agrextnoise": 0, "state": "running", "op_mode": "station", "lasttxrate": 195, "maxrate": 867, "lastassocstatus": 0, "802_11_auth": "open", "link_auth": "wpa2-psk", "bssid": "3c:37:86:15:ad:f9", "ssid": "SnazzleDazzle", "mcs": 0, "channel": "48,80"}
|
||||
15
tests/fixtures/osx-10.14.6/airport-I.out
vendored
Normal file
15
tests/fixtures/osx-10.14.6/airport-I.out
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
agrCtlRSSI: -66
|
||||
agrExtRSSI: 0
|
||||
agrCtlNoise: -90
|
||||
agrExtNoise: 0
|
||||
state: running
|
||||
op mode: station
|
||||
lastTxRate: 195
|
||||
maxRate: 867
|
||||
lastAssocStatus: 0
|
||||
802.11 auth: open
|
||||
link auth: wpa2-psk
|
||||
BSSID: 3c:37:86:15:ad:f9
|
||||
SSID: SnazzleDazzle
|
||||
MCS: 0
|
||||
channel: 48,80
|
||||
1
tests/fixtures/osx-10.14.6/airport-s.json
vendored
Normal file
1
tests/fixtures/osx-10.14.6/airport-s.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[{"ssid": "DIRECT-4A-HP OfficeJet 3830", "bssid": "00:68:eb:2b:b7:3b", "rssi": -91, "channel": "6", "ht": true, "cc": "--", "security": ["WPA2(PSK/AES/AES)"]}, {"ssid": "xfinitywifi", "bssid": "6e:e3:0e:c1:74:df", "rssi": -87, "channel": "36", "ht": true, "cc": "US", "security": ["NONE"]}, {"ssid": "XFINITY", "bssid": "8e:e3:0e:c1:74:df", "rssi": -86, "channel": "36", "ht": true, "cc": "US", "security": ["WPA2(802.1x/AES/AES)"]}, {"ssid": "YouAreInfected-5", "bssid": "5c:e3:0e:c1:74:df", "rssi": -86, "channel": "36", "ht": true, "cc": "US", "security": ["WPA(PSK/AES,TKIP/TKIP)", "WPA2(PSK/AES,TKIP/TKIP)"]}, {"ssid": "xfinitywifi", "bssid": "6e:e3:0e:b8:55:8f", "rssi": -85, "channel": "11", "ht": true, "cc": "US", "security": ["NONE"]}, {"ssid": "xfinitywifi", "bssid": "6e:e3:0e:c1:74:de", "rssi": -79, "channel": "6", "ht": true, "cc": "US", "security": ["NONE"]}, {"ssid": "ngHub_319451N814D6D", "bssid": "04:a1:51:56:5c:eb", "rssi": -77, "channel": "11", "ht": true, "cc": "US", "security": ["WPA2(PSK/AES/AES)"]}, {"ssid": "YouAreInfected", "bssid": "5c:e3:0e:c1:74:de", "rssi": -76, "channel": "6", "ht": true, "cc": "US", "security": ["WPA(PSK/AES,TKIP/TKIP)", "WPA2(PSK/AES,TKIP/TKIP)"]}, {"ssid": "YuanFamily_Extender2G", "bssid": "a0:04:60:86:11:89", "rssi": -76, "channel": "11", "ht": true, "cc": "--", "security": ["WPA(PSK/AES,TKIP/TKIP)", "WPA2(PSK/AES,TKIP/TKIP)"]}, {"ssid": "YuanFamily", "bssid": "5c:e3:0e:b8:15:9f", "rssi": -73, "channel": "11", "ht": true, "cc": "US", "security": ["WPA(PSK/AES,TKIP/TKIP)", "WPA2(PSK/AES,TKIP/TKIP)"]}, {"ssid": "SnazzleDazzle", "bssid": "3c:37:86:15:fd:b5", "rssi": -70, "channel": "48", "ht": true, "cc": "US", "security": ["WPA2(PSK/AES/AES)"]}, {"ssid": "SnazzleDazzle", "bssid": "42:37:86:15:fd:b3", "rssi": -62, "channel": "3,+1", "ht": true, "cc": "US", "security": ["WPA2(PSK/AES/AES)"]}, {"ssid": "SnazzleDazzle", "bssid": "42:37:86:15:aa:f7", "rssi": -54, "channel": "3", "ht": true, "cc": "US", "security": ["WPA2(PSK/AES/AES)"]}, {"ssid": "SnazzleDazzle", "bssid": "3c:37:86:15:aa:f9", "rssi": -64, "channel": "48", "ht": true, "cc": "US", "security": ["WPA2(PSK/AES/AES)"]}]
|
||||
15
tests/fixtures/osx-10.14.6/airport-s.out
vendored
Normal file
15
tests/fixtures/osx-10.14.6/airport-s.out
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
SSID BSSID RSSI CHANNEL HT CC SECURITY (auth/unicast/group)
|
||||
DIRECT-4A-HP OfficeJet 3830 00:68:eb:2b:b7:3b -91 6 Y -- WPA2(PSK/AES/AES)
|
||||
xfinitywifi 6e:e3:0e:c1:74:df -87 36 Y US NONE
|
||||
XFINITY 8e:e3:0e:c1:74:df -86 36 Y US WPA2(802.1x/AES/AES)
|
||||
YouAreInfected-5 5c:e3:0e:c1:74:df -86 36 Y US WPA(PSK/AES,TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP)
|
||||
xfinitywifi 6e:e3:0e:b8:55:8f -85 11 Y US NONE
|
||||
xfinitywifi 6e:e3:0e:c1:74:de -79 6 Y US NONE
|
||||
ngHub_319451N814D6D 04:a1:51:56:5c:eb -77 11 Y US WPA2(PSK/AES/AES)
|
||||
YouAreInfected 5c:e3:0e:c1:74:de -76 6 Y US WPA(PSK/AES,TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP)
|
||||
YuanFamily_Extender2G a0:04:60:86:11:89 -76 11 Y -- WPA(PSK/AES,TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP)
|
||||
YuanFamily 5c:e3:0e:b8:15:9f -73 11 Y US WPA(PSK/AES,TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP)
|
||||
SnazzleDazzle 3c:37:86:15:fd:b5 -70 48 Y US WPA2(PSK/AES/AES)
|
||||
SnazzleDazzle 42:37:86:15:fd:b3 -62 3,+1 Y US WPA2(PSK/AES/AES)
|
||||
SnazzleDazzle 42:37:86:15:aa:f7 -54 3 Y US WPA2(PSK/AES/AES)
|
||||
SnazzleDazzle 3c:37:86:15:aa:f9 -64 48 Y US WPA2(PSK/AES/AES)
|
||||
1
tests/fixtures/osx-10.14.6/arp-a2.json
vendored
Normal file
1
tests/fixtures/osx-10.14.6/arp-a2.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[{"name": null, "address": "169.254.81.142", "hwtype": "ethernet", "hwaddress": "60:93:17:3a:28:fc", "iface": "en0"}, {"name": "my-iphone.attlocal.net", "address": "192.168.1.64", "hwtype": "ethernet", "hwaddress": "e0:33:8f:68:39:d6", "iface": "en0"}, {"name": "my-mbp.attlocal.net", "address": "192.168.1.72", "hwtype": "ethernet", "hwaddress": "f0:18:98:3:d7:34", "iface": "en0"}, {"name": "c6180.attlocal.net", "address": "192.168.1.74", "hwtype": "ethernet", "hwaddress": "9c:b6:54:5f:fa:7c", "iface": "en0"}, {"name": "ipad.attlocal.net", "address": "192.168.1.75", "hwtype": "ethernet", "hwaddress": "4c:56:9e:5f:c7:4c", "iface": "en0"}, {"name": "mycloudex2ultra.attlocal.net", "address": "192.168.1.80", "hwtype": "ethernet", "hwaddress": "0:90:a9:ed:f4:3f", "iface": "en0"}, {"name": "family-room-5.attlocal.net", "address": "192.168.1.88", "hwtype": "ethernet", "hwaddress": "c8:d0:84:c3:e3:2d", "iface": "en0"}, {"name": "bedroom.attlocal.net", "address": "192.168.1.89", "hwtype": "ethernet", "hwaddress": "d0:3:4b:3b:29:a5", "iface": "en0"}, {"name": "heriphone.attlocal.net", "address": "192.168.1.178", "hwtype": "ethernet", "hwaddress": "90:e1:7b:ef:1:45", "iface": "en0"}, {"name": "upstairs.attlocal.net", "address": "192.168.1.186", "hwtype": "ethernet", "hwaddress": "50:32:37:d7:e5:7b", "iface": "en0"}, {"name": "rbr50.attlocal.net", "address": "192.168.1.216", "hwtype": "ethernet", "hwaddress": "3c:37:86:25:fd:f7", "iface": "en0"}, {"name": "my-mac.attlocal.net", "address": "192.168.1.221", "hwtype": "ethernet", "hwaddress": "a4:83:e7:2e:f2:8f", "iface": "en0"}, {"name": "irobot-d41934.attlocal.net", "address": "192.168.1.242", "hwtype": "ethernet", "hwaddress": "50:14:79:f2:4f:3e", "iface": "en0"}, {"name": "rbs50.attlocal.net", "address": "192.168.1.253", "hwtype": "ethernet", "hwaddress": "3c:37:86:1f:dd:a3", "iface": "en0"}, {"name": "dsldevice.attlocal.net", "address": "192.168.1.254", "hwtype": "ethernet", "hwaddress": "fc:ae:34:f1:3f:80", "iface": "en0"}, {"name": null, "address": "192.168.1.255", "hwtype": "ethernet", "hwaddress": "ff:ff:ff:ff:ff:ff", "iface": "en0"}, {"name": null, "address": "192.168.71.255", "hwtype": "ethernet", "hwaddress": "ff:ff:ff:ff:ff:ff", "iface": "vmnet8"}, {"name": null, "address": "192.168.101.255", "hwtype": "ethernet", "hwaddress": "ff:ff:ff:ff:ff:ff", "iface": "vmnet1"}, {"name": null, "address": "224.0.0.251", "hwtype": "ethernet", "hwaddress": "1:0:5e:0:0:eb", "iface": "en0"}, {"name": null, "address": "239.255.255.250", "hwtype": "ethernet", "hwaddress": "1:0:5e:7f:ff:fe", "iface": "en0"}]
|
||||
20
tests/fixtures/osx-10.14.6/arp-a2.out
vendored
Normal file
20
tests/fixtures/osx-10.14.6/arp-a2.out
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
? (169.254.81.142) at 60:93:17:3a:28:fc on en0 [ethernet]
|
||||
my-iphone.attlocal.net (192.168.1.64) at e0:33:8f:68:39:d6 on en0 ifscope [ethernet]
|
||||
my-mbp.attlocal.net (192.168.1.72) at f0:18:98:3:d7:34 on en0 ifscope [ethernet]
|
||||
c6180.attlocal.net (192.168.1.74) at 9c:b6:54:5f:fa:7c on en0 ifscope [ethernet]
|
||||
ipad.attlocal.net (192.168.1.75) at 4c:56:9e:5f:c7:4c on en0 ifscope [ethernet]
|
||||
mycloudex2ultra.attlocal.net (192.168.1.80) at 0:90:a9:ed:f4:3f on en0 ifscope [ethernet]
|
||||
family-room-5.attlocal.net (192.168.1.88) at c8:d0:84:c3:e3:2d on en0 ifscope [ethernet]
|
||||
bedroom.attlocal.net (192.168.1.89) at d0:3:4b:3b:29:a5 on en0 ifscope [ethernet]
|
||||
heriphone.attlocal.net (192.168.1.178) at 90:e1:7b:ef:1:45 on en0 ifscope [ethernet]
|
||||
upstairs.attlocal.net (192.168.1.186) at 50:32:37:d7:e5:7b on en0 ifscope [ethernet]
|
||||
rbr50.attlocal.net (192.168.1.216) at 3c:37:86:25:fd:f7 on en0 ifscope [ethernet]
|
||||
my-mac.attlocal.net (192.168.1.221) at a4:83:e7:2e:f2:8f on en0 ifscope permanent [ethernet]
|
||||
irobot-d41934.attlocal.net (192.168.1.242) at 50:14:79:f2:4f:3e on en0 ifscope [ethernet]
|
||||
rbs50.attlocal.net (192.168.1.253) at 3c:37:86:1f:dd:a3 on en0 ifscope [ethernet]
|
||||
dsldevice.attlocal.net (192.168.1.254) at fc:ae:34:f1:3f:80 on en0 ifscope [ethernet]
|
||||
? (192.168.1.255) at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]
|
||||
? (192.168.71.255) at ff:ff:ff:ff:ff:ff on vmnet8 ifscope [ethernet]
|
||||
? (192.168.101.255) at ff:ff:ff:ff:ff:ff on vmnet1 ifscope [ethernet]
|
||||
? (224.0.0.251) at 1:0:5e:0:0:eb on en0 ifscope permanent [ethernet]
|
||||
? (239.255.255.250) at 1:0:5e:7f:ff:fe on en0 ifscope permanent [ethernet]
|
||||
1
tests/fixtures/osx-10.14.6/dig-axfr.json
vendored
Normal file
1
tests/fixtures/osx-10.14.6/dig-axfr.json
vendored
Normal file
File diff suppressed because one or more lines are too long
59
tests/fixtures/osx-10.14.6/dig-axfr.out
vendored
Normal file
59
tests/fixtures/osx-10.14.6/dig-axfr.out
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
|
||||
; <<>> DiG 9.10.6 <<>> @81.4.108.41 AXFR zonetransfer.me
|
||||
; (1 server found)
|
||||
;; global options: +cmd
|
||||
zonetransfer.me. 7200 IN SOA nsztm1.digi.ninja. robin.digi.ninja. 2019100801 172800 900 1209600 3600
|
||||
zonetransfer.me. 300 IN HINFO "Casio fx-700G" "Windows XP"
|
||||
zonetransfer.me. 301 IN TXT "google-site-verification=tyP28J7JAUHA9fw2sHXMgcCC0I6XBmmoVi04VlMewxA"
|
||||
zonetransfer.me. 7200 IN MX 0 ASPMX.L.GOOGLE.COM.
|
||||
zonetransfer.me. 7200 IN MX 10 ALT1.ASPMX.L.GOOGLE.COM.
|
||||
zonetransfer.me. 7200 IN MX 10 ALT2.ASPMX.L.GOOGLE.COM.
|
||||
zonetransfer.me. 7200 IN MX 20 ASPMX2.GOOGLEMAIL.COM.
|
||||
zonetransfer.me. 7200 IN MX 20 ASPMX3.GOOGLEMAIL.COM.
|
||||
zonetransfer.me. 7200 IN MX 20 ASPMX4.GOOGLEMAIL.COM.
|
||||
zonetransfer.me. 7200 IN MX 20 ASPMX5.GOOGLEMAIL.COM.
|
||||
zonetransfer.me. 7200 IN A 5.196.105.14
|
||||
zonetransfer.me. 7200 IN NS nsztm1.digi.ninja.
|
||||
zonetransfer.me. 7200 IN NS nsztm2.digi.ninja.
|
||||
_acme-challenge.zonetransfer.me. 301 IN TXT "6Oa05hbUJ9xSsvYy7pApQvwCUSSGgxvrbdizjePEsZI"
|
||||
_sip._tcp.zonetransfer.me. 14000 IN SRV 0 0 5060 www.zonetransfer.me.
|
||||
14.105.196.5.IN-ADDR.ARPA.zonetransfer.me. 7200 IN PTR www.zonetransfer.me.
|
||||
asfdbauthdns.zonetransfer.me. 7900 IN AFSDB 1 asfdbbox.zonetransfer.me.
|
||||
asfdbbox.zonetransfer.me. 7200 IN A 127.0.0.1
|
||||
asfdbvolume.zonetransfer.me. 7800 IN AFSDB 1 asfdbbox.zonetransfer.me.
|
||||
canberra-office.zonetransfer.me. 7200 IN A 202.14.81.230
|
||||
cmdexec.zonetransfer.me. 300 IN TXT "; ls"
|
||||
contact.zonetransfer.me. 2592000 IN TXT "Remember to call or email Pippa on +44 123 4567890 or pippa@zonetransfer.me when making DNS changes"
|
||||
dc-office.zonetransfer.me. 7200 IN A 143.228.181.132
|
||||
deadbeef.zonetransfer.me. 7201 IN AAAA dead:beaf::
|
||||
dr.zonetransfer.me. 300 IN LOC 53 20 56.558 N 1 38 33.526 W 0.00m 1m 10000m 10m
|
||||
DZC.zonetransfer.me. 7200 IN TXT "AbCdEfG"
|
||||
email.zonetransfer.me. 2222 IN NAPTR 1 1 "P" "E2U+email" "" email.zonetransfer.me.zonetransfer.me.
|
||||
email.zonetransfer.me. 7200 IN A 74.125.206.26
|
||||
Hello.zonetransfer.me. 7200 IN TXT "Hi to Josh and all his class"
|
||||
home.zonetransfer.me. 7200 IN A 127.0.0.1
|
||||
Info.zonetransfer.me. 7200 IN TXT "ZoneTransfer.me service provided by Robin Wood - robin@digi.ninja. See http://digi.ninja/projects/zonetransferme.php for more information."
|
||||
internal.zonetransfer.me. 300 IN NS intns1.zonetransfer.me.
|
||||
internal.zonetransfer.me. 300 IN NS intns2.zonetransfer.me.
|
||||
intns1.zonetransfer.me. 300 IN A 81.4.108.41
|
||||
intns2.zonetransfer.me. 300 IN A 167.88.42.94
|
||||
office.zonetransfer.me. 7200 IN A 4.23.39.254
|
||||
ipv6actnow.org.zonetransfer.me. 7200 IN AAAA 2001:67c:2e8:11::c100:1332
|
||||
owa.zonetransfer.me. 7200 IN A 207.46.197.32
|
||||
robinwood.zonetransfer.me. 302 IN TXT "Robin Wood"
|
||||
rp.zonetransfer.me. 321 IN RP robin.zonetransfer.me. robinwood.zonetransfer.me.
|
||||
sip.zonetransfer.me. 3333 IN NAPTR 2 3 "P" "E2U+sip" "!^.*$!sip:customer-service@zonetransfer.me!" .
|
||||
sqli.zonetransfer.me. 300 IN TXT "' or 1=1 --"
|
||||
sshock.zonetransfer.me. 7200 IN TXT "() { :]}; echo ShellShocked"
|
||||
staging.zonetransfer.me. 7200 IN CNAME www.sydneyoperahouse.com.
|
||||
alltcpportsopen.firewall.test.zonetransfer.me. 301 IN A 127.0.0.1
|
||||
testing.zonetransfer.me. 301 IN CNAME www.zonetransfer.me.
|
||||
vpn.zonetransfer.me. 4000 IN A 174.36.59.154
|
||||
www.zonetransfer.me. 7200 IN A 5.196.105.14
|
||||
xss.zonetransfer.me. 300 IN TXT "'><script>alert('Boo')</script>"
|
||||
zonetransfer.me. 7200 IN SOA nsztm1.digi.ninja. robin.digi.ninja. 2019100801 172800 900 1209600 3600
|
||||
;; Query time: 170 msec
|
||||
;; SERVER: 81.4.108.41#53(81.4.108.41)
|
||||
;; WHEN: Thu Mar 26 16:31:06 PDT 2020
|
||||
;; XFR size: 50 records (messages 1, bytes 1994)
|
||||
|
||||
2
tests/fixtures/osx-10.14.6/du.json
vendored
2
tests/fixtures/osx-10.14.6/du.json
vendored
File diff suppressed because one or more lines are too long
7
tests/fixtures/osx-10.14.6/du.out
vendored
7
tests/fixtures/osx-10.14.6/du.out
vendored
@@ -317,13 +317,6 @@
|
||||
32 /usr/local/Homebrew/Library/Homebrew/cli
|
||||
56 /usr/local/Homebrew/Library/Homebrew/manpages
|
||||
8 /usr/local/Homebrew/Library/Homebrew/version
|
||||
64 /usr/local/Homebrew/Library/Homebrew/shims/mac/super
|
||||
64 /usr/local/Homebrew/Library/Homebrew/shims/mac
|
||||
24 /usr/local/Homebrew/Library/Homebrew/shims/super
|
||||
8 /usr/local/Homebrew/Library/Homebrew/shims/linux/super
|
||||
8 /usr/local/Homebrew/Library/Homebrew/shims/linux
|
||||
8 /usr/local/Homebrew/Library/Homebrew/shims/scm
|
||||
104 /usr/local/Homebrew/Library/Homebrew/shims
|
||||
8 /usr/local/Homebrew/Library/Homebrew/debrew
|
||||
56 /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.8
|
||||
24 /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.6
|
||||
|
||||
1
tests/fixtures/osx-10.14.6/file.json
vendored
Normal file
1
tests/fixtures/osx-10.14.6/file.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[{"filename": "Applications", "type": "directory"}, {"filename": "Desktop", "type": "directory"}, {"filename": "Documents", "type": "directory"}, {"filename": "Downloads", "type": "directory"}, {"filename": "Library", "type": "directory"}, {"filename": "Movies", "type": "directory"}, {"filename": "Music", "type": "directory"}, {"filename": "Pictures", "type": "directory"}, {"filename": "Postman", "type": "directory"}, {"filename": "Public", "type": "directory"}, {"filename": "Virtual Machines.localized", "type": "directory"}, {"filename": "another file with spaces", "type": "empty"}, {"filename": "ansible", "type": "directory"}, {"filename": "api", "type": "directory"}, {"filename": "argstest.py", "type": "Python script text executable, ASCII text"}, {"filename": "blkid-p.out", "type": "ASCII text"}, {"filename": "blkid-pi.out", "type": "ASCII text, with very long lines"}, {"filename": "blkid-ubuntu.out", "type": "ASCII text"}, {"filename": "blkid-udev-mult.out", "type": "ASCII text"}, {"filename": "blkid-udev.out", "type": "ASCII text"}, {"filename": "blkid.out", "type": "ASCII text"}, {"filename": "cd_catalog.xml", "type": "XML 1.0 document text, ASCII text, with CRLF line terminators"}, {"filename": "centosserial.sh", "type": "Bourne-Again shell script text executable, UTF-8 Unicode text"}, {"filename": "coreosserial.sh", "type": "Bourne-Again shell script text executable, UTF-8 Unicode text"}, {"filename": "fazserial.sh", "type": "Bourne-Again shell script text executable, UTF-8 Unicode text"}, {"filename": "fgt1serial.sh", "type": "Bourne-Again shell script text executable, UTF-8 Unicode text"}, {"filename": "fgt2serial.sh", "type": "Bourne-Again shell script text executable, UTF-8 Unicode text"}, {"filename": "file with spaces", "type": "empty"}, {"filename": "fortiweb-docker.sh", "type": "Bourne-Again shell script text executable, ASCII text"}, {"filename": "ftmgr.sh", "type": "Bourne-Again shell script text executable, ASCII text"}, {"filename": "git", "type": "directory"}, {"filename": "google-cloud-sdk", "type": "directory"}, {"filename": "ifconfiglines.json", "type": "ASCII text, with very long lines"}, {"filename": "jc-jq-jp-ps-cpu.gif", "type": "GIF image data, version 89a, 1572 x 1212"}, {"filename": "jc-jq-jp-uptime-small.gif", "type": "GIF image data, version 89a, 800 x 617"}, {"filename": "jc-jq-jp-uptime.gif", "type": "GIF image data, version 89a, 1572 x 1212"}, {"filename": "jp", "type": "Mach-O 64-bit executable x86_64"}, {"filename": "jp_1.1.12_osx_x86_64.zip", "type": "Zip archive data, at least v2.0 to extract"}, {"filename": "jupyter.sh", "type": "ASCII text"}, {"filename": "kb.sh", "type": "Bourne-Again shell script text executable, ASCII text"}, {"filename": "kbtesting.txt", "type": "ASCII text"}, {"filename": "kelly-aws.pem", "type": "PEM RSA private key"}, {"filename": "kellyargtest.py", "type": "Python script text executable, ASCII text"}, {"filename": "loadplot.sh", "type": "Bourne-Again shell script text executable, ASCII text"}, {"filename": "ls-R.out", "type": "UTF-8 Unicode text"}, {"filename": "ls-lR-empty-folder.out", "type": "ASCII text"}, {"filename": "ls-lR.out", "type": "UTF-8 Unicode text"}, {"filename": "myrecording", "type": "data"}, {"filename": "smcclient.jnlp", "type": "XML 1.0 document text, ASCII text"}, {"filename": "table.py", "type": "Python script text executable, ASCII text"}, {"filename": "test.ini", "type": "ASCII text"}, {"filename": "ubuntuserial.sh", "type": "Bourne-Again shell script text executable, UTF-8 Unicode text"}, {"filename": "utils", "type": "directory"}]
|
||||
53
tests/fixtures/osx-10.14.6/file.out
vendored
Normal file
53
tests/fixtures/osx-10.14.6/file.out
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
Applications: directory
|
||||
Desktop: directory
|
||||
Documents: directory
|
||||
Downloads: directory
|
||||
Library: directory
|
||||
Movies: directory
|
||||
Music: directory
|
||||
Pictures: directory
|
||||
Postman: directory
|
||||
Public: directory
|
||||
Virtual Machines.localized: directory
|
||||
another file with spaces: empty
|
||||
ansible: directory
|
||||
api: directory
|
||||
argstest.py: Python script text executable, ASCII text
|
||||
blkid-p.out: ASCII text
|
||||
blkid-pi.out: ASCII text, with very long lines
|
||||
blkid-ubuntu.out: ASCII text
|
||||
blkid-udev-mult.out: ASCII text
|
||||
blkid-udev.out: ASCII text
|
||||
blkid.out: ASCII text
|
||||
cd_catalog.xml: XML 1.0 document text, ASCII text, with CRLF line terminators
|
||||
centosserial.sh: Bourne-Again shell script text executable, UTF-8 Unicode text
|
||||
coreosserial.sh: Bourne-Again shell script text executable, UTF-8 Unicode text
|
||||
fazserial.sh: Bourne-Again shell script text executable, UTF-8 Unicode text
|
||||
fgt1serial.sh: Bourne-Again shell script text executable, UTF-8 Unicode text
|
||||
fgt2serial.sh: Bourne-Again shell script text executable, UTF-8 Unicode text
|
||||
file with spaces: empty
|
||||
fortiweb-docker.sh: Bourne-Again shell script text executable, ASCII text
|
||||
ftmgr.sh: Bourne-Again shell script text executable, ASCII text
|
||||
git: directory
|
||||
google-cloud-sdk: directory
|
||||
ifconfiglines.json: ASCII text, with very long lines
|
||||
jc-jq-jp-ps-cpu.gif: GIF image data, version 89a, 1572 x 1212
|
||||
jc-jq-jp-uptime-small.gif: GIF image data, version 89a, 800 x 617
|
||||
jc-jq-jp-uptime.gif: GIF image data, version 89a, 1572 x 1212
|
||||
jp: Mach-O 64-bit executable x86_64
|
||||
jp_1.1.12_osx_x86_64.zip: Zip archive data, at least v2.0 to extract
|
||||
jupyter.sh: ASCII text
|
||||
kb.sh: Bourne-Again shell script text executable, ASCII text
|
||||
kbtesting.txt: ASCII text
|
||||
kelly-aws.pem: PEM RSA private key
|
||||
kellyargtest.py: Python script text executable, ASCII text
|
||||
loadplot.sh: Bourne-Again shell script text executable, ASCII text
|
||||
ls-R.out: UTF-8 Unicode text
|
||||
ls-lR-empty-folder.out: ASCII text
|
||||
ls-lR.out: UTF-8 Unicode text
|
||||
myrecording: data
|
||||
smcclient.jnlp: XML 1.0 document text, ASCII text
|
||||
table.py: Python script text executable, ASCII text
|
||||
test.ini: ASCII text
|
||||
ubuntuserial.sh: Bourne-Again shell script text executable, UTF-8 Unicode text
|
||||
utils: directory
|
||||
1
tests/fixtures/osx-10.14.6/file2.json
vendored
Normal file
1
tests/fixtures/osx-10.14.6/file2.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[{"filename": "AFP.conf", "type": "data"}, {"filename": "afpovertcp.cfg", "type": "ASCII text"}, {"filename": "aliases", "type": "ASCII text"}, {"filename": "aliases.db", "type": "Berkeley DB 1.85 (Hash, version 2, native byte-order)"}, {"filename": "apache2", "type": "directory"}, {"filename": "asl", "type": "directory"}, {"filename": "asl.conf", "type": "ASCII text"}, {"filename": "auto_home", "type": "ASCII text"}, {"filename": "auto_master", "type": "ASCII text"}, {"filename": "autofs.conf", "type": "ASCII text"}, {"filename": "bashrc", "type": "ASCII text"}, {"filename": "bashrc_Apple_Terminal", "type": "ASCII text"}, {"filename": "com.apple.screensharing.agent.launchd", "type": "ASCII text, with no line terminators"}, {"filename": "csh.cshrc", "type": "ASCII text"}, {"filename": "csh.login", "type": "ASCII text"}, {"filename": "csh.logout", "type": "ASCII text"}, {"filename": "cups", "type": "directory"}, {"filename": "defaults", "type": "directory"}, {"filename": "dnsextd.conf", "type": "ASCII text"}, {"filename": "emond.d", "type": "directory"}, {"filename": "find.codes", "type": "empty"}, {"filename": "fstab.hd", "type": "ASCII text"}, {"filename": "ftpusers", "type": "ASCII text"}, {"filename": "gettytab", "type": "ASCII text"}, {"filename": "group", "type": "ASCII text"}, {"filename": "hosts", "type": "ASCII text"}, {"filename": "hosts.equiv", "type": "empty"}, {"filename": "irbrc", "type": "Ruby script text, ASCII text"}, {"filename": "kern_loader.conf", "type": "empty"}, {"filename": "krb5.keytab", "type": "Kerberos Keytab file, realm=LKDC:SHA1.15090DD365668FBA1B0D2D3DD43FCB7CB9381160, principal=afpserver/LKDC:SHA1.15090DD365668FBA1B0D2D3DD43FCB7CB9381160, type=1, date=Tue Jul 2 15:52:04 2019, kvno=2"}, {"filename": "localtime", "type": "timezone data, version 2, 4 gmt time flags, 4 std time flags, no leap seconds, 185 transition times, 4 abbreviation chars"}, {"filename": "locate.rc", "type": "ASCII text"}, {"filename": "mach_init.d", "type": "directory"}, {"filename": "mach_init_per_login_session.d", "type": "directory"}, {"filename": "mach_init_per_user.d", "type": "directory"}, {"filename": "mail.rc", "type": "ASCII text"}, {"filename": "man.conf", "type": "ASCII text"}, {"filename": "manpaths", "type": "ASCII text"}, {"filename": "manpaths.d", "type": "directory"}, {"filename": "master.passwd", "type": "ASCII text"}, {"filename": "nanorc", "type": "ASCII text"}, {"filename": "networks", "type": "ASCII text"}, {"filename": "newsyslog.conf", "type": "ASCII text"}, {"filename": "newsyslog.d", "type": "directory"}, {"filename": "nfs.conf", "type": "ASCII text"}, {"filename": "notify.conf", "type": "ASCII text"}, {"filename": "ntp.conf", "type": "ASCII text"}, {"filename": "ntp_opendirectory.conf", "type": "ASCII text"}, {"filename": "openldap", "type": "directory"}, {"filename": "pam.d", "type": "directory"}, {"filename": "passwd", "type": "ASCII text"}, {"filename": "paths", "type": "ASCII text"}, {"filename": "paths.d", "type": "directory"}, {"filename": "periodic", "type": "directory"}, {"filename": "pf.anchors", "type": "directory"}, {"filename": "pf.conf", "type": "ASCII text"}, {"filename": "pf.os", "type": "ASCII text"}, {"filename": "php-fpm.conf.default", "type": "ASCII text"}, {"filename": "php-fpm.d", "type": "directory"}, {"filename": "php.ini.default", "type": "ASCII text"}, {"filename": "postfix", "type": "directory"}, {"filename": "ppp", "type": "directory"}, {"filename": "profile", "type": "ASCII text"}, {"filename": "protocols", "type": "ASCII text"}, {"filename": "racoon", "type": "directory"}, {"filename": "rc.common", "type": "ASCII text"}, {"filename": "rc.netboot", "type": "POSIX shell script text executable, ASCII text"}, {"filename": "resolv.conf", "type": "ASCII text"}, {"filename": "rmtab", "type": "empty"}, {"filename": "rpc", "type": "ASCII text"}, {"filename": "rtadvd.conf", "type": "ASCII text"}, {"filename": "security", "type": "directory"}, {"filename": "services", "type": "ASCII text"}, {"filename": "services.broker", "type": "ASCII text"}, {"filename": "shells", "type": "ASCII text"}, {"filename": "snmp", "type": "directory"}, {"filename": "ssh", "type": "directory"}, {"filename": "ssl", "type": "directory"}, {"filename": "sudo_lecture", "type": "ASCII text"}, {"filename": "sudoers", "type": "c program text, ASCII text"}, {"filename": "sudoers.d", "type": "directory"}, {"filename": "syslog.conf", "type": "ASCII text"}, {"filename": "thnuclnt", "type": "directory"}, {"filename": "ttys", "type": "ASCII text"}, {"filename": "wfs", "type": "directory"}, {"filename": "xtab", "type": "empty"}, {"filename": "zprofile", "type": "ASCII text"}, {"filename": "zshrc", "type": "ASCII text"}]
|
||||
88
tests/fixtures/osx-10.14.6/file2.out
vendored
Normal file
88
tests/fixtures/osx-10.14.6/file2.out
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
AFP.conf: data
|
||||
afpovertcp.cfg: ASCII text
|
||||
aliases: ASCII text
|
||||
aliases.db: Berkeley DB 1.85 (Hash, version 2, native byte-order)
|
||||
apache2: directory
|
||||
asl: directory
|
||||
asl.conf: ASCII text
|
||||
auto_home: ASCII text
|
||||
auto_master: ASCII text
|
||||
autofs.conf: ASCII text
|
||||
bashrc: ASCII text
|
||||
bashrc_Apple_Terminal: ASCII text
|
||||
com.apple.screensharing.agent.launchd: ASCII text, with no line terminators
|
||||
csh.cshrc: ASCII text
|
||||
csh.login: ASCII text
|
||||
csh.logout: ASCII text
|
||||
cups: directory
|
||||
defaults: directory
|
||||
dnsextd.conf: ASCII text
|
||||
emond.d: directory
|
||||
find.codes: empty
|
||||
fstab.hd: ASCII text
|
||||
ftpusers: ASCII text
|
||||
gettytab: ASCII text
|
||||
group: ASCII text
|
||||
hosts: ASCII text
|
||||
hosts.equiv: empty
|
||||
irbrc: Ruby script text, ASCII text
|
||||
kern_loader.conf: empty
|
||||
krb5.keytab: Kerberos Keytab file, realm=LKDC:SHA1.15090DD365668FBA1B0D2D3DD43FCB7CB9381160, principal=afpserver/LKDC:SHA1.15090DD365668FBA1B0D2D3DD43FCB7CB9381160, type=1, date=Tue Jul 2 15:52:04 2019, kvno=2
|
||||
localtime: timezone data, version 2, 4 gmt time flags, 4 std time flags, no leap seconds, 185 transition times, 4 abbreviation chars
|
||||
locate.rc: ASCII text
|
||||
mach_init.d: directory
|
||||
mach_init_per_login_session.d: directory
|
||||
mach_init_per_user.d: directory
|
||||
mail.rc: ASCII text
|
||||
man.conf: ASCII text
|
||||
manpaths: ASCII text
|
||||
manpaths.d: directory
|
||||
master.passwd: ASCII text
|
||||
nanorc: ASCII text
|
||||
networks: ASCII text
|
||||
newsyslog.conf: ASCII text
|
||||
newsyslog.d: directory
|
||||
nfs.conf: ASCII text
|
||||
notify.conf: ASCII text
|
||||
ntp.conf: ASCII text
|
||||
ntp_opendirectory.conf: ASCII text
|
||||
openldap: directory
|
||||
pam.d: directory
|
||||
passwd: ASCII text
|
||||
paths: ASCII text
|
||||
paths.d: directory
|
||||
periodic: directory
|
||||
pf.anchors: directory
|
||||
pf.conf: ASCII text
|
||||
pf.os: ASCII text
|
||||
php-fpm.conf.default: ASCII text
|
||||
php-fpm.d: directory
|
||||
php.ini.default: ASCII text
|
||||
postfix: directory
|
||||
ppp: directory
|
||||
profile: ASCII text
|
||||
protocols: ASCII text
|
||||
racoon: directory
|
||||
rc.common: ASCII text
|
||||
rc.netboot: POSIX shell script text executable, ASCII text
|
||||
resolv.conf: ASCII text
|
||||
rmtab: empty
|
||||
rpc: ASCII text
|
||||
rtadvd.conf: ASCII text
|
||||
security: directory
|
||||
services: ASCII text
|
||||
services.broker: ASCII text
|
||||
shells: ASCII text
|
||||
snmp: directory
|
||||
ssh: directory
|
||||
ssl: directory
|
||||
sudo_lecture: ASCII text
|
||||
sudoers: c program text, ASCII text
|
||||
sudoers.d: directory
|
||||
syslog.conf: ASCII text
|
||||
thnuclnt: directory
|
||||
ttys: ASCII text
|
||||
wfs: directory
|
||||
xtab: empty
|
||||
zprofile: ASCII text
|
||||
zshrc: ASCII text
|
||||
2
tests/fixtures/osx-10.14.6/ls-glob.json
vendored
2
tests/fixtures/osx-10.14.6/ls-glob.json
vendored
File diff suppressed because one or more lines are too long
1
tests/fixtures/osx-10.14.6/netstat-Abn.json
vendored
Normal file
1
tests/fixtures/osx-10.14.6/netstat-Abn.json
vendored
Normal file
File diff suppressed because one or more lines are too long
689
tests/fixtures/osx-10.14.6/netstat-Abn.out
vendored
Normal file
689
tests/fixtures/osx-10.14.6/netstat-Abn.out
vendored
Normal file
@@ -0,0 +1,689 @@
|
||||
Active Internet connections
|
||||
Socket Flowhash Proto Recv-Q Send-Q Local Address Foreign Address (state) rxbytes txbytes
|
||||
7fb03cb94d505aed cedd0cbf tcp4 0 0 192.168.1.221.5486 140.82.113.26.443 ESTABLISHED 4958 3996
|
||||
7fb03cb94d692475 1c9f9fcd tcp4 0 0 192.168.1.221.5480 208.91.113.36.443 ESTABLISHED 39554 9531
|
||||
7fb03cb94b25de55 dbe59bf8 tcp4 0 0 192.168.1.221.5478 140.82.112.26.443 ESTABLISHED 6022 6313
|
||||
7fb03cb95fad8165 6a3d6e4 tcp4 0 0 192.168.1.221.5450 192.168.1.201.4923 ESTABLISHED 1910 2803
|
||||
7fb03cb946c1cbcd 3c023c0 tcp6 0 0 2600:1700:bab0:d.5 2607:f8b0:4003:c.9 ESTABLISHED 167633 41617
|
||||
7fb03cb95fad77dd 3f163cd2 tcp4 0 0 192.168.1.221.5450 192.168.1.64.53380 ESTABLISHED 2592 3096
|
||||
7fb03cb94221360d cc0e0c2a tcp6 0 0 2600:1700:bab0:d.5 2603:1030:b00::e.4 ESTABLISHED 15646 15752
|
||||
7fb03cb937c20e4d 8e998322 tcp6 0 0 2600:1700:bab0:d.5 2620:1ec:21::14.44 ESTABLISHED 46800 45200
|
||||
7fb03cb93c75d475 d53fb648 tcp4 0 0 192.168.1.221.5452 35.236.87.93.8081 ESTABLISHED 102916 305797
|
||||
7fb03cb937c2140d e013f438 tcp6 0 0 2600:1700:bab0:d.5 2607:f8b0:4000:8.4 ESTABLISHED 91675 183353
|
||||
7fb03cb94b718aed bcd5aa6f tcp4 0 0 192.168.1.221.5452 192.168.1.88.49153 ESTABLISHED 1439 2749
|
||||
7fb03cb94b716e55 30944ff3 tcp4 0 0 192.168.1.221.5451 192.168.1.89.49152 ESTABLISHED 1412 2852
|
||||
7fb03cb93c75b7dd d54ab36f tcp4 0 0 192.168.1.221.5450 192.168.1.72.55617 ESTABLISHED 1098 3946
|
||||
7fb03cb93b2d6e55 d11ddd76 tcp4 0 0 192.168.1.221.5451 52.114.148.56.443 ESTABLISHED 54904 37123
|
||||
7fb03cb94a8f8d0d 88c31bcb tcp6 0 0 fe80::aede:48ff:.5 fe80::aede:48ff:.4 ESTABLISHED 929 1397
|
||||
7fb03cb94a8f988d a10400b8 tcp6 0 0 fe80::aede:48ff:.5 fe80::aede:48ff:.4 ESTABLISHED 56095 13875
|
||||
7fb03cb948e8f88d cd67a7b tcp6 0 0 2600:1700:bab0:d.5 2607:f8b0:4003:c.5 ESTABLISHED 5331 7172
|
||||
7fb03cb94bcb6475 4ca24b6e tcp4 31 0 192.168.1.221.5442 35.236.87.93.8081 CLOSE_WAIT 1424 2595
|
||||
7fb03cb94b4f518d 25c58fec tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 1326 1023
|
||||
7fb03cb94bcb47dd b164479 tcp4 0 0 127.0.0.1.53755 127.0.0.1.53763 ESTABLISHED 3182238 0
|
||||
7fb03cb94b433e55 f28b9248 tcp4 0 0 127.0.0.1.53763 127.0.0.1.53755 ESTABLISHED 51430 0
|
||||
7fb03cb94b719475 316c063a tcp4 0 0 192.168.1.221.5359 104.155.21.255.555 ESTABLISHED 73216 1004723
|
||||
7fb03cb946c1ba8d d32bc928 tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 693 807
|
||||
7fb03cb94c066aed fb73c2ca tcp4 0 0 192.168.1.221.5263 17.57.144.20.5223 ESTABLISHED 27110 79402
|
||||
7fb03cb94d2ebaed 22dc0e42 tcp4 0 0 192.168.1.221.5179 192.168.1.80.548 ESTABLISHED 8433051 3259730
|
||||
7fb03cb94a8f818d 5e12e220 tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 3768 1815
|
||||
7fb03cb94a8f704d 16ca6e94 tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 684 3761
|
||||
7fb03cb942212a8d da4b1f7d tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 1470 1167
|
||||
7fb03cb948e8dbcd 4aeb1af1 tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 693 807
|
||||
7fb03cb94a8f92cd 6859cfec tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 765 663
|
||||
7fb03cb946c1e2cd 248b598b tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 693 807
|
||||
7fb03cb942213bcd 56762cbf tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 693 807
|
||||
7fb03cb948e8d60d d29e9efa tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 3668 1997
|
||||
7fb03cb946c1d18d 60f3fa15 tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 1053 1167
|
||||
7fb03cb94b4347dd a1f7c428 tcp4 0 0 192.168.1.221.5164 35.235.123.194.555 CLOSE_WAIT 52 1084
|
||||
7fb03cb948047aed ceac8539 tcp4 0 0 192.168.1.221.5164 35.235.123.194.555 CLOSE_WAIT 52 1136
|
||||
7fb03cb963503e55 d98dfd14 tcp4 0 0 192.168.1.221.5164 35.235.123.194.555 CLOSE_WAIT 52 1200
|
||||
7fb03cb937c202cd 2e36177f tcp6 0 0 fe80::aede:48ff:.6 fe80::aede:48ff:.4 ESTABLISHED 893 26581
|
||||
7fb03cb946c1c60d aaabe009 tcp6 0 0 fe80::aede:48ff:.5 fe80::aede:48ff:.5 ESTABLISHED 985405 1688994
|
||||
7fb03cb948536475 dc1e01a0 tcp4 0 0 192.168.1.221.5879 96.45.36.31.443 ESTABLISHED 3654 3229
|
||||
7fb03cb94b38e7dd e3b8b675 tcp4 0 0 127.0.0.1.9592 127.0.0.1.58704 CLOSE_WAIT 29513 0
|
||||
7fb03cb94d691165 7eee3b1 tcp4 31 0 192.168.1.221.5346 35.236.87.93.8081 CLOSE_WAIT 1218 6437
|
||||
7fb03cb948e8f2cd e7486da9 tcp6 0 0 fe80::aede:48ff:.5 fe80::aede:48ff:.4 ESTABLISHED 893 111664
|
||||
7fb03cb94221304d 3e982c00 tcp6 0 0 fe80::aede:48ff:.5 fe80::aede:48ff:.4 ESTABLISHED 965 99241
|
||||
7fb03cb937c2088d 30000ae7 tcp6 0 0 fe80::aede:48ff:.5 fe80::aede:48ff:.4 ESTABLISHED 893 125491
|
||||
7fb03cb94b4f4bcd 57e076f4 tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 889 128896
|
||||
7fb03cb94221474d 6465b356 tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 14206 134302
|
||||
7fb03cb94a8f6a8d bed25b95 tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 1909 120628
|
||||
7fb03cb937c1fd0d 33613be8 tcp6 0 0 fe80::aede:48ff:.4 fe80::aede:48ff:.4 ESTABLISHED 684 259247
|
||||
7fb03cb93c70600d 777662f1 udp4 0 0 *.58043 *.* 48 76
|
||||
7fb03cb93c709f4d b64a4fe1 udp4 0 0 *.63678 *.* 98 138
|
||||
7fb03cb93c708c0d 48ba21c8 udp4 0 0 *.60774 *.* 48 76
|
||||
7fb03cb93c70760d 7f0afb2c udp4 0 0 *.51411 *.* 98 138
|
||||
7fb03cb93c707b8d 7c49f0f1 udp4 0 0 *.57119 *.* 48 76
|
||||
7fb03cb93c70734d c750f7f0 udp4 0 0 *.61217 *.* 98 138
|
||||
7fb03cb93c70810d 2308a9b6 udp4 0 0 *.56091 *.* 43700 46473
|
||||
7fb03cb93c707e4d 4b2ff4b3 udp4 0 0 *.58807 *.* 45885 44260
|
||||
7fb03cb9371e2d4d 8d16cd6b udp4 0 0 *.54338 *.* 0 6138
|
||||
7fb03cb93721310d f4140344 udp4 0 0 *.3722 *.* 0 512
|
||||
7fb03cb93d5b800d 0 udp4 0 0 *.5353 *.* 2554929 0
|
||||
7fb03cb93c7ba60d 7fd9393b udp46 0 0 *.61224 *.* 38123 35312
|
||||
7fb03cb93c7b8a8d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb939b0470d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93c706dcd f725c38f udp4 0 0 127.0.0.1.63995 *.* 0 1253564
|
||||
7fb03cb93c708ecd 5ed0c674 udp4 0 0 192.168.1.221.5063 *.* 0 1253656
|
||||
7fb03cb93c70868d 0 udp4 0 0 *.33354 *.* 496 0
|
||||
7fb03cb93c70658d 0 udp4 0 0 *.33355 *.* 1253656 0
|
||||
7fb03cb934b578cd 530d4d40 udp6 0 0 *.61982 *.* 29478 27730
|
||||
7fb03cb934b59c8d 91b8382 udp4 0 0 *.61982 *.* 21216 15688
|
||||
7fb03cb934b56dcd ca5be4ea udp6 0 0 *.52378 *.* 28968 27260
|
||||
7fb03cb934b5760d 3462e1b2 udp4 0 0 *.52378 *.* 21726 16058
|
||||
7fb03cb934b5944d 58e06369 udp6 0 0 *.53910 *.* 28684 27063
|
||||
7fb03cb934b5a20d e03584 udp4 0 0 *.53910 *.* 21513 15841
|
||||
7fb03cb934b55d4d e91dd2ad udp6 0 0 *.57674 *.* 32262 30952
|
||||
7fb03cb934b5970d da8119f1 udp4 0 0 *.57674 *.* 24510 18834
|
||||
7fb03cb934b599cd 3504cd68 udp6 0 0 *.62448 *.* 30666 29150
|
||||
7fb03cb934b557cd 941a5612 udp4 0 0 *.62448 *.* 25992 19952
|
||||
7fb03cb934b58c0d c487a471 udp6 0 0 *.55681 *.* 29380 28035
|
||||
7fb03cb934b5600d c4b0913 udp4 0 0 *.55681 *.* 26781 20570
|
||||
7fb03cb93716444d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93b6df00d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93c8bbd4d 47d61919 udp4 0 0 *.5353 *.* 3818017 26658
|
||||
7fb03cb93c8bc00d 8148de2d udp4 0 0 *.5353 *.* 3811093 26658
|
||||
7fb03cb93c8bc2cd 41ad85a1 udp46 0 0 *.5353 *.* 22458 29658
|
||||
7fb03cb93c8bfc8d 3d59980f udp46 0 0 *.5353 *.* 0 29658
|
||||
7fb03cb93c8bd34d 73cc988e udp46 0 0 *.5353 *.* 55268610 29658
|
||||
7fb03cb93c8bf44d dee9266c udp4 0 0 *.5353 *.* 162940592 26658
|
||||
7fb03cb93c8bdb8d 0 udp46 0 0 *.5353 *.* 0 0
|
||||
7fb03cb937211dcd b4871709 udp4 0 0 *.51226 *.* 1251903 2351183
|
||||
7fb03cb9372154cd 21b31d88 udp4 0 0 127.0.0.1.61491 *.* 733104 1160292
|
||||
7fb03cb93b74a3cd 0 udp4 0 0 *.6096 *.* 0 0
|
||||
7fb03cb93c7bb10d f1ac8ec5 udp4 0 0 *.58997 *.* 30600076 18446784
|
||||
7fb03cb93b70ea8d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93b7129cd 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93b71270d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93b711c0d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93b72d70d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93b72bb8d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93b747a8d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93bc90a8d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93bc9520d 97a44721 udp4 0 0 *.52551 *.* 0 65984
|
||||
7fb03cb93bc90d4d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93bc9100d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93bc94f4d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93bc9208d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93c7bcc8d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93c8beecd 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93c8be10d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93c8be3cd 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93c8be68d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93d5b7a8d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93c70894d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93721444d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb937160a8d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb937160d4d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93716208d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93c70a20d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93c70944d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93c70684d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb939b049cd 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb9371654cd 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93716100d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93716520d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb937164f4d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb9371628cd 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb937162b8d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb937162e4d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb9371e32cd 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb934b56b0d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb93721394d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb937cbcd4d 0 udp4 0 0 *.* *.* 0 0
|
||||
7fb03cb937cbf10d 0 udp46 0 0 *.* *.* 0 0
|
||||
7fb03cb93721184d b180dc9e udp6 0 0 *.5353 *.* 57357377 15237561
|
||||
7fb03cb9372149cd 6fa9aaf7 udp4 0 0 *.5353 *.* 174466390 26656837
|
||||
7fb03cb934b583cd 0 udp4 0 0 *.9595 *.* 0 0
|
||||
7fb03cb934b5810d 5b0b6f0f udp4 0 0 *.138 *.* 692460 126560
|
||||
7fb03cb934b57e4d dd966d84 udp4 0 0 *.137 *.* 3666438 3028491
|
||||
7fb03cb939ad73cd 0 icm4 8136 0 *.* *.* 1325516 0
|
||||
Active LOCAL (UNIX) domain sockets
|
||||
Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr
|
||||
7fb03cb95130f135 stream 1 0 0 7fb03cb95130efa5 0 0
|
||||
7fb03cb95130efa5 stream 0 0 0 7fb03cb95130f135 0 0
|
||||
7fb03cb95130eaf5 stream 0 0 0 7fb03cb95130e70d 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/docker.raw.sock
|
||||
7fb03cb95130e70d stream 0 0 0 7fb03cb95130eaf5 0 0
|
||||
7fb03cb95130da8d stream 0 0 0 7fb03cb95130f38d 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/docker.raw.sock
|
||||
7fb03cb95130f38d stream 0 0 0 7fb03cb95130da8d 0 0
|
||||
7fb03cb95130e89d stream 0 0 0 7fb03cb95130cd45 0 0
|
||||
7fb03cb95130cd45 stream 0 0 0 7fb03cb95130e89d 0 0
|
||||
7fb03cb95130d9c5 stream 0 0 0 7fb03cb95130de75 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/docker.raw.sock
|
||||
7fb03cb95130de75 stream 0 0 0 7fb03cb95130d9c5 0 0
|
||||
7fb03cb95130e0cd stream 0 0 0 0 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/docker.raw.sock
|
||||
7fb03cb95130cc7d stream 0 0 0 0 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/docker.raw.sock
|
||||
7fb03cb94d74825d stream 0 0 0 7fb03cb94d748965 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94d748965 stream 0 0 0 7fb03cb94d74825d 0 0
|
||||
7fb03cb94d746a25 stream 0 0 0 7fb03cb94d7471f5 0 0 /var/run/fctservctl.sock
|
||||
7fb03cb94d7471f5 stream 0 0 0 7fb03cb94d746a25 0 0
|
||||
7fb03cb94d747e75 stream 0 0 0 7fb03cb94d74695d 0 0 /var/run/fctservctl.sock
|
||||
7fb03cb94d74695d stream 0 0 0 7fb03cb94d747e75 0 0
|
||||
7fb03cb94d747515 stream 0 0 0 7fb03cb94d747ce5 0 0 /var/run/fctservctl.sock
|
||||
7fb03cb94d747ce5 stream 0 0 0 7fb03cb94d747515 0 0
|
||||
7fb03cb94d748e15 stream 0 0 0 7fb03cb94d748bbd 0 0 /var/run/fctservctl.sock
|
||||
7fb03cb94d748bbd stream 0 0 0 7fb03cb94d748e15 0 0
|
||||
7fb03cb937d38835 stream 0 0 0 7fb03cb937d389c5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb937d389c5 stream 0 0 0 7fb03cb937d38835 0 0
|
||||
7fb03cb945d3b2c5 stream 0 0 0 7fb03cb945d396a5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb945d396a5 stream 0 0 0 7fb03cb945d3b2c5 0 0
|
||||
7fb03cb945d3b5e5 stream 0 0 0 7fb03cb945d3a645 0 0 /var/run/mDNSResponder
|
||||
7fb03cb945d3a645 stream 0 0 0 7fb03cb945d3b5e5 0 0
|
||||
7fb03cb945d39835 stream 0 0 0 7fb03cb945d3ac85 0 0 /var/run/mDNSResponder
|
||||
7fb03cb945d3ac85 stream 0 0 0 7fb03cb945d39835 0 0
|
||||
7fb03cb945d3a89d stream 0 0 0 7fb03cb945d3b38d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb945d3b38d stream 0 0 0 7fb03cb945d3a89d 0 0
|
||||
7fb03cb94a63aed5 stream 0 0 0 7fb03cb94a63cfa5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63cfa5 stream 0 0 0 7fb03cb94a63aed5 0 0
|
||||
7fb03cb94a63ae0d stream 0 0 0 7fb03cb94a63b5dd 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63b5dd stream 0 0 0 7fb03cb94a63ae0d 0 0
|
||||
7fb03cb94a63cedd stream 0 0 0 7fb03cb94a63b44d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63b44d stream 0 0 0 7fb03cb94a63cedd 0 0
|
||||
7fb03cb94a63d38d stream 0 0 0 7fb03cb94a63aa25 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63aa25 stream 0 0 0 7fb03cb94a63d38d 0 0
|
||||
7fb03cb95130c95d stream 0 0 0 7fb03cb95130d1f5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb95130d1f5 stream 0 0 0 7fb03cb95130c95d 0 0
|
||||
7fb03cb945d38a25 stream 0 0 0 7fb03cb945d3a195 0 0 /var/run/mDNSResponder
|
||||
7fb03cb945d3a195 stream 0 0 0 7fb03cb945d38a25 0 0
|
||||
7fb03cb945d3aa2d stream 0 0 0 0 0 0
|
||||
7fb03cb95130f5e5 stream 0 0 0 7fb03cb95130e4b5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb95130e4b5 stream 0 0 0 7fb03cb95130f5e5 0 0
|
||||
7fb03cb94d74906d stream 0 0 0 7fb03cb94d746e0d 0 0
|
||||
7fb03cb94d746e0d stream 8 0 0 7fb03cb94d74906d 0 0
|
||||
7fb03cb937d39325 stream 0 0 0 7fb03cb937d385dd 0 0
|
||||
7fb03cb937d385dd stream 0 0 0 7fb03cb937d39325 0 0
|
||||
7fb03cb937d3876d stream 0 0 0 7fb03cb937d3a455 0 0
|
||||
7fb03cb937d3a455 stream 0 0 0 7fb03cb937d3876d 0 0
|
||||
7fb03cb937d37a25 stream 0 0 0 7fb03cb937d386a5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb937d386a5 stream 0 0 0 7fb03cb937d37a25 0 0
|
||||
7fb03cb937d39195 stream 0 0 0 7fb03cb937d38f3d 0 0
|
||||
7fb03cb937d38f3d stream 0 0 0 7fb03cb937d39195 0 0
|
||||
7fb03cb937d37895 stream 0 0 0 7fb03cb937d37ed5 0 0
|
||||
7fb03cb937d37ed5 stream 0 0 0 7fb03cb937d37895 0 0
|
||||
7fb03cb937d390cd stream 0 0 0 7fb03cb937d3a38d 0 0
|
||||
7fb03cb937d3a38d stream 0 0 0 7fb03cb937d390cd 0 0
|
||||
7fb03cb945d3b455 stream 0 0 0 7fb03cb945d3895d 0 0
|
||||
7fb03cb945d3895d stream 0 0 0 7fb03cb945d3b455 0 0
|
||||
7fb03cb945d392bd stream 0 0 0 7fb03cb945d38e0d 0 0
|
||||
7fb03cb945d38e0d stream 0 0 0 7fb03cb945d392bd 0 0
|
||||
7fb03cb945d3b135 stream 0 0 0 7fb03cb945d38ed5 0 0
|
||||
7fb03cb945d38ed5 stream 0 0 0 7fb03cb945d3b135 0 0
|
||||
7fb03cb945d3976d stream 0 0 0 7fb03cb945d3912d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb945d3912d stream 0 0 0 7fb03cb945d3976d 0 0
|
||||
7fb03cb945d391f5 stream 0 0 0 7fb03cb945d39385 0 0
|
||||
7fb03cb945d39385 stream 0 0 0 7fb03cb945d391f5 0 0
|
||||
7fb03cb945d38c7d stream 0 0 7fb03cb94b87f5d5 0 0 0 /var/folders/vr/4gybj0rs1_51r0sy8d5qv3jm0000gn/T/.com.microsoft.teams.okHfqO/SS
|
||||
7fb03cb945d39c1d stream 0 0 0 7fb03cb945d39e75 0 0 /var/run/mDNSResponder
|
||||
7fb03cb945d39e75 stream 0 0 0 7fb03cb945d39c1d 0 0
|
||||
7fb03cb94a63ac7d stream 0 0 0 7fb03cb94a63caf5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63caf5 stream 0 0 0 7fb03cb94a63ac7d 0 0
|
||||
7fb03cb95130d515 stream 0 0 0 7fb03cb95130ce0d 0 0
|
||||
7fb03cb95130ce0d stream 0 0 0 7fb03cb95130d515 0 0
|
||||
7fb03cb95130caed stream 0 0 0 7fb03cb95130ca25 0 0
|
||||
7fb03cb95130ca25 stream 0 0 0 7fb03cb95130caed 0 0
|
||||
7fb03cb95130d385 stream 0 0 0 7fb03cb95130f06d 0 0
|
||||
7fb03cb95130f06d stream 0 0 0 7fb03cb95130d385 0 0
|
||||
7fb03cb95130dc1d stream 0 0 0 7fb03cb95130e7d5 0 0
|
||||
7fb03cb95130e7d5 stream 0 0 0 7fb03cb95130dc1d 0 0
|
||||
7fb03cb95130ced5 stream 0 0 0 7fb03cb95130f51d 0 0
|
||||
7fb03cb95130f51d stream 0 0 0 7fb03cb95130ced5 0 0
|
||||
7fb03cb95130df3d stream 0 0 0 7fb03cb95130c7cd 0 0
|
||||
7fb03cb95130c7cd stream 0 0 0 7fb03cb95130df3d 0 0
|
||||
7fb03cb95130e195 stream 0 0 0 7fb03cb95130e325 0 0
|
||||
7fb03cb95130e325 stream 0 0 0 7fb03cb95130e195 0 0
|
||||
7fb03cb95130f1fd stream 0 0 0 7fb03cb95130ea2d 0 0
|
||||
7fb03cb95130ea2d stream 0 0 0 7fb03cb95130f1fd 0 0
|
||||
7fb03cb95130d2bd stream 0 0 0 7fb03cb95130c895 0 0
|
||||
7fb03cb95130c895 stream 0 0 0 7fb03cb95130d2bd 0 0
|
||||
7fb03cb95130cbb5 stream 0 0 7fb03cb937de855d 0 0 0 /Library/Application Support/LANDesk/tmp/socket/sys
|
||||
7fb03cb95130d065 stream 0 0 0 7fb03cb95130d5dd 0 0
|
||||
7fb03cb95130d5dd stream 0 0 0 7fb03cb95130d065 0 0
|
||||
7fb03cb95130ec85 stream 0 0 0 7fb03cb95130ee15 0 0
|
||||
7fb03cb95130ee15 stream 0 0 0 7fb03cb95130ec85 0 0
|
||||
7fb03cb95130d76d stream 0 0 0 7fb03cb95130d12d 0 0
|
||||
7fb03cb95130d12d stream 0 0 0 7fb03cb95130d76d 0 0
|
||||
7fb03cb95130ed4d stream 0 0 0 7fb03cb95130eedd 0 0
|
||||
7fb03cb95130eedd stream 0 0 0 7fb03cb95130ed4d 0 0
|
||||
7fb03cb95130e965 stream 0 0 0 7fb03cb95130e3ed 0 0 /var/run/mDNSResponder
|
||||
7fb03cb95130e3ed stream 0 0 0 7fb03cb95130e965 0 0
|
||||
7fb03cb937d3925d stream 0 0 0 7fb03cb937d39c85 0 0 /var/run/mDNSResponder
|
||||
7fb03cb937d39c85 stream 0 0 0 7fb03cb937d3925d 0 0
|
||||
7fb03cb937d381f5 stream 0 0 0 0 0 0
|
||||
7fb03cb935b005e5 stream 0 0 0 7fb03cb935afd895 0 0 /var/run/mDNSResponder
|
||||
7fb03cb935afd895 stream 0 0 0 7fb03cb935b005e5 0 0
|
||||
7fb03cb94d746ed5 stream 0 0 0 7fb03cb94d748195 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94d748195 stream 0 0 0 7fb03cb94d746ed5 0 0
|
||||
7fb03cb94a63ba8d stream 0 0 0 7fb03cb94a63d5e5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63d5e5 stream 0 0 0 7fb03cb94a63ba8d 0 0
|
||||
7fb03cb94a63cc85 stream 0 0 0 7fb03cb94a63a895 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63a895 stream 0 0 0 7fb03cb94a63cc85 0 0
|
||||
7fb03cb94a63c965 stream 0 0 0 7fb03cb94a63d51d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63d51d stream 0 0 0 7fb03cb94a63c965 0 0
|
||||
7fb03cb94d747f3d stream 0 0 0 7fb03cb94d7480cd 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94d7480cd stream 0 0 0 7fb03cb94d747f3d 0 0
|
||||
7fb03cb94a63abb5 stream 0 0 0 7fb03cb94a63c7d5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63c7d5 stream 0 0 0 7fb03cb94a63abb5 0 0
|
||||
7fb03cb95130dce5 stream 0 0 0 7fb03cb95130e005 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/filesystem-event.sock
|
||||
7fb03cb95130e005 stream 0 0 0 7fb03cb95130dce5 0 0
|
||||
7fb03cb935b001fd stream 0 0 0 7fb03cb935afdaed 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/docker.raw.sock
|
||||
7fb03cb935afdaed stream 0 0 0 7fb03cb935b001fd 0 0
|
||||
7fb03cb935b0038d stream 0 0 7fb03cb9350ead1d 0 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/docker.raw.sock
|
||||
7fb03cb935b002c5 stream 0 0 0 7fb03cb935aff0cd 0 0 vpnkit.data.sock
|
||||
7fb03cb935aff0cd stream 0 0 0 7fb03cb935b002c5 0 0
|
||||
7fb03cb935b00135 stream 0 0 0 7fb03cb935afdbb5 0 0 backend-for-guest.sock
|
||||
7fb03cb935afdbb5 stream 0 0 0 7fb03cb935b00135 0 0
|
||||
7fb03cb935affaf5 stream 0 0 0 7fb03cb935affd4d 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/lifecycle-server.sock
|
||||
7fb03cb935affd4d stream 0 0 0 7fb03cb935affaf5 0 0
|
||||
7fb03cb935affa2d stream 0 0 0 7fb03cb935affe15 0 0 vms/0/00000002.000005f4
|
||||
7fb03cb935affe15 stream 0 0 0 7fb03cb935affa2d 0 0
|
||||
7fb03cb935b0006d stream 0 0 0 7fb03cb935afffa5 0 0 vms/0/connect
|
||||
7fb03cb935afffa5 stream 0 0 0 7fb03cb935b0006d 0 0
|
||||
7fb03cb935affedd stream 0 0 0 7fb03cb935afdc7d 0 0 vms/0/00000002.000005f4
|
||||
7fb03cb935afdc7d stream 0 0 0 7fb03cb935affedd 0 0
|
||||
7fb03cb935afdd45 stream 0 0 0 7fb03cb935affc85 0 0 vms/0/connect
|
||||
7fb03cb935affc85 stream 0 0 0 7fb03cb935afdd45 0 0
|
||||
7fb03cb935afde0d stream 0 0 0 7fb03cb935affbbd 0 0 vms/0/00000002.000005f4
|
||||
7fb03cb935affbbd stream 0 0 0 7fb03cb935afde0d 0 0
|
||||
7fb03cb935afded5 stream 0 0 0 7fb03cb935aff965 0 0 vms/0/connect
|
||||
7fb03cb935aff965 stream 0 0 0 7fb03cb935afded5 0 0
|
||||
7fb03cb935aff89d stream 0 0 0 7fb03cb935aff7d5 0 0 vms/0/00000002.000005f4
|
||||
7fb03cb935aff7d5 stream 0 0 0 7fb03cb935aff89d 0 0
|
||||
7fb03cb935afdf9d stream 0 0 0 7fb03cb935aff70d 0 0 vms/0/connect
|
||||
7fb03cb935aff70d stream 0 0 0 7fb03cb935afdf9d 0 0
|
||||
7fb03cb935aff645 stream 0 0 0 7fb03cb935aff57d 0 0 vms/0/connect
|
||||
7fb03cb935aff57d stream 0 0 0 7fb03cb935aff645 0 0
|
||||
7fb03cb935afe065 stream 0 0 0 7fb03cb935aff4b5 0 0 vms/0/00000002.000005f4
|
||||
7fb03cb935aff4b5 stream 0 0 0 7fb03cb935afe065 0 0
|
||||
7fb03cb935aff3ed stream 0 0 7fb03cb935cd2d9d 0 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/filesystem-event.sock
|
||||
7fb03cb935aff325 stream 0 0 7fb03cb93609fca5 0 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/lifecycle-server.sock
|
||||
7fb03cb935aff25d stream 0 0 7fb03cb94cddc36d 0 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/diagnosticd.sock
|
||||
7fb03cb935afe12d stream 0 0 0 7fb03cb935afe1f5 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/vms/0/00000002.00001003
|
||||
7fb03cb935afe1f5 stream 0 0 0 7fb03cb935afe12d 0 0
|
||||
7fb03cb935aff195 stream 0 0 0 7fb03cb935afe515 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/memlogdq.sock
|
||||
7fb03cb935afe515 stream 0 0 0 7fb03cb935aff195 0 0
|
||||
7fb03cb935afe44d stream 0 0 7fb03cb9350eac25 0 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/memlogdq.sock
|
||||
7fb03cb935afe8fd stream 0 0 0 7fb03cb935afedad 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/vms/0/00000002.000007cf
|
||||
7fb03cb935afedad stream 0 0 0 7fb03cb935afe8fd 0 0
|
||||
7fb03cb935aff005 stream 0 0 7fb03cb938b763e5 0 0 0 vms/0/00000003.000005f5
|
||||
7fb03cb935afef3d stream 0 0 7fb03cb938b761f5 0 0 0 vms/0/00000003.00000948
|
||||
7fb03cb935afe5dd stream 0 0 7fb03cb938b760fd 0 0 0 vms/0/connect
|
||||
7fb03cb935afe6a5 stream 0 0 0 7fb03cb935afe76d 0 0 vpnkit.eth.sock
|
||||
7fb03cb935afe76d stream 0 0 0 7fb03cb935afe6a5 0 0
|
||||
7fb03cb935afee75 stream 0 0 7fb03cb9360a12ed 0 0 0 backend.sock
|
||||
7fb03cb935afece5 stream 0 0 7fb03cb935cd29bd 0 0 0 filesystem-export.sock
|
||||
7fb03cb935afec1d stream 0 0 7fb03cb935cd43e5 0 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/vms/0/00000002.00001003
|
||||
7fb03cb935afe9c5 stream 0 0 7fb03cb935cd40fd 0 0 0 filesystem-volume.sock
|
||||
7fb03cb935afeb55 stream 0 0 7fb03cb9350eaa35 0 0 0 docker-api.sock
|
||||
7fb03cb935afea8d stream 0 0 7fb03cb9350eab2d 0 0 0 backend-for-guest.sock
|
||||
7fb03cb93501b065 stream 0 0 7fb03cb9350ea36d 0 0 0 vpnkit.data.sock
|
||||
7fb03cb937d37bb5 stream 0 0 7fb03cb9350ea465 0 0 0 vpnkit.port.sock
|
||||
7fb03cb937d3a5e5 stream 0 0 7fb03cb950a0dca5 0 0 0 docker.sock
|
||||
7fb03cb937d3a51d stream 0 0 7fb03cb950ab1005 0 0 0 vpnkit.pcap.sock
|
||||
7fb03cb94d7495e5 stream 0 0 7fb03cb950ab0f0d 0 0 0 vpnkit.diag.sock
|
||||
7fb03cb94d746895 stream 0 0 7fb03cb950aafd9d 0 0 0 vpnkit.eth.sock
|
||||
7fb03cb94d7467cd stream 0 0 7fb03cb950ab0085 0 0 0 osxfs.sock
|
||||
7fb03cb94d746bb5 stream 0 0 7fb03cb950ab0a35 0 0 0 vms/0/00000002.000005f4
|
||||
7fb03cb94d7496ad stream 0 0 7fb03cb950a1dab5 0 0 0 /Users/kbrazil/Library/Containers/com.docker.docker/Data/gui-api.sock
|
||||
7fb03cb94d7492c5 stream 0 0 0 7fb03cb94d746aed 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94d746aed stream 0 0 0 7fb03cb94d7492c5 0 0
|
||||
7fb03cb94d748d4d stream 0 0 0 7fb03cb94d7472bd 0 0 /var/run/fctservctl.sock
|
||||
7fb03cb94d7472bd stream 0 0 0 7fb03cb94d748d4d 0 0
|
||||
7fb03cb94d748c85 stream 0 0 0 7fb03cb94d747385 0 0 /var/run/fctservctl.sock
|
||||
7fb03cb94d747385 stream 0 0 0 7fb03cb94d748c85 0 0
|
||||
7fb03cb94d748af5 stream 0 0 0 7fb03cb94d747835 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94d747835 stream 0 0 0 7fb03cb94d748af5 0 0
|
||||
7fb03cb94d748a2d stream 0 0 0 7fb03cb94d74776d 0 0 /var/run/fctservctl.sock
|
||||
7fb03cb94d74776d stream 145 0 0 7fb03cb94d748a2d 0 0
|
||||
7fb03cb94d74889d stream 0 0 0 7fb03cb94d7478fd 0 0 /var/run/fctservctl.sock
|
||||
7fb03cb94d7478fd stream 0 0 0 7fb03cb94d74889d 0 0
|
||||
7fb03cb94d74870d stream 0 0 0 7fb03cb94d7487d5 0 0 /var/run/fctservctl.sock
|
||||
7fb03cb94d7487d5 stream 0 0 0 7fb03cb94d74870d 0 0
|
||||
7fb03cb94d748645 stream 0 0 0 7fb03cb94d7479c5 0 0 /var/run/fctservctl.sock
|
||||
7fb03cb94d7479c5 stream 0 0 0 7fb03cb94d748645 0 0
|
||||
7fb03cb94d747a8d stream 0 0 0 7fb03cb94d74857d 0 0 /tmp/olisne-WY4G9IZafUNsloCollectorServicePipe
|
||||
7fb03cb94d74857d stream 0 0 0 7fb03cb94d747a8d 0 0
|
||||
7fb03cb94d7484b5 stream 0 0 0 7fb03cb94d747b55 0 0 /var/run/fctservctl.sock
|
||||
7fb03cb94d747b55 stream 0 0 0 7fb03cb94d7484b5 0 0
|
||||
7fb03cb94d747c1d stream 0 0 0 7fb03cb94d748325 0 0 /var/run/fctservctl.sock
|
||||
7fb03cb94d748325 stream 0 0 0 7fb03cb94d747c1d 0 0
|
||||
7fb03cb94d7483ed stream 0 0 7fb03cb94db01655 0 0 0 /tmp/fctvpnctl.sock_501
|
||||
7fb03cb94a63bc1d stream 0 0 0 7fb03cb94a63c645 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63c645 stream 0 0 0 7fb03cb94a63bc1d 0 0
|
||||
7fb03cb94a63bce5 stream 0 0 0 7fb03cb94a63c57d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63c57d stream 0 0 0 7fb03cb94a63bce5 0 0
|
||||
7fb03cb94a63bdad stream 0 0 0 7fb03cb94a63c4b5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63c4b5 stream 0 0 0 7fb03cb94a63bdad 0 0
|
||||
7fb03cb94a63be75 stream 0 0 0 7fb03cb94a63c3ed 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63c3ed stream 0 0 0 7fb03cb94a63be75 0 0
|
||||
7fb03cb94a63bf3d stream 0 0 0 7fb03cb94a63c325 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63c325 stream 0 0 0 7fb03cb94a63bf3d 0 0
|
||||
7fb03cb94a63c195 stream 0 0 0 7fb03cb94a63c005 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63c005 stream 0 0 0 7fb03cb94a63c195 0 0
|
||||
7fb03cb94a63c0cd stream 0 0 0 7fb03cb94a63c25d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb94a63c25d stream 0 0 0 7fb03cb94a63c0cd 0 0
|
||||
7fb03cb945d3ad4d stream 0 0 0 7fb03cb93501b835 0 0 /var/run/mDNSResponder
|
||||
7fb03cb945d3ae15 stream 0 0 0 7fb03cb937d377cd 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93501b835 stream 0 0 0 7fb03cb945d3ad4d 0 0
|
||||
7fb03cb937d377cd stream 0 0 0 7fb03cb945d3ae15 0 0
|
||||
7fb03cb937d3a6ad stream 0 0 0 7fb03cb937d3a06d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb937d3a06d stream 0 0 0 7fb03cb937d3a6ad 0 0
|
||||
7fb03cb945d387cd stream 0 0 7fb03cb94d0e4a35 0 0 0 /Users/kbrazil/Library/Application Support/Fortinet/FortiClient/credentialstore.sock
|
||||
7fb03cb937d3812d stream 0 0 0 7fb03cb937d3a2c5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb937d3a2c5 stream 0 0 0 7fb03cb937d3812d 0 0
|
||||
7fb03cb945d395dd stream 0 0 0 7fb03cb945d39515 0 0 /var/run/mDNSResponder
|
||||
7fb03cb945d39515 stream 0 0 0 7fb03cb945d395dd 0 0
|
||||
7fb03cb945d39ce5 stream 0 0 0 7fb03cb945d39dad 0 0 /var/run/mDNSResponder
|
||||
7fb03cb945d39dad stream 0 0 0 7fb03cb945d39ce5 0 0
|
||||
7fb03cb937d39e15 stream 0 0 0 7fb03cb937d39645 0 0 /var/run/mDNSResponder
|
||||
7fb03cb937d39645 stream 0 0 0 7fb03cb937d39e15 0 0
|
||||
7fb03cb937d39af5 stream 0 0 7fb03cb9418d26cd 0 0 0 /var/folders/vr/4gybj0rs1_51r0sy8d5qv3jm0000gn/T/.com.google.Chrome.ucLRTi/SingletonSocket
|
||||
7fb03cb93ceaeaed stream 0 0 0 7fb03cb93ceb151d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93ceb151d stream 0 0 0 7fb03cb93ceaeaed 0 0
|
||||
7fb03cb93ceae95d stream 0 0 0 7fb03cb93ceb138d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93ceb138d stream 0 0 0 7fb03cb93ceae95d 0 0
|
||||
7fb03cb93ceb12c5 stream 0 0 0 7fb03cb93ceaed45 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93ceaed45 stream 0 0 0 7fb03cb93ceb12c5 0 0
|
||||
7fb03cb93ceaee0d stream 0 0 0 7fb03cb93ceaeed5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93ceaeed5 stream 0 0 0 7fb03cb93ceaee0d 0 0
|
||||
7fb03cb93ceb106d stream 0 0 0 7fb03cb93ceaef9d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93ceaef9d stream 0 0 0 7fb03cb93ceb106d 0 0
|
||||
7fb03cb93ceaf2bd stream 0 0 0 7fb03cb93ceb0fa5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93ceb0fa5 stream 0 0 0 7fb03cb93ceaf2bd 0 0
|
||||
7fb03cb93ceaf515 stream 0 0 0 7fb03cb93ceb0e15 0 0
|
||||
7fb03cb93ceb0e15 stream 0 0 0 7fb03cb93ceaf515 0 0
|
||||
7fb03cb93ceaf5dd stream 0 0 0 7fb03cb93ceb0d4d 0 0
|
||||
7fb03cb93ceb0d4d stream 0 0 0 7fb03cb93ceaf5dd 0 0
|
||||
7fb03cb93ceb0c85 stream 0 0 0 7fb03cb93ceaf6a5 0 0
|
||||
7fb03cb93ceaf6a5 stream 0 0 0 7fb03cb93ceb0c85 0 0
|
||||
7fb03cb93ceaf76d stream 0 0 0 7fb03cb93ceb0bbd 0 0
|
||||
7fb03cb93ceb0bbd stream 0 0 0 7fb03cb93ceaf76d 0 0
|
||||
7fb03cb93ceb0af5 stream 0 0 0 7fb03cb93ceafa8d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93ceafa8d stream 0 0 0 7fb03cb93ceb0af5 0 0
|
||||
7fb03cb93ceb057d stream 0 0 0 7fb03cb93ceb070d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93ceb070d stream 0 0 0 7fb03cb93ceb057d 0 0
|
||||
7fb03cb93ceafce5 stream 0 0 0 7fb03cb93ceaf9c5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93ceaf9c5 stream 0 0 0 7fb03cb93ceafce5 0 0
|
||||
7fb03cb93ceb025d stream 0 0 7fb03cb93ea4fca5 0 0 0 /tmp/fctvpnctl.sock
|
||||
7fb03cb93ceb0325 stream 0 0 7fb03cb93ea5074d 0 0 0 /var/tmp/filesystemui.socket
|
||||
7fb03cb93ceafb55 stream 0 0 7fb03cb93ea1cd1d 0 0 0 /private/tmp/com.apple.launchd.WbUfpjQ9cD/Render
|
||||
7fb03cb93ceb00cd stream 0 0 7fb03cb93ea42275 0 0 0 /private/tmp/com.apple.launchd.WdCvj7HQdi/Listeners
|
||||
7fb03cb937d394b5 stream 0 0 7fb03cb938289085 0 0 0 /tmp/olisne-WY4G9IZafUNsloCollectorServicePipe
|
||||
7fb03cb93501a895 stream 0 0 0 7fb03cb93501d51d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93501d51d stream 0 0 0 7fb03cb93501a895 0 0
|
||||
7fb03cb93501aa25 stream 0 0 0 7fb03cb93501aaed 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93501aaed stream 0 0 0 7fb03cb93501aa25 0 0
|
||||
7fb03cb93501d38d stream 0 0 0 7fb03cb93501d2c5 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93501d2c5 stream 0 0 0 7fb03cb93501d38d 0 0
|
||||
7fb03cb93501abb5 stream 0 0 0 7fb03cb93501d1fd 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93501d1fd stream 0 0 0 7fb03cb93501abb5 0 0
|
||||
7fb03cb93501aed5 stream 0 0 0 7fb03cb93501ae0d 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93501ae0d stream 0 0 0 7fb03cb93501aed5 0 0
|
||||
7fb03cb93501b44d stream 0 0 0 7fb03cb93501cedd 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93501cedd stream 0 0 0 7fb03cb93501b44d 0 0
|
||||
7fb03cb93501d06d stream 0 0 0 7fb03cb93501b385 0 0
|
||||
7fb03cb93501b385 stream 0 0 0 7fb03cb93501d06d 0 0
|
||||
7fb03cb93501cfa5 stream 0 0 7fb03cb93763e7cd 0 0 0 /var/run/displaypolicyd/state
|
||||
7fb03cb93501b76d stream 0 0 7fb03cb936ea7d9d 0 0 0 /var/run/pppconfd
|
||||
7fb03cb93501c965 stream 0 0 7fb03cb9355ec3e5 0 0 0 /var/run/epctrl.sock
|
||||
7fb03cb93501c89d stream 0 0 7fb03cb9355ec1f5 0 0 0 /var/run/fctvpnctrl.sock
|
||||
7fb03cb93501c7d5 stream 0 0 7fb03cb9355ec0fd 0 0 0 /var/run/fctservctl.sock
|
||||
7fb03cb93501c70d stream 0 0 7fb03cb9355ec005 0 0 0 /var/run/com.docker.vmnetd.sock
|
||||
7fb03cb93501c645 stream 0 0 7fb03cb93557e845 0 0 0 /var/rpc/ncalrpc/srvsvc
|
||||
7fb03cb93501b9c5 stream 0 0 7fb03cb93557e36d 0 0 0 /var/rpc/ncacn_np/srvsvc
|
||||
7fb03cb93501c57d stream 0 0 7fb03cb93557e55d 0 0 0 /var/run/usbmuxd
|
||||
7fb03cb93501c4b5 stream 0 0 7fb03cb93557e655 0 0 0 /var/rpc/ncalrpc/wkssvc
|
||||
7fb03cb93501ba8d stream 0 0 7fb03cb93557e74d 0 0 0 /var/rpc/ncacn_np/wkssvc
|
||||
7fb03cb93501c3ed stream 0 0 7fb03cb9355617cd 0 0 0 /var/rpc/ncacn_np/mdssvc
|
||||
7fb03cb93501c325 stream 0 0 7fb03cb9355636cd 0 0 0 /var/rpc/ncalrpc/lsarpc
|
||||
7fb03cb93501c25d stream 0 0 7fb03cb9355618c5 0 0 0 /var/rpc/ncacn_np/lsarpc
|
||||
7fb03cb93501bb55 stream 0 0 7fb03cb9355635d5 0 0 0 /var/run/mDNSResponder
|
||||
7fb03cb93501bc1d stream 0 0 7fb03cb9355634dd 0 0 0 /var/run/systemkeychaincheck.socket
|
||||
7fb03cb93501bce5 stream 0 0 7fb03cb935561ab5 0 0 0 /private/var/run/.sim_diagnosticd_socket
|
||||
7fb03cb93501bdad stream 0 0 7fb03cb935561bad 0 0 0 /var/run/portmap.socket
|
||||
7fb03cb93501be75 stream 0 0 7fb03cb935511d1d 0 0 0 /var/run/vpncontrol.sock
|
||||
7fb03cb93501bf3d stream 0 0 7fb03cb9354fd085 0 0 0 /var/rpc/ncalrpc/NETLOGON
|
||||
7fb03cb93501c005 stream 0 0 7fb03cb9354e58c5 0 0 0 /private/var/run/cupsd
|
||||
7fb03cb95130ddad dgram 0 0 0 7fb03cb93501c195 0 7fb03cb945d3afa5
|
||||
7fb03cb94a63b065 dgram 0 0 0 7fb03cb94a63b9c5 7fb03cb94a63b9c5 0
|
||||
7fb03cb94a63b9c5 dgram 0 0 0 7fb03cb94a63b065 7fb03cb94a63b065 0
|
||||
7fb03cb945d3afa5 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb94a63ad45
|
||||
7fb03cb94a63ad45 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb94a63af9d
|
||||
7fb03cb94a63af9d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceae7cd
|
||||
7fb03cb93ceae7cd dgram 0 0 0 7fb03cb93501c195 0 7fb03cb945d3b51d
|
||||
7fb03cb945d3b51d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb945d3a3ed
|
||||
7fb03cb945d3a3ed dgram 0 0 0 7fb03cb93501c195 0 7fb03cb937d3989d
|
||||
7fb03cb937d3989d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb94a63b76d
|
||||
7fb03cb94a63b76d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb95130d44d
|
||||
7fb03cb95130d44d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb95130cf9d
|
||||
7fb03cb95130cf9d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93501d6ad
|
||||
7fb03cb94d7491fd dgram 0 0 0 7fb03cb94d7476a5 7fb03cb94d7476a5 0
|
||||
7fb03cb94d7476a5 dgram 0 0 0 7fb03cb94d7491fd 7fb03cb94d7491fd 0
|
||||
7fb03cb93501d6ad dgram 0 0 0 7fb03cb93501c195 0 7fb03cb94a63d6ad
|
||||
7fb03cb94d748005 dgram 0 0 0 7fb03cb94d749455 7fb03cb94d749455 0
|
||||
7fb03cb94d749455 dgram 0 0 0 7fb03cb94d748005 7fb03cb94d748005 0
|
||||
7fb03cb94d7475dd dgram 0 0 0 7fb03cb94d747065 7fb03cb94d747065 0
|
||||
7fb03cb94d747065 dgram 0 0 0 7fb03cb94d7475dd 7fb03cb94d7475dd 0
|
||||
7fb03cb93501a95d dgram 0 0 0 7fb03cb93501d455 7fb03cb93501d455 0
|
||||
7fb03cb93501d455 dgram 0 0 0 7fb03cb93501a95d 7fb03cb93501a95d 0
|
||||
7fb03cb95130db55 dgram 0 0 0 7fb03cb95130ebbd 7fb03cb95130ebbd 0
|
||||
7fb03cb95130ebbd dgram 0 0 0 7fb03cb95130db55 7fb03cb95130db55 0
|
||||
7fb03cb94a63d6ad dgram 0 0 0 7fb03cb93501c195 0 7fb03cb94d74938d
|
||||
7fb03cb94d74938d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb937d38a8d
|
||||
7fb03cb937d38a8d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb95130d835
|
||||
7fb03cb95130d835 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb94d746c7d
|
||||
7fb03cb945d3aedd dgram 0 0 0 7fb03cb945d3b6ad 7fb03cb945d3b6ad 0
|
||||
7fb03cb945d3b6ad dgram 0 0 0 7fb03cb945d3aedd 7fb03cb945d3aedd 0
|
||||
7fb03cb94d746c7d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb94d74712d
|
||||
7fb03cb94d74712d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb937d39edd
|
||||
7fb03cb937d39edd dgram 0 0 0 7fb03cb93501c195 0 7fb03cb937d38dad
|
||||
7fb03cb937d38dad dgram 0 0 0 7fb03cb93501c195 0 7fb03cb94a63b12d
|
||||
7fb03cb94a63b12d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb95130e57d
|
||||
7fb03cb95130e57d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb94d74951d
|
||||
7fb03cb94d74951d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb94d749135
|
||||
7fb03cb94d749135 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceb15e5
|
||||
7fb03cb93ceb15e5 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceae895
|
||||
7fb03cb93ceae895 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceb16ad
|
||||
7fb03cb93ceb16ad dgram 0 0 0 7fb03cb93501c195 0 7fb03cb937d3a1fd
|
||||
7fb03cb937d3a1fd dgram 0 0 0 7fb03cb93501c195 0 7fb03cb945d39065
|
||||
7fb03cb945d39065 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb945d38f9d
|
||||
7fb03cb945d38f9d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb945d39a8d
|
||||
7fb03cb945d399c5 dgram 0 0 0 7fb03cb945d3a005 7fb03cb945d3a005 0
|
||||
7fb03cb945d3a005 dgram 0 0 0 7fb03cb945d399c5 7fb03cb945d399c5 0
|
||||
7fb03cb945d39b55 dgram 0 0 0 7fb03cb945d39f3d 7fb03cb945d39f3d 0
|
||||
7fb03cb945d39f3d dgram 0 0 0 7fb03cb945d39b55 7fb03cb945d39b55 0
|
||||
7fb03cb945d39a8d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb937d397d5
|
||||
7fb03cb937d37d45 dgram 0 0 0 7fb03cb937d37e0d 7fb03cb937d37e0d 0
|
||||
7fb03cb937d37e0d dgram 0 0 0 7fb03cb937d37d45 7fb03cb937d37d45 0
|
||||
7fb03cb937d397d5 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceb11fd
|
||||
7fb03cb93ceb11fd dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceaf065
|
||||
7fb03cb93ceaf065 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceb0edd
|
||||
7fb03cb93ceb0edd dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceaf385
|
||||
7fb03cb93ceaf12d dgram 0 0 0 7fb03cb93ceaf1f5 7fb03cb93ceaf1f5 0
|
||||
7fb03cb93ceaf1f5 dgram 0 0 0 7fb03cb93ceaf12d 7fb03cb93ceaf12d 0
|
||||
7fb03cb93ceaf385 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceb0965
|
||||
7fb03cb93ceb0965 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceb0a2d
|
||||
7fb03cb93ceb0a2d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceaf835
|
||||
7fb03cb93ceaf835 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceaf8fd
|
||||
7fb03cb93ceaf8fd dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceafdad
|
||||
7fb03cb93ceafdad dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceb07d5
|
||||
7fb03cb93ceb07d5 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceb089d
|
||||
7fb03cb93ceb0645 dgram 0 0 0 7fb03cb93ceafe75 7fb03cb93ceafe75 0
|
||||
7fb03cb93ceafe75 dgram 0 0 0 7fb03cb93ceb0645 7fb03cb93ceb0645 0
|
||||
7fb03cb93ceb089d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceafc1d
|
||||
7fb03cb93ceb0195 dgram 0 0 0 7fb03cb93ceb0005 7fb03cb93ceb0005 0
|
||||
7fb03cb93ceb0005 dgram 0 0 0 7fb03cb93ceb0195 7fb03cb93ceb0195 0
|
||||
7fb03cb93ceafc1d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93ceb03ed
|
||||
7fb03cb93ceb03ed dgram 0 0 0 7fb03cb93501c195 0 7fb03cb937d39fa5
|
||||
7fb03cb937d39a2d dgram 0 0 0 7fb03cb937d39bbd 7fb03cb937d39bbd 0
|
||||
7fb03cb937d39bbd dgram 0 0 0 7fb03cb937d39a2d 7fb03cb937d39a2d 0
|
||||
7fb03cb937d39fa5 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb937d39965
|
||||
7fb03cb937d38065 dgram 0 0 0 7fb03cb937d37c7d 7fb03cb937d37c7d 0
|
||||
7fb03cb937d37c7d dgram 0 0 0 7fb03cb937d38065 7fb03cb937d38065 0
|
||||
7fb03cb937d39965 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb937d37f9d
|
||||
7fb03cb937d37f9d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb937d393ed
|
||||
7fb03cb937d393ed dgram 0 0 0 7fb03cb93501c195 0 7fb03cb937d3970d
|
||||
7fb03cb937d3970d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93501d135
|
||||
7fb03cb937d382bd dgram 0 0 0 7fb03cb937d3957d 7fb03cb937d3957d 0
|
||||
7fb03cb937d3957d dgram 0 0 0 7fb03cb937d382bd 7fb03cb937d382bd 0
|
||||
7fb03cb937d38c1d dgram 0 0 0 7fb03cb937d38ce5 7fb03cb937d38ce5 0
|
||||
7fb03cb937d38ce5 dgram 0 0 0 7fb03cb937d38c1d 7fb03cb937d38c1d 0
|
||||
7fb03cb93501d135 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93501cd4d
|
||||
7fb03cb93501cd4d dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93501cc85
|
||||
7fb03cb93501b1f5 dgram 0 0 0 7fb03cb93501b2bd 7fb03cb93501b2bd 0
|
||||
7fb03cb93501b2bd dgram 0 0 0 7fb03cb93501b1f5 7fb03cb93501b1f5 0
|
||||
7fb03cb93501ce15 dgram 0 0 0 7fb03cb93501b515 7fb03cb93501b515 0
|
||||
7fb03cb93501b515 dgram 0 0 0 7fb03cb93501ce15 7fb03cb93501ce15 0
|
||||
7fb03cb93501b6a5 dgram 0 0 0 7fb03cb93501caf5 7fb03cb93501caf5 0
|
||||
7fb03cb93501caf5 dgram 0 0 0 7fb03cb93501b6a5 7fb03cb93501b6a5 0
|
||||
7fb03cb93501cc85 dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93501cbbd
|
||||
7fb03cb93501cbbd dgram 0 0 0 7fb03cb93501c195 0 7fb03cb93501c0cd
|
||||
7fb03cb93501b8fd dgram 0 0 0 7fb03cb93501ca2d 7fb03cb93501ca2d 0
|
||||
7fb03cb93501ca2d dgram 0 0 0 7fb03cb93501b8fd 7fb03cb93501b8fd 0
|
||||
7fb03cb93501c0cd dgram 0 0 0 7fb03cb93501c195 0 0
|
||||
7fb03cb93501c195 dgram 0 0 7fb03cb934ff43e5 0 7fb03cb95130ddad 0 /private//var/run/syslog
|
||||
Registered kernel control modules
|
||||
kctlref id unit flags pcbcount rcvbuf sndbuf name
|
||||
10001 1 -1 9 0 131072 131072 com.apple.flow-divert
|
||||
20002 2 -1 1 1 16384 2048 com.apple.nke.sockwall
|
||||
30003 3 -1 9 0 524288 524288 com.apple.content-filter
|
||||
40004 4 -1 1 0 65536 65536 com.apple.net.necp_control
|
||||
50005 5 -1 1 12 65536 65536 com.apple.net.netagent
|
||||
60006 6 -1 9 4 524288 524288 com.apple.net.utun_control
|
||||
70007 7 -1 1 0 65536 65536 com.apple.net.ipsec_control
|
||||
80008 8 -1 0 74 8192 2048 com.apple.netsrc
|
||||
90009 9 -1 18 4 8192 2048 com.apple.network.statistics
|
||||
a000a a -1 5 0 8192 2048 com.apple.network.tcp_ccdebug
|
||||
b000b b -1 1 0 8192 2048 com.apple.network.advisory
|
||||
c000c c -1 4 0 65536 2048 com.apple.uart.BLTH
|
||||
d000d d -1 4 0 8192 2048 com.apple.uart.sk.BLTH
|
||||
e000e e -1 0 0 8192 8192 com.apple.fileutil.kext.stateful.ctl
|
||||
f000f f -1 0 0 8192 2048 com.apple.fileutil.kext.stateless.ctl
|
||||
170017 17 -1 5 1 32768 2048 com.fortinet.fct.kext.fwnke
|
||||
ea0010 18 -1 5 1 8192 2048 com.fortinet.kext.avkern2
|
||||
Active kernel event sockets
|
||||
pcb Proto Recv-Q Send-Q vendor class subcla rxbytes txbytes
|
||||
7fb03cb936ead2bd kevt 0 0 1 1 0 0 0
|
||||
7fb03cb936ead2f5 kevt 0 0 1 4 0 0 0
|
||||
7fb03cb936eacd0d kevt 0 0 1 1 0 1414844 0
|
||||
7fb03cb936eacd45 kevt 0 0 1 6 1 27716540 0
|
||||
7fb03cb936ead24d kevt 0 0 1 6 1 27716540 0
|
||||
7fb03cb936ead215 kevt 0 0 1 6 1 27716540 0
|
||||
7fb03cb936ead1dd kevt 0 0 1 1 11 0 0
|
||||
7fb03cb936eacd7d kevt 0 0 1 6 1 27716540 0
|
||||
7fb03cb936eacdb5 kevt 0 0 1 6 1 27716540 0
|
||||
7fb03cb936eacded kevt 0 0 1 6 1 27716744 0
|
||||
7fb03cb936eace25 kevt 0 0 1 6 1 27716744 0
|
||||
7fb03cb936eace5d kevt 0 0 1 6 1 27716744 0
|
||||
7fb03cb936ead1a5 kevt 0 0 1 6 1 27718800 0
|
||||
7fb03cb936eace95 kevt 0 0 1 6 1 27719296 0
|
||||
7fb03cb936eacecd kevt 0 0 1 6 1 27719296 0
|
||||
7fb03cb936eacf05 kevt 0 0 1 6 1 27719296 0
|
||||
7fb03cb936ead16d kevt 0 0 1 1 6 823488 0
|
||||
7fb03cb936eacf3d kevt 0 0 1 1 1 836 0
|
||||
7fb03cb936eacf75 kevt 0 0 1 6 1 27719456 0
|
||||
7fb03cb936eacfad kevt 0 0 1 1 2 444256 0
|
||||
7fb03cb936ead135 kevt 0 0 1 1 10 0 0
|
||||
7fb03cb936eacfe5 kevt 0 0 1000 5 11 144855 0
|
||||
7fb03cb936ead01d kevt 0 0 1 1 7 151680 0
|
||||
7fb03cb936ead055 kevt 0 0 1 1 1 836 0
|
||||
7fb03cb936ead08d kevt 0 0 1 1 2 444256 0
|
||||
7fb03cb936ead0fd kevt 0 0 1 3 3 0 0
|
||||
7fb03cb936ead0c5 kevt 0 0 1 1 0 1422896 0
|
||||
Active kernel control sockets
|
||||
pcb Proto Recv-Q Send-Q rxbytes txbytes unit id name
|
||||
7fb03cb937d0314d kctl 0 0 791268 657340 1 2 com.apple.nke.sockwall
|
||||
7fb03cb9375d4f4d kctl 0 0 0 0 1 5 com.apple.net.netagent
|
||||
7fb03cb9375d5ded kctl 0 0 0 0 2 5 com.apple.net.netagent
|
||||
7fb03cb9375d4d6d kctl 0 0 0 0 3 5 com.apple.net.netagent
|
||||
7fb03cb9375d656d kctl 0 0 0 0 4 5 com.apple.net.netagent
|
||||
7fb03cb9375d4c4d kctl 0 0 0 0 5 5 com.apple.net.netagent
|
||||
7fb03cb9375d662d kctl 0 0 0 0 6 5 com.apple.net.netagent
|
||||
7fb03cb9608a1a6d kctl 0 0 0 0 7 5 com.apple.net.netagent
|
||||
7fb03cb94c7488ed kctl 0 0 0 0 8 5 com.apple.net.netagent
|
||||
7fb03cb93e7299ad kctl 0 0 0 0 9 5 com.apple.net.netagent
|
||||
7fb03cb93e72b5cd kctl 0 0 0 0 10 5 com.apple.net.netagent
|
||||
7fb03cb93e72b6ed kctl 0 0 0 0 11 5 com.apple.net.netagent
|
||||
7fb03cb93f60182d kctl 0 0 0 0 12 5 com.apple.net.netagent
|
||||
7fb03cb93f6020cd kctl 0 0 30618 0 1 6 com.apple.net.utun_control
|
||||
7fb03cb94ff8f9cd kctl 0 0 0 0 2 6 com.apple.net.utun_control
|
||||
7fb03cb94ff8fded kctl 0 0 0 0 3 6 com.apple.net.utun_control
|
||||
7fb03cb94ff8f48d kctl 0 0 0 0 4 6 com.apple.net.utun_control
|
||||
7fb03cb9375d644d kctl 0 0 224 144 1 8 com.apple.netsrc
|
||||
7fb03cb93c237d8d kctl 0 0 224 144 2 8 com.apple.netsrc
|
||||
7fb03cb93c23682d kctl 0 0 9352 6012 3 8 com.apple.netsrc
|
||||
7fb03cb9503efa6d kctl 0 0 4144 2664 4 8 com.apple.netsrc
|
||||
7fb03cb93cc9038d kctl 0 0 376544 242064 5 8 com.apple.netsrc
|
||||
7fb03cb93d3a7d6d kctl 0 0 3192 2052 6 8 com.apple.netsrc
|
||||
7fb03cb9608a314d kctl 0 0 630280 405180 7 8 com.apple.netsrc
|
||||
7fb03cb93eefef0d kctl 0 0 2520 1620 8 8 com.apple.netsrc
|
||||
7fb03cb93f3d2e8d kctl 0 0 2520 1620 9 8 com.apple.netsrc
|
||||
7fb03cb93f60260d kctl 0 0 32368 20808 10 8 com.apple.netsrc
|
||||
7fb03cb93f601d6d kctl 0 0 120568 77508 11 8 com.apple.netsrc
|
||||
7fb03cb93fb8e30d kctl 0 0 6272 4032 12 8 com.apple.netsrc
|
||||
7fb03cb93fb8d8ed kctl 0 0 896 576 13 8 com.apple.netsrc
|
||||
7fb03cb93f3d384d kctl 0 0 1344 864 14 8 com.apple.netsrc
|
||||
7fb03cb940438bad kctl 0 0 81816 52596 15 8 com.apple.netsrc
|
||||
7fb03cb949ba84ed kctl 0 0 6328 4068 16 8 com.apple.netsrc
|
||||
7fb03cb94043968d kctl 0 0 2520 1620 17 8 com.apple.netsrc
|
||||
7fb03cb940c3594d kctl 0 0 74760 48060 18 8 com.apple.netsrc
|
||||
7fb03cb941b872cd kctl 0 0 2520 1620 19 8 com.apple.netsrc
|
||||
7fb03cb943aa506d kctl 0 0 309064 198684 20 8 com.apple.netsrc
|
||||
7fb03cb941451a8d kctl 0 0 31864 20484 21 8 com.apple.netsrc
|
||||
7fb03cb94510508d kctl 0 0 2632 1692 22 8 com.apple.netsrc
|
||||
7fb03cb9459058ed kctl 0 0 133392 85752 23 8 com.apple.netsrc
|
||||
7fb03cb945c5bf0d kctl 0 0 2016 1296 24 8 com.apple.netsrc
|
||||
7fb03cb94766e96d kctl 0 0 14280 9180 25 8 com.apple.netsrc
|
||||
7fb03cb946464c6d kctl 0 0 1568 1008 26 8 com.apple.netsrc
|
||||
7fb03cb946463fad kctl 0 0 203224 130644 27 8 com.apple.netsrc
|
||||
7fb03cb94646394d kctl 0 0 338184 217404 28 8 com.apple.netsrc
|
||||
7fb03cb95002e5ad kctl 0 0 616 396 29 8 com.apple.netsrc
|
||||
7fb03cb94fe5d12d kctl 0 0 14280 9180 30 8 com.apple.netsrc
|
||||
7fb03cb95fb8feed kctl 0 0 112 72 31 8 com.apple.netsrc
|
||||
7fb03cb9471823cd kctl 0 0 438592 281952 32 8 com.apple.netsrc
|
||||
7fb03cb96085390d kctl 0 0 166040 106740 33 8 com.apple.netsrc
|
||||
7fb03cb94686a3cd kctl 0 0 336 216 34 8 com.apple.netsrc
|
||||
7fb03cb94804f18d kctl 0 0 57792 37152 35 8 com.apple.netsrc
|
||||
7fb03cb94804f42d kctl 0 0 336 216 36 8 com.apple.netsrc
|
||||
7fb03cb94804fead kctl 0 0 1568 1008 37 8 com.apple.netsrc
|
||||
7fb03cb94fefcd2d kctl 0 0 8512 5472 38 8 com.apple.netsrc
|
||||
7fb03cb94f9330ed kctl 0 0 9520 6120 39 8 com.apple.netsrc
|
||||
7fb03cb9496ffb8d kctl 0 0 4816 3096 40 8 com.apple.netsrc
|
||||
7fb03cb95e70872d kctl 0 0 203448 130788 41 8 com.apple.netsrc
|
||||
7fb03cb94c8769ad kctl 0 0 280616 180396 42 8 com.apple.netsrc
|
||||
7fb03cb9508e426d kctl 0 0 112 72 43 8 com.apple.netsrc
|
||||
7fb03cb95f702d8d kctl 0 0 112 72 44 8 com.apple.netsrc
|
||||
7fb03cb94d86f2cd kctl 0 0 103040 66240 45 8 com.apple.netsrc
|
||||
7fb03cb94e49c2ad kctl 0 0 56 36 46 8 com.apple.netsrc
|
||||
7fb03cb95eff106d kctl 0 0 327936 210816 47 8 com.apple.netsrc
|
||||
7fb03cb93aa79fcd kctl 0 0 8064 5184 48 8 com.apple.netsrc
|
||||
7fb03cb94f65e74d kctl 0 0 3136 2016 49 8 com.apple.netsrc
|
||||
7fb03cb94f8944ad kctl 0 0 6888 4428 50 8 com.apple.netsrc
|
||||
7fb03cb94f931d6d kctl 0 0 336 216 51 8 com.apple.netsrc
|
||||
7fb03cb94f9d11ad kctl 0 0 6720 4320 52 8 com.apple.netsrc
|
||||
7fb03cb95fbb0aed kctl 0 0 28448 18288 53 8 com.apple.netsrc
|
||||
7fb03cb95f88ec4d kctl 0 0 63000 40500 54 8 com.apple.netsrc
|
||||
7fb03cb9496ffa0d kctl 0 0 2576 1656 55 8 com.apple.netsrc
|
||||
7fb03cb94c736fcd kctl 0 0 336 216 56 8 com.apple.netsrc
|
||||
7fb03cb95477236d kctl 0 0 336 216 57 8 com.apple.netsrc
|
||||
7fb03cb95e1a588d kctl 0 0 7336 4716 58 8 com.apple.netsrc
|
||||
7fb03cb95e1a726d kctl 0 0 12544 8064 59 8 com.apple.netsrc
|
||||
7fb03cb94ed4f24d kctl 0 0 112 72 60 8 com.apple.netsrc
|
||||
7fb03cb95f46cc6d kctl 0 0 11872 7632 61 8 com.apple.netsrc
|
||||
7fb03cb94fb5ad2d kctl 0 0 168 108 62 8 com.apple.netsrc
|
||||
7fb03cb95cb8b9ad kctl 0 0 1456 936 63 8 com.apple.netsrc
|
||||
7fb03cb954772d8d kctl 0 0 336 216 64 8 com.apple.netsrc
|
||||
7fb03cb950171fad kctl 0 0 672 432 65 8 com.apple.netsrc
|
||||
7fb03cb9375d590d kctl 0 0 336 216 66 8 com.apple.netsrc
|
||||
7fb03cb94686a1ed kctl 0 0 168 108 67 8 com.apple.netsrc
|
||||
7fb03cb94ffdd1ad kctl 0 0 129808 83448 68 8 com.apple.netsrc
|
||||
7fb03cb94ff8f96d kctl 0 0 168 108 69 8 com.apple.netsrc
|
||||
7fb03cb95e6c8e8d kctl 0 0 18648 11988 70 8 com.apple.netsrc
|
||||
7fb03cb94b5af2ad kctl 0 0 224 144 71 8 com.apple.netsrc
|
||||
7fb03cb96074aa6d kctl 0 0 112 72 72 8 com.apple.netsrc
|
||||
7fb03cb95bff57cd kctl 0 0 56 36 74 8 com.apple.netsrc
|
||||
7fb03cb95fc8056d kctl 0 0 112 72 77 8 com.apple.netsrc
|
||||
7fb03cb937d02e4d kctl 0 0 216428 44 1 9 com.apple.network.statistics
|
||||
7fb03cb93e09b08d kctl 0 0 144713152 30152 2 9 com.apple.network.statistics
|
||||
7fb03cb93e099a0d kctl 0 0 0 0 3 9 com.apple.network.statistics
|
||||
7fb03cb93e099bed kctl 0 0 6100 2148 4 9 com.apple.network.statistics
|
||||
7fb03cb9603d82cd kctl 0 0 0 0 1 23 com.fortinet.fct.kext.fwnke
|
||||
7fb03cb9603d67cd kctl 0 0 20960 240 1 24 com.fortinet.kext.avkern2
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user