Class: ScoutAgent::Order::SnapshotOrder

Inherits:
ScoutAgent::Order show all
Defined in:
lib/scout_agent/order/snapshot_order.rb

Overview

This type of Order can be used to request a snapshot over the XMPP interface. All snapshots requested this way are forced and, as such, not subject to command waits.

Constant Summary collapse

MATCH_RE =

The pattern of supported commands:

snapshot
snap-shot
snap_shot
/\A\s*snap[-_]?shot\s*\z/

Constants inherited from ScoutAgent::Order

ORDERS_DIR

Instance Attribute Summary

Attributes inherited from ScoutAgent::Order

#match_details, #message

Instance Method Summary collapse

Methods inherited from ScoutAgent::Order

can_handle?, inherited, #initialize, load_all, log, #log, log=, master_agent, match?, #notify_master, subclasses

Constructor Details

This class inherits a constructor from ScoutAgent::Order

Instance Method Details

#executeObject

Requests a snapshot via the API and then notifies the master agent to check-in pushing the snapshot to the server.



25
26
27
28
29
# File 'lib/scout_agent/order/snapshot_order.rb', line 25

def execute
  log.info("Requesting that a snapshot be taken.")
  API.take_snapshot(:force)
  notify_master
end