340
edits
No edit summary |
|||
Line 24: | Line 24: | ||
==== Statistics about MAC or IP addresses ==== | ==== Statistics about MAC or IP addresses ==== | ||
<code>curl --silent -k -u USER:PASSWORD 'https://allegro-mm-XXXX/API/stats/modules/mac/macs/ff:ff:ff:ff:ff:ff' | |||
curl --silent -k -u USER:PASSWORD 'https://allegro-mm-XXXX/API/stats/modules/ip/ips/10.1.2.3'</code> | |||
curl --silent -k -u USER:PASSWORD 'https://allegro-mm-XXXX/API/stats/modules/ip/ips/10.1.2.3' | |||
==== Pretty displaying JSON output with jq ==== | ==== Pretty displaying JSON output with jq ==== | ||
<code>curl --silent -k -u USER:PASSWORD 'https://allegro-mm-XXXX/API/stats/modules/ip/ips/10.1.2.3' | jq</code> | |||
==== Traffic counters ==== | ==== Traffic counters ==== | ||
Line 59: | Line 55: | ||
==== Extract received bytes of the last second of a certain IP ==== | ==== Extract received bytes of the last second of a certain IP ==== | ||
<code>curl --silent -k -u USER:PASSWORD 'https://allegro-mm-XXXX/API/stats/modules/ip/ips/10.1.2.3' | jq .lastSecond[1]</code> | |||
==== Extract received and transmitted bytes of the last second of a certain IP ==== | ==== Extract received and transmitted bytes of the last second of a certain IP ==== | ||
<code>curl --silent -k -u USER:PASSWORD 'https://allegro-mm-XXXX/API/stats/modules/ip/ips/10.1.2.3' | jq '.lastSecond[1] + .lastSecond[3]'</code> | |||
==== Extract received and transmitted bytes in a time interval (18/06/11 9:00 - 10:00) of a certain IP ==== | ==== Extract received and transmitted bytes in a time interval (18/06/11 9:00 - 10:00) of a certain IP ==== | ||
<code>curl --silent -k -u USER:PASSWORD 'https://allegro-mm-XXXX/API/stats/modules/ip/ips/10.1.2.3?timespan=3600&starttime=1528700400&endtime=1528704000' | jq '.interval[1] + .interval[3]'</code> | |||
==== List queries ==== | ==== List queries ==== | ||
Line 97: | Line 85: | ||
==== Show IP address with the highest amount of traffic ==== | ==== Show IP address with the highest amount of traffic ==== | ||
<code>curl --silent -k -u USER:PASSWORD 'https://allegro-mm-XXXX/API/stats/modules/ip/ips_paged?sort=bps&reverse=true&page=0&count=1' | jq .displayedItems[0].ip</code> | |||
PowerShell command: | PowerShell command: | ||
<code>((Invoke-RestMethod -Uri 'https://allegro-mm-XXXX/API/stats/modules/ip/ips_paged?sort=bytes&reverse=true&page=0&count=10×pan=60&values=50' -Headers @{Authorization = ("Basic {0}" -f [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f 'USER', 'PASSWORD'))))} -ContentType'application/json; charset=utf-8' -Method 'Get' -SkipCertificateCheck). displayedItems[0]).ip</code> | |||
==== Show all peers of a certain IP address ==== | ==== Show all peers of a certain IP address ==== | ||
<code>curl --silent -k -u USER:PASSWORD 'https://allegro-mm-XXXX/API/stats/modules/ip/ips/10.1.2.3/peers?sort=bytes&reverse=true&page=0&count=9999×pan=60&values=100' | jq '.displayedItems[].ip'</code> | |||
==== Capture a certain IP ==== | ==== Capture a certain IP ==== | ||
<code>curl -k -u USER:PASSWORD 'https://allegro-mm-XXXX/API/data/modules/capture?expression=ip==10.1.2.3' > path_to/capture.pcap</code> | |||
==== Capture two IP addresses with ports on a certain layer 4 protocol ==== | ==== Capture two IP addresses with ports on a certain layer 4 protocol ==== | ||
<code>curl -k -u USER:PASSWORD 'https://allegro-mm-XXXX/API/data/modules/capture?expression=IP==10.1.2.3:62887 and IP==10.1.2.100:548 and l4Protocol==TCP' > path_to/capture.pcap</code> | |||
==== PCAP parameters ==== | ==== PCAP parameters ==== |
edits