Class: ZabbixApi::Scripts

Inherits:
Basic
  • Object
show all
Defined in:
lib/zabbixapi/classes/scripts.rb

Instance Method Summary collapse

Methods inherited from Basic

#add, #all, #create, #create_or_update, #default_options, #delete, #destroy, #dump_by_id, #get, #get_full_data, #get_id, #get_or_create, #get_raw, #hash_equals?, #initialize, #key, #keys, #log, #merge_params, #normalize_array, #normalize_hash, #parse_keys, #symbolize_keys, #update

Constructor Details

This class inherits a constructor from ZabbixApi::Basic

Instance Method Details

#execute(data) ⇒ Object

Submits a request to the zabbix api data - A Hash containing the scriptid and hostid

Example:

execute({ scriptid: '12', hostid: '32 })

Returns nothing



21
22
23
24
25
26
27
28
29
# File 'lib/zabbixapi/classes/scripts.rb', line 21

def execute(data)
  @client.api_request(
    method: 'script.execute',
    params: {
      scriptid: data[:scriptid],
      hostid: data[:hostid]
    }
  )
end

#getscriptsbyhost(data) ⇒ Object



31
32
33
# File 'lib/zabbixapi/classes/scripts.rb', line 31

def getscriptsbyhost(data)
  @client.api_request(method: 'script.getscriptsbyhosts', params: data)
end

#indentifyString

The id field name used for identifying specific Screen objects via Zabbix API

Returns:

  • (String)


10
11
12
# File 'lib/zabbixapi/classes/scripts.rb', line 10

def indentify
  'name'
end

#method_nameObject



3
4
5
# File 'lib/zabbixapi/classes/scripts.rb', line 3

def method_name
  'script'
end