Properties

$dohistory

$dohistory : boolean

We activate the history.

Type

boolean

$rightname

$rightname : string

The right name for this class

Type

string

Methods

getTypeName()

getTypeName(integer  $nb) : string

Get name of this type by language of the user connected

Parameters

integer $nb

number of elements

Returns

string —

name of this type

getSearchOptions()

getSearchOptions() : array

Get search function for the class

Returns

array

defineTabs()

defineTabs(array  $options = array()) : array

Define tabs to display on form page

Parameters

array $options

Returns

array —

containing the tabs name

getTabNameForItem()

getTabNameForItem(object  $item, integer  $withtemplate) : string

Get the tab name used for item

Parameters

object $item

the item object

integer $withtemplate

1 if is a template form

Returns

string —

name of the tab

displayTabContentForItem()

displayTabContentForItem(object  $item, integer  $tabnum = 1, integer  $withtemplate) : boolean

Display the content of the tab

Parameters

object $item
integer $tabnum

number of the tab to display

integer $withtemplate

1 if is a template form

Returns

boolean

getComments()

getComments() : string

Get comments of the object

Returns

string —

comments in HTML format

getSpecificMassiveActions()

getSpecificMassiveActions(object|null  $checkitem = NULL) : array

Get the massive actions for this object

Parameters

object|null $checkitem

Returns

array —

list of actions

showMassiveActionsSubForm()

showMassiveActionsSubForm(object  $ma) : boolean

Display form related to the massive action selected

Parameters

object $ma

MassiveAction instance

Returns

boolean

processMassiveActionsForOneItemtype()

processMassiveActionsForOneItemtype(object  $ma, object  $item, array  $ids) 

Execution code for massive action

Parameters

object $ma

MassiveAction instance

object $item

item on which execute the code

array $ids

list of ID on which execute the code

showForm()

showForm(integer  $agents_id, array  $options = array()) : boolean

Display form for agent configuration

Parameters

integer $agents_id

ID of the agent

array $options

Returns

boolean

infoByKey()

infoByKey(string  $device_id) : array

Get agent information by device_id

Parameters

string $device_id

Returns

array —

all data of agent from database

importToken()

importToken(array  $arrayinventory) : integer

Import token: create of update it in database

Parameters

array $arrayinventory

Returns

integer —

id of the agent from database

getIPs()

getIPs() : array

Get all IP of the computer linked with this agent

Returns

array —

list of IP

getAgentWithComputerid()

getAgentWithComputerid(integer  $computers_id) : integer|false

Get the agent id linked to this computer id

Parameters

integer $computers_id

id of the agent

Returns

integer|false —

integer if found agent id, otherwise false

getAgentsFromComputers()

getAgentsFromComputers(array  $computer_ids = array()) : array

Get the agents id of a list of computers id

Parameters

array $computer_ids

list of id of computers

Returns

array —

list of agents [id] => information of agent

getAssociatedComputer()

getAssociatedComputer() : object|false

Get the computer linked with this agent

Returns

object|false —

return Computer object if exist, otherwise false

setAgentWithComputerid()

setAgentWithComputerid(integer  $computers_id, string  $device_id, integer  $entities_id) : boolean

Link a computer with an agent

Parameters

integer $computers_id

id of the computer

string $device_id

devide_id of the agent

integer $entities_id

id of the entity

Returns

boolean —

true if successfully linked

showRemoteStatus()

showRemoteStatus(object  $computer = null) 

Display form with the remotely status of agent (available, not available, waiting, running.

..)

Parameters

object $computer

Computer object

getStatus()

getStatus() : array

Get the remotely status of the agent (available, not available, waiting, running.

..)

Returns

array

wakeUp()

wakeUp() : boolean

Send a request to the remotely agent to run now

Returns

boolean —

true if send successfully, otherwise false

disableDebug()

disableDebug() 

Disable debug mode because we don't want see warning / errors

errorempty()

errorempty() 

When debug is disabled, we transfer every errors in this emtpy function.

restoreDebug()

restoreDebug() 

Restore debug mode if it has been explicitly set by the user in his settings.

setAgentVersions()

setAgentVersions(integer  $agent_id, string  $module, string  $version) 

Store version of each module of agent

Parameters

integer $agent_id

id of the agent

string $module

name of the module (inventory, deploy...)

string $version

version of the module

getAgentVersion()

getAgentVersion(integer  $agent_id) : string

Get the version of agent (it's the same number as inventory module)

Parameters

integer $agent_id

id of the agent

Returns

string —

version of agent

getByDeviceID()

getByDeviceID(string  $device_id) : array|false

get the agent by the device_id

Parameters

string $device_id

the device_id sent by the agent

Returns

array|false —

agent information if found, otherwise false

getAgentBaseURLs()

getAgentBaseURLs() : array

Get / generate the URLs to communicate with current agent

Returns

array —

list of HTTP URL used to contact the agent

getAgentStatusURLs()

getAgentStatusURLs() : array

Get the URLs used to get the status of the agent

Returns

array —

list of HTTP URL to get the agent's state

getAgentRunURLs()

getAgentRunURLs() : array

Get the URLs used to wake up the agent

Returns

array —

liste of HTTP URL to ask the agent to wake up

showConfig()

showConfig() 

Display configuration form of agent

pre_updateInDB()

pre_updateInDB() 

Disable data to put in glpi_logs because don't want to write all these very often chnages

showInfoForComputer()

showInfoForComputer(integer  $computers_id) 

Display agent information for a computer

Parameters

integer $computers_id

id of the computer

cronCleanoldagents()

cronCleanoldagents(object  $task = NULL) : boolean

Cron task: clean or do defined action when agent not have been contacted the server since xx days

Parameters

object $task

Returns

boolean —

true if successfull, otherwise false