Error when launching a Spectrum OneClick custom menu pick that uses curl
search cancel

Error when launching a Spectrum OneClick custom menu pick that uses curl

book

Article ID: 368629

calendar_today

Updated On:

Products

DX NetOps CA Spectrum

Issue/Introduction

We have created the following custom menu pick in OneClick to execute a curl command when selected:

  <item name="BGP BACK TRANS - Test">
    <popup-visibility>when-filter-passed</popup-visibility>
    <action>
      <context>
        com.aprisma.spectrum.app.alarm.client.group.AlarmContext
      </context>
      <filter>
            <and>
                <has-attribute>AlarmAttrID.ALARM_ID</has-attribute>
                <or>
                    <!-- BGP BACKWARD TRANS NOTIFICATION (0x220011)-->
                    <equals> <attribute id="AlarmAttrID.CAUSE_CODE"> <value>0x220011</value> </attribute> </equals>
                    <!-- Custom BGP BACKWARD TRANS NOTIFICATION (0x65607a20)-->
                    <equals> <attribute id="AlarmAttrID.CAUSE_CODE"> <value>0x65607a20</value> </attribute> </equals>                    
                </or>
           </and>
      </filter>
      <launch-web-server-script>
        <command>/usr/bin/curl  -s -X GET --header 'content-type: application/xml' --user User:Password  "https://OneClick:8443/spectrum/restful/landscapes" </command>
        <param> <expression> com.aprisma.spectrum.app.util.context.DefaultApplicationContext.getGlobalParameter(com.aprisma.spectrum.app.util.context.ApplicationContext.USER_PARAMETER_NAME) </expression> </param>
        <param> <attribute>AlarmAttrID.ALARM_ID</attribute> </param>
        <display-exit-status>
          <status code="1">Restful alarm get issue</status>
          <status code="2">BGP application support not available</status>
          <status code="3">BGP Peer not found</status>
          <status default="true">Unknown error code {0}</status>
        </display-exit-status>
        <display-output/>

      </launch-web-server-script>
    </action>
  </item>

This works fine with Spectrum installed on Linux 7 but on Linux 8, we get the following error:

Error:    /usr/bin/curl: symbol lookup error: /lib64/libk5crypto.so.3: undefined symbol: EVP_KDF_ctrl, version OPENSSL_1_1_1b

Environment

Version: Any version running on Linux 8
Component: OneClick

Cause

The curl version for Linux 8 is not compatible with the libcrypto.so.1.1 library shipped with Spectrum in the $SPECROOT/lib directory.

Resolution

What we need to do is force the curl command to use the out of the box libcrypto.so.1.1 library. 

In the lab, we wrote a script named test.sh in the $SPECROOT/tmp directory as follows:

export LD_LIBRARY_PATH=/usr/lib64/;/usr/bin/curl -kv -X GET --header 'content-type: application/xml' --user User:Password "https://OneClick:8443/spectrum/restful/landscapes"

Then we modified the menu item to execute the script:

      <launch-web-server-script>
      <command>/app/spectrum/tmp/test.sh</command>
        <param> <expression> com.aprisma.spectrum.app.util.context.DefaultApplicationContext.getGlobalParameter(com.aprisma.spectrum.app.util.context.ApplicationContext.USER_PARAMETER_NAME) </expression> </param>
        <param> <attribute>AlarmAttrID.ALARM_ID</attribute> </param>
        <display-exit-status>
          <status code="1">Restful alarm get issue</status>
          <status code="2">BGP application support not available</status>
          <status code="3">BGP Peer not found</status>
          <status default="true">Unknown error code {0}</status>
        </display-exit-status>
        <display-output/>
      </launch-web-server-script>

Now the curl command runs as expected.