User Tools

Site Tools


Sidebar

NetYCE Documentation



guides:user:scenarios:basic_cmd_debug

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> := TE--RN01001
<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'
TE--RN01001 Command_job...
JobID: 0322_0002
01-Description (TE--RN01001 Command_job...)
02-Description (Command_job on TE--RN01001)
   Establishing new session 'mgmt' for 'te--rn01001'
   == Start for 'mgmt' to 'TE--RN01001'
   -- Start - reachable
   2017-03-22 10:27:05 Unreachable 'TE--RN01001': Address(es) not reachable at ports '23 '
   Session 'TE--RN01001' mgmt at '10.3.132.3' was aborted
   Action 'Start - reachable' aborted: Scenario stopped
ERROR: 'import_cfg' failed:
      Session 'TE--RN01001 - ' not found
03-Function (Import_cfg -q -n TE--RN01001 -f TE--RN01001.cmd -v)
04-If (if <error>)
05-Function (LogAction -n TE--RN01001 -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 TE--RN01001 Command_job...
  3 Description Command_job on TE--RN01001
  4 Import_cfg -q -n TE--RN01001 -f TE--RN01001.cmd -v
  5 if <error>
  6     LogAction -n TE--RN01001 -a Command_job -m "Failed executing commands"
  7     stop
  8 endif
  9 LogAction -n TE--RN01001 -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 TE--RN01001 Command_job...
  3 Description Command_job on TE--RN01001
  4 Import_cfg -q -n TE--RN01001 -f TE--RN01001.cmd -v
  5 if <error>
  6     LogAction -n TE--RN01001 -a Command_job -m "Failed executing commands"
  7     stop
  8 endif
  9 LogAction -n TE--RN01001 -a Command_job -m "Completed executing commands"
 10 end
01-Description (TE--RN01001 Command_job...)
02-Description (Command_job on TE--RN01001)
   Establishing new session 'mgmt' for 'te--rn01001'
   == Start for 'mgmt' to 'TE--RN01001'
   -- Start - reachable
   2017-03-22 10:32:21 Unreachable 'TE--RN01001': Address(es) not reachable at ports '23 '
   Session 'TE--RN01001' mgmt at '10.3.132.3' was aborted
   Action 'Start - reachable' aborted: Scenario stopped
      Start done (1)
ERROR: 'import_cfg' failed:
      Session 'TE--RN01001 - ' not found
03-Function (Import_cfg -q -n TE--RN01001 -f TE--RN01001.cmd -v)
04-If (if <error>)
      runtime '1' ==> true (1)
      Condition = true (level=1)
      'logaction' ok
05-Function (LogAction -n TE--RN01001 -a Command_job -m "Failed executing commands")
06-Stop: job finished
2017-03-22 10:32:21 ABORTED after 15 seconds
guides/user/scenarios/basic_cmd_debug.txt · Last modified: 2019/12/24 08:34 by bdorlandt