Agent to server api calls - Gargravarr2112/vFense GitHub Wiki
All arguments must be added into the payload for all POST, PUT, and DELETE http methods.
New Agent
uri = rvl/v2/core/newagent http method = POST
key | value_type | example_value | default | required |
---|---|---|---|---|
views | list | ['global', 'NYC'] | All agents will be added to the global view | True |
system_info | dict | {'os_code': 'linux', 'computer_name': 'localhost'} | None | True |
hardware | dict | {'nic': [{'mac': '54ee7516ede6'}]} | None | True |
tags | list | ['TAGID'] | None | True |
plugins | dict | {'rv': {'data': [application data goes in here]}} | None | True |
Example of what the agent sends on a new agent request
{
"operation": "new_agent",
"views": ["global"],
"tags": [],
"rebooted": "no",
"system_info": {
"os_code": "windows",
"os_string": "Windows 7 Professional N",
"version": "6.1.7601",
"bit_type": "64",
"computer_name": "DISCIPLINE-1",
},
"hardware": {
"cpu": [
{
"cpu_id": 1,
"name": "Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz",
"bit_type": 64,
"speed_mhz": 2401,
"cores": 4,
"cache_kb": 1024
}
],
"memory": 25165824,
"display": [
{
"name": "NVIDIA GeForce GTX 660M ",
"speed_mhz": "GeForce GTX 660M",
"ram_kb": 0
}
],
"nic": [
{
"name": "Local Area Connection",
"ip_address": "10.0.0.2",
"mac": "3085A925BFD6"
},
{
"name": "VMware Network Adapter VMnet1",
"ip_address": "192.168.110.1",
"mac": "005056C00001"
},
{
"name": "VMware Network Adapter VMnet8",
"ip_address": "192.168.252.1",
"mac": "005056C00008"
}
],
"storage": [
{
"free_size_kb": 155600024,
"name": "C:",
"size_kb": 499872764,
"file_system": "NTFS"
}
]
}
}
Example of the results of the new agent operation.
{
"data": [
{
"operation_id": "",
"operation": "new_agent_id",
"agent_id": "f1e2b0fb-5b30-4ed7-89ba-50e65001b525"
},
{
"count": 1,
"vfense_status_code": 1001,
"generic_status_code": 1001,
"message": "response uris retrieved successfully.",
"db_status_code": 0,
"data": {
"check_in": {
"response_uri": "rvl/v2/f1e2b0fb-5b30-4ed7-89ba-50e65001b525/core/checkin",
"request_method": "GET"
},
"available_agent_update": {
"response_uri": "rvl/v2/apps/available_agent_update",
"request_method": "PUT"
},
"refresh_apps": {
"response_uri": "rvl/v2/f1e2b0fb-5b30-4ed7-89ba-50e65001b525/apps/refresh_apps",
"request_method": "PUT"
},
"uninstall_agent": {
"response_uri": "rvl/v2/f1e2b0fb-5b30-4ed7-89ba-50e65001b525/apps/results/uninstall",
"request_method": "PUT"
},
"startup": {
"response_uri": "rvl/v2/f1e2b0fb-5b30-4ed7-89ba-50e65001b525/core/results/startup",
"request_method": "PUT"
},
"reboot": {
"response_uri": "rvl/v2/f1e2b0fb-5b30-4ed7-89ba-50e65001b525/core/results/reboot",
"request_method": "PUT"
},
"install_os_apps": {
"response_uri": "rvl/v2/f1e2b0fb-5b30-4ed7-89ba-50e65001b525/apps/results/install",
"request_method": "PUT"
},
"refresh_response_uris": {
"response_uri": "rvl/v2/core/uris/response",
"request_method": "GET"
},
"install_agent_update": {
"response_uri": "rvl/v2/f1e2b0fb-5b30-4ed7-89ba-50e65001b525/apps/results/install/agent",
"request_method": "PUT"
},
"install_custom_apps": {
"response_uri": "rvl/v2/f1e2b0fb-5b30-4ed7-89ba-50e65001b525/apps/results/install/custom",
"request_method": "PUT"
},
"logout": {
"response_uri": "rvl/v2/rvl/logout",
"request_method": "GET"
},
"shutdown": {
"response_uri": "rvl/v2/f1e2b0fb-5b30-4ed7-89ba-50e65001b525/core/results/shutdown",
"request_method": "PUT"
},
"new_agent": {
"response_uri": "rvl/v2/core/newagent",
"request_method": "POST"
},
"install_supported_apps": {
"response_uri": "rvl/v2/f1e2b0fb-5b30-4ed7-89ba-50e65001b525/apps/results/install/supported",
"request_method": "PUT"
},
"monitor_data": {
"response_uri": "rvl/v2/f1e2b0fb-5b30-4ed7-89ba-50e65001b525/monitoring/monitordata",
"request_method": "POST"
},
"uninstall": {
"response_uri": "rvl/v2/f1e2b0fb-5b30-4ed7-89ba-50e65001b525/apps/results/uninstall",
"request_method": "PUT"
}
},
"operation": "refresh_response_uris"
}
],
"uri": "/rvl/v2/core/newagent",
"http_method": "POST",
"http_status": 200,
"generated_ids": "f1e2b0fb-5b30-4ed7-89ba-50e65001b525",
"message": "Agent f1e2b0fb-5b30-4ed7-89ba-50e65001b525 added successfully",
"vfense_status_code": 3200
}