\PluginFusioninventoryWakeonlan

Manage the wake on lan of computers by the agent.

Summary

Methods
Properties
Constants
__construct()
getMessage()
setMessage()
sendMessage()
addLog()
import()
getTaskAgent()
addProlog()
addInventory()
handleOCSCommunication()
prepareRun()
run()
getAgentsSubnet()
No public properties found
No constants found
No protected methods found
$message
N/A
No private methods found
No private properties found
N/A

Properties

$message

$message : null

Define message variable

Type

null

Methods

__construct()

__construct() 

__contruct function used to initialize protected message variable

getMessage()

getMessage() : object

Get readable XML message (add carriage returns)

Returns

object —

SimpleXMLElement

setMessage()

setMessage(string  $message) 

Set XML message

Parameters

string $message

XML in string format

sendMessage()

sendMessage(string  $compressmode = 'none') 

Send response to agent, using given compression algorithm

Parameters

string $compressmode

compressed mode: none|zlib|deflate|gzip

addLog()

addLog(string  $p_logs) 

If extra-debug is active, write log

Parameters

string $p_logs

log message to write

import()

import(object  $arrayinventory) : boolean

Import and parse the XML sent by the agent

Parameters

object $arrayinventory

SimpleXMLElement

Returns

boolean

getTaskAgent()

getTaskAgent(integer  $agent_id) 

Get all tasks prepared for the agent

Parameters

integer $agent_id

id of the agent

addProlog()

addProlog() 

Set prolog for agent

addInventory()

addInventory(integer  $agents_id) 

Order to agent to do inventory if module inventory is activated for the agent

Parameters

integer $agents_id

id of the agent

handleOCSCommunication()

handleOCSCommunication(string  $rawdata, string  $xml = '', string  $output = 'ext') 

Manage communication with old protocol (XML over POST).

Used for inventory, network discovery, network inventory and wake on lan

Parameters

string $rawdata

data get from agent (compressed or not)

string $xml
string $output

prepareRun()

prepareRun(integer  $taskjobs_id) : string

Prepare a taskjob Get all devices and put in taskjobstate each task for each device for each agent

Parameters

integer $taskjobs_id

Returns

string

run()

run(object  $jobstate) : string

When agent contact server, this function send datas to agent

Parameters

object $jobstate

Returns

string

getAgentsSubnet()

getAgentsSubnet(integer  $nb_computers, string  $communication, string  $subnet = '') : array

Get agents on the subnet

Parameters

integer $nb_computers
string $communication
string $subnet

Returns

array