not able to make connection to Sql Database server from policy server

book

Article ID: 195828

calendar_today

Updated On:

Products

CA Single Sign On Secure Proxy Server (SiteMinder) CA Single Sign On Agents (SiteMinder) CA Single Sign On Federation (SiteMinder) CA Single Sign On SOA Security Manager (SiteMinder) SITEMINDER

Issue/Introduction

 

We're running a Custom code in a script to insert the smaccess line to the
MSSQL database. We launch it like this :

smaccess_import.sh :

  su - smuser -c "/opt/CA/siteminder/bin/smauditimport /tmp/tempfile MYDATABASE myaudituser mypassword -f -a1"

But the script fails to start and it reports error :

  [2020-07-20][02:30:01][INFO][Backup job started]
  /opt/CA/siteminder/bin/smauditimport: error while loading shared
  libraries: libsmutilities.so: cannot open shared object file: No
  such file or directory

How can we fix it ?

 

Cause

 

The error shows up as the code hasn't the Policy Server
environment variables set, and it cannot find the library :

  libsmutilities.so
 
smaccess_import.log :
  [2020-07-20][02:30:01][INFO][Backup job started]
  /opt/CA/siteminder/bin/smauditimport: error while loading shared
  libraries: libsmutilities.so: cannot open shared object file: No
  such file or directory

The smauditimport failing and we see the OS reports error code 127 :

wam_pserver_audit_backup.log :

  [2020-07-20][02:30:01][INFO][Backup job started]
  [2020-07-20][02:30:01][INFO][Preparing to import audit file: smaccess_1.log]
  [2020-07-20][02:30:01][INFO][Importing audit log: /tmp/smaccess.log]
  [2020-07-20][02:30:01][INFO][Import completed with exit status: 127]

 

Environment

 

Policy Server 12.8SP3 on RedHat 6

 

Resolution

 

  Make your custom script to set the Policy Server environment
  variables. Once sourced, the script then works and the smauditimport
  command returns 0 instead of 127 :

  + echo '[2020-07-21][09:44:18][INFO][Importing' audit log: '/tmp/smaccess_1.log]'
  + su - smuser -c "/opt/CA/siteminder/bin/smauditimport /tmp/tempfile MYDATABASE myaudituser mypassword -f -a1"
  Info : szDbmsName: Microsoft SQL Server
  Info : Bulk loading Supported
  Info : szDbmsName: Microsoft SQL Server
  Info : Bulk loading Supported

  [...]

  Successfully inserted 268916 rows to smaccesslog4 table.
  Successfully inserted 48 rows to smobjlog4 table.
  Total rows inserted: 268964.
  + echo '[2020-07-21][09:44:18][INFO][Import' completed with exit status: '0]'
  + gzip -c /tmp/smaccess.log
  + '[' 0 '!=' 0 ']'
  + echo '[2020-07-21][09:44:18][INFO][Backup' of smaccess_1.log was completed 'successfully]'