Kernel-free plug-in
The Kernel-free (KF) base flow plug-in allows you to configure:
The samplePluginKF.rbc file provided below is an example of kernel-free plug-in executing the redirection on an alternate server for targets with a specific model family and executing a default task for all the others. This plugin is executed on the server.
Sample:
/**
* plug-in function invoked at each PXE boot.
*/
var extension_function(var params)
{
// two main parameters are passed to identify the booting target:
//MAC: The macaddress of the machine
//Model: The model of the machine.
//The answer is made of an ini file including the calculated parameters.
var myini = NewIniFile();
if(StrMatchCI(params.Model,"IBM-90*"))
{
str resultingIP= "10.10.1.121";
25
SetIniValue(myini, "SERVER", "ip", resultingIP);
}e
lse
{
//Assign the default task (by ID) to be executed by the target when
idle!!
str defaultTask = "inventory";
SetIniValue(myini, "TASK", "name", defaultTask);
str resultingEngine = "AGENT_WPE";
SetIniValue(myini, "ENGINE", "type", resultingEngine);
}
return myini;
}
//Register the extension function to manage the targets (clients) kernel free
PXE boot.
bool val = registerExtensionPoint('TARGET_BOOT','prova',extension_function);
The developed rbc/rbx file containing the custom business logic must be saved under the following predefined directory on the server file system:
global/serverext/SamplePluginKF.rbc
Notice the /serverext/ path since the plug-in runs on the server context.
Kernel plug-in
The Kernel base flow plug-in allows you to configure:
The samplePluginRB.rbc file provided below is an example of kernel plug-in executing the redirection on an alternate server for targets with a specific model family and executing a default task for all the others. This plugin is executed on the agent.
Sample:
/**
* plug-in function invoked at each PXE boot.
*/
var extension_function(var params){
// two main parameters are passed to identify the booting target:
//MAC: The macaddress of the machine
//Model: The model of the machine.
//The answer is made of an ini file including the calculated parameters.
var myini = NewIniFile();
if(StrMatchCI(params.Model,"IBM-90*")){
str resultingIP= "10.10.1.121";
SetIniValue(myini, "SERVER", "ip", resultingIP);
}
26
else{
//Assign the default task (by ID) to be executed by the target when
idle!!
str defaultTask = "inventory";
SetIniValue(myini, "TASK", "name", defaultTask);
}
return myini;
}
//REgister the extension function to manage the targets (clients) kernel free
PXE boot.
bool val =
registerExtensionPoint('TARGET_BOOT_KN','prova',extension_function);
The developed rbc/rbx file containing the custom business logic must be saved under the following predefined directory on the server file system:
global/agentext/SamplePluginRB.rbc
Notice the /agentext/ path since the plug-in runs on the agent context.