Agent-TCLI

 view release on metacpan or  search on metacpan

lib/Agent/TCLI/Package/Tail.pm  view on Meta::CPAN

    are always processed in the order that they were created. The default
    ordered setting is off for both tests and watches.
  type: Switch
---
Agent::TCLI::Parameter:
  name: feedback
  help: Sets the feedback level for what is seen.
  manual: >
    Feedback sets the level of additional information about the line that is
    returned. Currently it is either zero, which is nothing,
    or one, which returns the whole line. Feedback occurs when a line is
    matched or if a test is set for verbose. Feedback is set per test, so
    if multiple tests are active and verbose is one, there is the possibility
    of seeing the same line more than once. This is useful for debugging
    a particular test/watch.
  type: Switch
---
Agent::TCLI::Parameter:
  name: test_verbose
  aliases: verbose|v
  help: Sets the verbosity level for a test.
  manual: >
    Verbose sets the level of additional information about the test that is
    returned. Currently it is either zero, which is nothing,
    or one, which enables feedback (if set) on every line that is seen.
  type: Switch
---
Agent::TCLI::Parameter:
  name: cache
  help: Determines whether the line cache is used.
  manual: >
    The line cache will hold the most recent lines seen. This option determines
    whether to use the line cache or only examine new lines when a test is set.
    The default for tests is on, and for watches is off. To turn off use
    no-cache as a test/watch option.
  type: Switch
---
Agent::TCLI::Parameter:
  name: line_cache
  help: The lines in the cache currently.
  manual: >
    The line cache will hold the most recent lines seen. This will show the
    contents of the line cache.
  type: Switch
---
Agent::TCLI::Parameter:
  name: test_queue
  help: The tests and watches that have been requested.
  manual: >
    The test_queue holds all the tests that have been requested.
    This could be a very long list.
  type: Switch
---
Agent::TCLI::Parameter:
  name: active
  help: The tests and watches that are currently active.
  type: Switch
---
Agent::TCLI::Command:
  name: tail
  call_style: session
  command: tcli_tail
  contexts:
    ROOT: tail
  handler: establish_context
  help: tail a file
  topic: testing
  usage: tail file add file /var/log/messages
---
Agent::TCLI::Command:
  name: file
  call_style: session
  command: tcli_tail
  contexts:
    tail: file
  handler: establish_context
  help: manipulate files for tailing
  topic: testing
  usage: tail file add file /var/log/messages
---
Agent::TCLI::Command:
  name: file-add
  call_style: session
  command: tcli_tail
  contexts:
    tail:
      file: add
  handler: file
  help: designate a file for tailing
  topic: testing
  usage: tail file add file /var/log/messages
---
Agent::TCLI::Command:
  name: file-delete
  call_style: session
  command: tcli_tail
  contexts:
    tail:
      file: delete
  handler: file
  help: delete a tailing of a file
  topic: testing
  usage: tail file delete file /var/log/messages
---
Agent::TCLI::Command:
  name: test
  call_style: session
  command: tcli_tail
  contexts:
    tail:
      - test
      - watch
  handler: establish_context
  help: manipulate tests on tails
  topic: testing
  usage: tail test add like qr(alert)
---
Agent::TCLI::Command:
  name: test-watch-add
  call_style: session
  command: tcli_tail
  contexts:
    tail:
      test: add
      watch: add
  handler: test
  help: add a new tests on the tails
  parameters:
    feedback:
    test_match_times:
    test_max_lines:
    name:
    ordered:
    test_ttl:
    test_verbose:
  topic: testing
  usage: tail test add like qr(alert) <options>
---
Agent::TCLI::Command:
  call_style: session
  command: tcli_tail
  contexts:
    tail:
      test: delete
      watch: delete
  handler: test
  help: delete a test on the tails
  name: test-watch-delete
  topic: testing
  usage: tail test delete num 42
---
Agent::TCLI::Command:
  name: set
  call_style: session
  command: tcli_tail
  contexts:
    tail: set
  handler: settings
  help: adjust default settings
  parameters:
    ordered:
    interval:
    line_max_cache:
    line_hold_time:
    test_max_lines:
    test_match_times:
    test_ttl:
    test_verbose:
  topic: testing
  usage: tail set test_max_lines 5
---
Agent::TCLI::Command:
  name: show
  call_style: session
  command: tcli_tail
  contexts:
    tail: show
  handler: show
  help: show tail default settings and state
  parameters:
    ordered:
    interval:
    line_max_cache:
    line_hold_time:
    test_max_lines:
    test_match_times:
    test_ttl:
    test_verbose:
    test_queue:
    line_cache:
    active:
  topic: testing
  usage: tail show settings
---
Agent::TCLI::Command:
  name: log
  call_style: session
  command: tcli_tail
  contexts:
    tail: log
  handler: log
  help: add text to the line queue
  manual: >
    The log command allows one to add a line of text to the queue. It helped
    to facilitate testing of the tail package, but might not be useful
    otherwise. Still, here it is. Any text following log appears in the line
    queue as if it was coming from a tailed file.
  topic: testing
  usage: tail log "some text"
---
Agent::TCLI::Command:
  call_style: session
  command: tcli_tail
  contexts:
    tail: clear
  handler: establish_context
  help: clears out a cache
  name: clear
  topic: testing
  usage: tail clear lines
---
Agent::TCLI::Command:
  call_style: session
  command: tcli_tail
  contexts:
    tail:
      clear: lines
  handler: clear
  help: clears out the line cache
  name: clear_lines
  topic: testing
  usage: tail clear lines
...

}

=item _shutdown

This POE event handler is used to initiate a shutdown of the Package.

=cut

sub _shutdown :Cumulative {
	my ($kernel,  $self,) =
      @_[KERNEL, OBJECT,];
	$self->Verbose("_shutdown:tail ".$self->name." shutting down");

    return;
}

=item _start

This POE event handler is called when POE starts up a Package.
The B<_start> method is :Cumulative within OIO.

=cut

sub _start {
	my ($kernel,  $self,  $session) =
      @_[KERNEL, OBJECT,   SESSION];
    $self->Verbose("_start: Starting test_tail ");

	# are we up before OIO has finished initializing object?
	if (!defined( $self->name ))
	{
		$kernel->yield('_start');
		return;
	}

	# There is only one command object per TCLI
    $kernel->alias_set($self->name);

	$kernel->delay('PruneLineCache',10);
	$kernel->delay('Activate', $self->interval , 0 );

	return("_start ".$self->name);
}

1;
#__END__

=back



( run in 1.055 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )