Table of Contents

Basic cmd job with debug details

Each scenario file defines exactly one job to be executed by the scheduled Tasker.pl These scenario files are created and scheduled by the YCE web front-end and are stored in the /var/opt/yce/jobs directory.

<node> := switch1
<verbose> := -v

task := Basic_cmd_job

Scenario execution

Each scenario file is executed by the tasker2.pl and is normally started using the at-queue for scheduling purposes.

The standard (log) output lists the compiled line number along with the action to be performed and its arguments.

$ /opt/yce/bin/tasker2.pl -l -j 0322_0002 -o 'xml'
switch1 Command_job...
JobID: 0322_0002
01-Description (switch1 Command_job...)
02-Description (Command_job on switch1)
   Establishing new session 'mgmt' for 'switch1'
   == Start for 'mgmt' to 'switch1'
   -- Start - reachable
   2017-03-22 10:27:05 Unreachable 'switch1': Address(es) not reachable at ports '23 '
   Session 'switch1' mgmt at '198.172.0.3' was aborted
   Action 'Start - reachable' aborted: Scenario stopped
ERROR: 'import_cfg' failed:
      Session 'switch1 - ' not found
03-Function (Import_cfg -q -n switch1 -f switch1.cmd -v)
04-If (if <error>)
05-Function (LogAction -n switch1 -a Command_job -m "Failed executing commands")
06-Stop: job finished
2017-03-22 10:27:05 ABORTED after 9 seconds

When a scenario is created, the Tasker evaluates and parses the script for errors. The result is shown as an indented script along with the line-numbers as shown during the execution.

$ /opt/yce/bin/tasker2.pl -l -j 0322_0002 -o 'xml' -t
Parsing scenario:
  1 [Scenario]
  2 Description switch1 Command_job...
  3 Description Command_job on switch1
  4 Import_cfg -q -n switch1 -f switch1.cmd -v
  5 if <error>
  6     LogAction -n switch1 -a Command_job -m "Failed executing commands"
  7     stop
  8 endif
  9 LogAction -n switch1 -a Command_job -m "Completed executing commands"
 10 end

Debugging scenario execution

When using the various levels of verbosity more detailed debugging information is displayed, as well as the parameters and the parsed script as shown above for reference purposes.

$ /opt/yce/bin/tasker2.pl -l -j 0322_0002 -o 'xml' -d 2
JobID: 0322_0002
Parsing scenario:
  1 [Scenario]
  2 Description switch1 Command_job...
  3 Description Command_job on switch1
  4 Import_cfg -q -n switch1 -f switch1.cmd -v
  5 if <error>
  6     LogAction -n switch1 -a Command_job -m "Failed executing commands"
  7     stop
  8 endif
  9 LogAction -n switch1 -a Command_job -m "Completed executing commands"
 10 end
01-Description (switch1 Command_job...)
02-Description (Command_job on switch1)
   Establishing new session 'mgmt' for 'switch1'
   == Start for 'mgmt' to 'switch1'
   -- Start - reachable
   2017-03-22 10:32:21 Unreachable 'switch1': Address(es) not reachable at ports '23 '
   Session 'switch1' mgmt at '198.172.0.3' was aborted
   Action 'Start - reachable' aborted: Scenario stopped
      Start done (1)
ERROR: 'import_cfg' failed:
      Session 'switch1 - ' not found
03-Function (Import_cfg -q -n switch1 -f switch1.cmd -v)
04-If (if <error>)
      runtime '1' ==> true (1)
      Condition = true (level=1)
      'logaction' ok
05-Function (LogAction -n switch1 -a Command_job -m "Failed executing commands")
06-Stop: job finished
2017-03-22 10:32:21 ABORTED after 15 seconds