NEO Monitoring
File Name |
neo_monitor.py |
|
Description |
This SDK manipulates NEO monitoring data using NEO's REST API. The script includes the following main operations:
|
|
Usage |
neo_monitor.py [-h] -s SERVER -u USERNAME -p PASSWORD [-r {http,https}] --port {80,443,3080,3443} |
|
Arguments |
-h |
Displays the help menu |
-s SERVER |
NEO server IP |
|
-u USERNAME |
NEO username |
|
-p PASSWORD |
NEO password |
|
--port |
The port used to communicate with NEO. If NEO is run on a physical machine:
If NEO run on a docker container:
|
|
-r {http,https} |
Connection protocol to NEO |
|
-o {getall,get} |
Script operations |
|
-t PARAMETERS |
URL parameters. Valid formats:
|
'get'
Arguments |
|
Parameters |
Note: All parameters are optional and every combination of parameters is acceptable.
|
Output example:
[root@ufm_sdk]# /opt/neo/venv/bin/python neo_monitor.py -s 10.209.37.77 -u admin -r https --port 443 -p 123456 -o get -t "device_ids=10.209.24.39,10.209.24.40&port_ids=Eth1/1,Eth1/2&counters=InBroadcastP- kts,InOctetsRate&from=-2d&until=-1d"
======================================================================
<<< NEO - Getting monitoring data SDK >>>
----------------------------------------------------------------------
[*] Running Settings:
-> NEO server IP address: 10.209.37.77
-> NEO user name: admin
======================================================================
[*] Getting monitoring data stages:
-1- Setting Up data...
-2- Sending Getting monitoring data request...
======================================================================
[*] Getting monitoring data results:
>> Getting monitoring data request HTTP response status code: 200
>> Getting monitoring data request HTTP response text:
{
"2016-04-11 08:10:00+03:00": {
"devices": {
"10.209.24.39": {
"interfaces": {
"Eth1/1": {
"InBroadcastPkts": "N/A",
"InOctetsRate": "N/A"
},
"Eth1/2": {
"InBroadcastPkts": "N/A",
"InOctetsRate": "N/A"
}
}
},
"10.209.24.40": {
"interfaces": {
"Eth1/1": {
"InBroadcastPkts": "N/A",
"InOctetsRate": "N/A"
},
"Eth1/2": {
"InBroadcastPkts": "N/A",
"InOctetsRate": "N/A"
}
}
}
}
},
"2016-04-11 06:05:00+03:00": {
"devices": {
"10.209.24.39": {
"interfaces": {
"Eth1/1": {
"InBroadcastPkts": "N/A",
"InOctetsRate": "N/A"
},
"Eth1/2": {
"InBroadcastPkts": "N/A",
"InOctetsRate": "N/A"
}
}
},
"10.209.24.40": {
"interfaces": {
"Eth1/1": {
"InBroadcastPkts": "N/A",
"InOctetsRate": "N/A"
},
"Eth1/2": {
"InBroadcastPkts": "N/A",
"InOctetsRate": "N/A"
}
}
}
}
},
.
.
.
}
======================================================================
'getall'
Output example:
[root@ufm_sdk]# /opt/neo/venv/bin/python neo_monitor.py -s 10.209.37.77 -u admin -r https --port 443 -p 123456 -o getall
======================================================================
<<< NEO - Getting all monitoring data SDK >>>
----------------------------------------------------------------------
[*] Running Settings:
-> NEO server IP address: 10.209.37.77
-> NEO user name: admin
======================================================================
[*] Getting all monitoring data stages:
-1- Setting Up data...
-2- Sending Getting all monitoring data request...
======================================================================
[*] Getting all monitoring data results:
>> Getting all monitoring data request HTTP response status code: 200
>> Getting all monitoring data request HTTP response text:
{
"2016-04-12 09:55:00+03:00": {
"devices": {
"10.209.24.40": {
"interfaces": {
"aggregated": {
"InBroadcastPkts": 903.0,
"InOctetsRate": 31.48,
"OutOctets": 18434609.0,
"InUcastPkts": 638.0,
"NormalizedCongestedBandwidth": 0.0,
"InOctets": 18548137.0,
"InUnknownProtos": 0.0,
"OutPacketsRate": 0.27000000000000002,
"NormalizedBandwidth": 0.0,
"InMulticastPkts": 158133.0,
"OutOctetsRate": 31.210000000000001,
"OutErrors": 0.0,
"OutDiscards": 2.0,
"InDiscards": 0.0,
"SymbolError": 0.0,
"OutBroadcastPkts": 683.0,
"OutUcastPkts": 858.0,
"NormalizedInBandwidth": 0.0,
"InPacketsRate": 0.27000000000000002,
"InErrors": 0.0,
"XmitWait": 0.0,
"OutMulticastPkts": 158134.0
}
},
"general_statistics": {
"CpuLoad_8": 2.0,
"CpuLoad_6": 1.0,
"CpuLoad_7": 3.0,
"CpuLoad_4": 8.0,
"CpuLoad_5": 1.0,
"CpuLoad_2": 6.0,
"CpuLoad_3": 6.0,
"CpuLoad_1": 9.0,
"MemoryFree": 6694.0,
"MemoryUsed": 1230.0,
"MemoryTotal": 7924.0
}
},
.
.
.
}
}
}
======================================================================