Use Logs API on get the logs information of your VPS on your server.
HTTP Request
https://hostname:4083/index.php?act=logs
Parameters
Name | Type | Value | Description | Required |
---|---|---|---|---|
act | GET | logs | The action specified to retrieve data | Yes |
Sample Code
PHP
<?php
require_once('/usr/local/virtualizor/sdk/enduser.php');
$key = '';
$pass = '';
$ip = '';
$admin = new Virtualizor_Enduser_API($ip, $key, $pass);
$output = $admin->logs();
print_r(json_encode($output));
?>
Curl
curl -k -X GET
-L "https://hostname:4083/index.php?act=logs&svs=3577&api=json
&apikey=your_api_key&apipass=your_api_pass&do=1"
Output
{
"uid": "321",
"act": "logs",
"timezone": 1,
"timenow": "September 23, 2016, 7:33 am",
"vpsid": "3008",
"username": "test@test.com",
"user_type": "2",
"preferences": {
"fname": "test",
"lname": "test",
"language": "english",
"theme": "default",
"timezone": 1,
"logo": ""
},
"url": "index.php?",
"rdns": {
"pdnsid": null
},
"support_link": "http://softaculous.com",
"disable_login_logo": 1,
"title": "Logs",
"logs": {
"19900": {
"actid": "19900",
"uid": "321",
"vpsid": "3008",
"action": "hvmsettings",
"data": "",
"time": "1474609300",
"status": "1",
"ip": "your_Server_ip",
"email": "test@test.com",
"action_text": "Hvmsettings"
},
"19901": {
"actid": "19901",
"uid": "321",
"vpsid": "3008",
"action": "vncpass",
"data": "",
"time": "1474610288",
"status": "1",
"ip": "your_Server_ip",
"email": "test@test.com",
"action_text": "Vncpass"
},
"19902": {
"actid": "19902",
"uid": "0",
"vpsid": "3008",
"action": "install_recipe",
"data": "test287",
"time": "1474611625",
"status": "1",
"ip": "your_Server_ip",
"email": null,
"action_text": "Install_recipe - test287"
},
"19899": {
"actid": "19899",
"uid": "321",
"vpsid": "3008",
"action": "hostname",
"data": "test_api",
"time": "1474607066",
"status": "1",
"ip": "your_Server_ip",
"email": "test@test.com",
"action_text": "Changed Hostname - test_api"
}
},
"time_taken": "0.105"
}