Kernel configuration

Use the Kernel configuration API to display the kernal configuration of the server. The API response will contain “kernelconf” as the data of the configuration file present on the server. This data is used for the creation of Virtual Private Servers.

HTTP Request

https://hostname:4085/index.php?act=kernelconf

Parameters

NameMethodValueDescriptionRequired
actGETkernelconfThe action specified to perform operation and retrieve dataYes

Sample Code

<?php

    require_once('/usr/local/virtualizor/sdk/admin.php');

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';

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

    $output = $admin->kernelconf();

    print_r(json_encode($output));
?>

Output

{
    "title": "Kernel Configuration",
    "kernelconf": "## Global parameters\nVIRTUOZZO=yes\nLOCKDIR=\/vz\/lock\nDUMPDIR=\/vz\/dump\nVE0CPUUNITS=1000\n\n## Logging parameters\nLOGGING=yes\nLOGFILE=\/var\/log\/vzctl.log\nLOG_LEVEL=0\nVERBOSE=0\n\n## Disk quota parameters\nDISK_QUOTA=yes\nVZFASTBOOT=no\n\n# Disable module loading. If set, vz initscript do not load any modules.\n# MODULES_DISABLED=yes\n\n# The name of the device whose IP address will be used as source IP for CT.\n# By default automatically assigned.\n# VE_ROUTE_SRC_DEV=\"eth0\"\n\n# Controls which interfaces to send ARP requests and modify APR tables on.\nNEIGHBOUR_DEVS=all\n\n\n## Template parameters\nTEMPLATE=\/vz\/template\n\n## Defaults for containers\nVE_ROOT=\/vz\/root\/$VEID\nVE_PRIVATE=\/vz\/private\/$VEID\nCONFIGFILE=\"basic\"\nDEF_OSTEMPLATE=\"centos-5\"\n\n## Load vzwdog module\nVZWDOG=\"no\" \n\n## IPv4 iptables kernel modules\nIPTABLES=\"ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp ipt_owner ipt_REDIRECT\"\n## To be loaded by init.d\/vz script\nIPTABLES_MODULES=\"$IPTABLES\"\n\n## Enable IPv6\nIPV6=\"yes\"\n\n## IPv6 ip6tables kernel modules\nIP6TABLES=\"ip6_tables ip6table_filter ip6table_mangle ip6t_REJECT\"\n\n## Filesystem layout for new CTs: either simfs or ploop\nVE_LAYOUT=ploop\nSKIP_SYSCTL_SETUP=yes\n",
    "timenow": "1473905520",
    "time_taken": "0.126"
}
Was this helpful to you?