Environment variables fail to get translated when encountered as part of a command execution.

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Blocker
    • None
    • Environment:
      Automation for Tivoli Omnibus Netcool v7.1 on a Solaris v10 machine.

      Hi,

      I am using Jenkins(v1.506) to create a build automation for Tivoli Omnibus Netcool v7.1 on a Solaris v10 machine.
      When I try to execute the Probe rules syntax check command '/opt/netcool/omnibus/probes/nco_p_syntax -rulesfile $NC_RULES_HOME/snmptrap.rules -server WAOSCV1', in which $NC_RULES_HOME is an environment variable '/opt/netcool/etc/rules/'. This enviroment variable is set using 'envinject' plugin. The command is executed using publish-over-ssh plugins

      The enviorment variable $NC_RULES_HOME is converted as '/opt/netcool/etc/rules/' in the given command, but when the files are read as part of the 'nco_p_syntax' command, the $NC_RULES_HOME is not decoded to '/opt/netcool/etc/rules/'. PFB the console output.

      Started by user anonymous
      [EnvInject] - Loading node environment variables.
      Building in workspace C:\Program Files\Jenkins\workspace\sytaxcheck2
      [EnvInject] - Executing scripts and injecting environment variables after the SCM step.
      [EnvInject] - Injecting as environment variables the properties content
      NC_RULES_HOME=/opt/netcool/etc/rules

      [EnvInject] - Variables injected successfully.
      SSH: Connecting from host HOST
      SSH: Connecting with configuration SERVER ...
      SSH: EXEC: STDOUT/STDERR from command [/opt/netcool/omnibus/probes/nco_p_syntax -rulesfile /opt/netcool/etc/rules/snmptrap.rules -server WAOSCV1] ...
      03/25/13 19:41:28: Warning: Failed to load properties file : No such file or directory
      03/25/13 19:41:28: Information: Connecting ...
      03/25/13 19:41:28: Information: Checking rules file ...
      03/25/13 19:41:28: Debug: Reading /opt/netcool/etc/rules/snmptrap.rules
      03/25/13 19:41:28: Debug: Plain text rules file detected.
      03/25/13 19:41:28: Error: Rules file '/opt/netcool/etc/rules/snmptrap.rules' line 98: Failed to read lookup table file '$NC_RULES_HOME/include-snmptrap/CorrScore.snmptrap.lookup'
      03/25/13 19:41:28: Information: Falling back to previous rules file.
      03/25/13 19:41:28: Error: Error(s) in rules file
      03/25/13 19:41:28: Information: Disconnecting ...
      03/25/13 19:41:28: Warning: Disconnect malfunction - continuing shutdown anyway
      SSH: EXEC: completed after 811 ms
      SSH: Disconnecting configuration SERVER ...
      ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [2]]
      Build step 'Send files or execute commands over SSH' changed build result to UNSTABLE
      Finished: UNSTABLE

            Assignee:
            Gregory Boissinot
            Reporter:
            Nipin Joshy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: