Monitor

Use Monitor API to get information about the resources of your VPS on your server.

HTTP Request

https://hostname:4083/index.php?act=monitor&svs=vpsid

Parameters

NameTypeValueDescriptionRequired
actGETmonitorThe action specified to retrieve dataYes
svsPOSTIntThe vps whose monitoring data needs to be fetchedYes

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->monitor();

    print_r(json_encode($output));
?>

Curl

curl -k -X GET -L "https://hostname:4083/index.php?act=monitor&svs=3577& 
api=json&apikey=your_api_key&apipass=your_api_pass&do=1"

Output

{
    "uid": "321",
    "act": "monitor",
    "timezone": 1,
    "timenow": "September 23, 2016, 7:29 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": "CPU information",
    "cpu": {
        "cpu": {
            "manu": "intel",
            "limit": 2500.09,
            "used": 17.5,
            "free": 2482.59,
            "percent": 0.7,
            "percent_free": 99.3
        }
    },
    "disk": {
        "disk": {
            "limit": 30720,
            "used": 636.59,
            "limit_gb": 30,
            "used_gb": 0.62,
            "free": 30083.41,
            "free_gb": 29.38,
            "percent": 2.07,
            "percent_free": 97.93
        },
        "inodes": {
            "limit": 49056,
            "used": 21298,
            "free": 27758,
            "percent": 43.42,
            "percent_free": 56.58
        }
    },
    "ram": {
        "used": 0,
        "limit": 2048,
        "guaranteed": 2048,
        "swap": 2048,
        "free": 2048,
        "percent": 0,
        "percent_free": 100
    },
    "virt": "kvm",
    "monthly_data": [
        ["3008", "1474611842", "1", "637", "21298", "0", "1.80", "0", "0"],
        ["3008", "1474611362", "1", "3252", "64813", "0", "0.70", "60", "0"],
        ["3008", "1474610884", "0", "3252", "64813", "0", "0.00", "0", "0"],
        ["3008", "1474610402", "1", "3252", "64813", "0", "1.40", "60", "0"],
        ["3008", "1474610161", "1", "3252", "64813", "0", "0.90", "6027", "1703"],
        ["3008", "1474609682", "1", "3252", "64813", "0", "0.50", "60", "0"],
        ["3008", "1474609202", "1", "3252", "64813", "0", "0.90", "0", "0"],
        ["3008", "1474608722", "1", "3252", "64813", "0", "2.00", "5793", "902"],
        ["3008", "1474608242", "1", "3252", "64813", "0", "1.10", "5873", "1551"],
        ["3008", "1474607761", "1", "3252", "64813", "0", "1.20", "6184", "1703"],
        ["3008", "1474607281", "1", "3252", "64813", "0", "2.30", "0", "0"],
        ["3008", "1474606802", "1", "3252", "64813", "0", "0.50", "0", "0"],
        ["3008", "1474606562", "1", "3252", "64813", "0", "1.40", "5967", "1703"],
        ["3008", "1474606081", "1", "3252", "64813", "0", "0.70", "60", "0"],
        ["3008", "1474605601", "1", "3252", "64813", "0", "2.10", "0", "0"],
        ["3008", "1474605122", "1", "3252", "64813", "0", "0.70", "0", "0"],
        ["3008", "1474604642", "1", "3252", "64813", "0", "2.00", "60", "0"],
        ["3008", "1474604162", "1", "3252", "64813", "0", "1.80", "729", "446"],
        ["3008", "1474603682", "1", "3252", "64813", "0", "0.90", "120", "0"],
        ["3008", "1474603202", "1", "3252", "64813", "0", "1.80", "60", "0"],
        ["3008", "1474006082", "1", "5119", "110387", "0", "9.10", "120", "54"]
    ],
    "month": {
        "current_month": "201609",
        "prev_month": "201608",
        "next_month": "201610"
    },
    "time_taken": "1.330"
}
Was this helpful to you?