API Get Processes List

From Virtualizor Wiki
Jump to: navigation, search

Get Processes List

Example Code

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

    $ip = 'xxx.xxx.xxx.xxx';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $output = $admin->processes();
    print_r($output);
?>

Returns:

Array
(
    [title] => List of Processes
    [processes] => Array
        (
            [0] => Array
                (
                    [PID] => 1
                    [USER] => root
                    [%CPU] => 0.0
                    [%MEM] => 0.0
                    [RSS] => 1384
                    [TT] => ?
                    [STAT] => Ss
                    [TIME] => 00:00:03
                    [COMMAND] => /sbin/init
                )

            [1] => Array
                (
                    [PID] => 2
                    [USER] => root
                    [%CPU] => 0.0
                    [%MEM] => 0.0
                    [RSS] => 0
                    [TT] => ?
                    [STAT] => S
                    [TIME] => 00:00:00
                    [COMMAND] => [kthreadd]
                )

            [2] => Array
                (
                    [PID] => 3
                    [USER] => root
                    [%CPU] => 0.0
                    [%MEM] => 0.0
                    [RSS] => 0
                    [TT] => ?
                    [STAT] => S
                    [TIME] => 00:00:07
                    [COMMAND] => [migration/0]
                )

            [3] => Array
                (
                    [PID] => 4
                    [USER] => root
                    [%CPU] => 0.0
                    [%MEM] => 0.0
                    [RSS] => 0
                    [TT] => ?
                    [STAT] => S
                    [TIME] => 00:00:43
                    [COMMAND] => [ksoftirqd/0]
                )

            [4] => Array
                (
                    [PID] => 5
                    [USER] => root
                    [%CPU] => 0.0
                    [%MEM] => 0.0
                    [RSS] => 0
                    [TT] => ?
                    [STAT] => S
                    [TIME] => 00:00:00
                    [COMMAND] => [migration/0]
                )

            [5] => Array
                (
                    [PID] => 6
                    [USER] => root
                    [%CPU] => 0.0
                    [%MEM] => 0.0
                    [RSS] => 0
                    [TT] => ?
                    [STAT] => S
                    [TIME] => 00:00:01
                    [COMMAND] => [watchdog/0]
                )

            [6] => Array
                (
                    [PID] => 7
                    [USER] => root
                    [%CPU] => 0.0
                    [%MEM] => 0.0
                    [RSS] => 0
                    [TT] => ?
                    [STAT] => S
                    [TIME] => 00:00:04
                    [COMMAND] => [migration/1]
                )

            [7] => Array
                (
                    [PID] => 8
                    [USER] => root
                    [%CPU] => 0.0
                    [%MEM] => 0.0
                    [RSS] => 0
                    [TT] => ?
                    [STAT] => S
                    [TIME] => 00:00:00
                    [COMMAND] => [migration/1]
                )
		.
		.
		.
		.
)