Class: ZabbixManager::Scripts
- Defined in:
- lib/zabbix_manager/classes/scripts.rb
Instance Method Summary collapse
-
#execute(data) ⇒ Object
Submits a request to the zabbix api data - A Hash containing the scriptid and hostid.
- #getscriptsbyhost(data) ⇒ Object
-
#identify ⇒ String
The id field name used for identifying specific Screen objects via Zabbix API.
- #method_name ⇒ Object
Methods inherited from Basic
#add, #all, #create, #create_or_update, #default_options, #delete, #destroy, #dump_by_id, #get, #get_full_data, #get_id, #get_key_ids, #get_key_ids_by_identify, #get_or_create, #get_or_create_keys, #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 ZabbixManager::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
23 24 25 26 27 28 29 30 31 |
# File 'lib/zabbix_manager/classes/scripts.rb', line 23 def execute(data) @client.api_request( method: "script.execute", params: { scriptid: data[:scriptid], hostid: data[:hostid] } ) end |
#getscriptsbyhost(data) ⇒ Object
33 34 35 |
# File 'lib/zabbix_manager/classes/scripts.rb', line 33 def getscriptsbyhost(data) @client.api_request(method: "script.getscriptsbyhosts", params: data) end |
#identify ⇒ String
The id field name used for identifying specific Screen objects via Zabbix API
12 13 14 |
# File 'lib/zabbix_manager/classes/scripts.rb', line 12 def identify "name" end |
#method_name ⇒ Object
5 6 7 |
# File 'lib/zabbix_manager/classes/scripts.rb', line 5 def method_name "script" end |