Cancel
Showing results for 
Search instead for 
Did you mean: 

Sold To ID in PB

Valued Contributor
Valued Contributor

Hello,

 

Is there any way to extract Sold To ID in PB?

I did this by executing "lictool.exe" from PB, but I am looking for a better solution. For example a mom parameter or something in NX?

 

Kind regards,

Majid

Majid
6 REPLIES 6

Re: Sold To ID in PB

Phenom
Phenom

sorry @Majid , but I don't understand , mom_* is a variable , the exec command in Tcl can do the same job , if lictool.exe can get the Sold to ID , I don't see why you want a mom or a paramater...

Production: NX11.0.2.7,VERICUT 8.1.2
Development: Tcl/Tk, Gnuplot
www.adgroupe.com

Re: Sold To ID in PB

Valued Contributor
Valued Contributor

Hi @mkn ,

 

Thanks for your reply. You are right, it is working as I mentioned, but not all the time. The first step is to find the file lictool.exe when using exec. Some customers do not install NX on C: or default path, so exec fails when some charachters or address types are inside the path name. Then in some cases executing lictool.exe requires admin permision which again ends to an error. And finally I have to push the server info results to a file in order to extract Sold To ID which again raises the permission problem on memory. These were problems I faced for some customers, so I was wondering if there is a better way.

 

Kind regards,

Majid

Majid

Re: Sold To ID in PB

Phenom
Phenom

Hi @Majid ,

 


@Majid wrote:

. Some customers do not install NX on C: or default path (...)


It's not a problem by default lictool.exe is in "UGII_BASE_DIR/UGFLEXLM", it does not matter if your users have different paths

 

@Majid wrote:

(...) exec fails when some charachters or address types are inside the path name

ok , I'm not sure but Nx must be installed on the user's computeur , I don't see why , may be you can show me an example...

 

@Majid wrote:

(...) in some cases executing lictool.exe requires admin permision (...)

There are a lot of utilities that work with Nx, I do not understand why this one would be forbidden, in my case I'm not an admin and I have access to lictool.exe That say... You are right , it's a problem Smiley Frustrated ,and I can understand that some users do not have access...

 


@Majid wrote:

(...) And finally I have to push the server info results to a file in order to extract Sold To ID which again raises the permission problem on memory.


you can extract the ID without to write in a file , if you don't know without to write in a file, you can write in a directory where the user has access e.g C:\temp (permission is allowed) . For the memory ,if you speak in terms of processing time , yes the first time but you can write in a file the SoldID and read this file every time when you do post processing.

The second solution that I know it's to read the *.syslog but you may still have path and authorization issues

 

Production: NX11.0.2.7,VERICUT 8.1.2
Development: Tcl/Tk, Gnuplot
www.adgroupe.com

Re: Sold To ID in PB

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Another solution might be to use the syslog file and process that.

 

proc getSoldToId { } {
    set fp [open "[MOM_ask_syslog_name]" r]

    while { [gets $fp data] >= 0 } {
        if {[string first "License File Sold To / Install" $data] != -1} {
            set data [string replace $data 0 36 ""]
            break
        }

    }
    close $fp
    return $data
}

MOM_output_to_listing_device "sold to id : [getSoldToId]"

Re: Sold To ID in PB

Valued Contributor
Valued Contributor

Hello @mkn , and @averschoot 

 

Again thanks a lot for your time. I also tried to solve the mentioed issues in the same ways, including execution of lictools.exe using a batch file that is more convinient. All works very well but still reading it directly from NX parameters or variables itself is the best way to standardize the case. Using the current methods need sometimes small touch ups in my codes for some certain customers to make it work, however, it still works quit good for all my customers as I mentioned.

 

Kind regards,

Majid

 

Majid

Re: Sold To ID in PB

Phenom
Phenom

Still using exec however this should work in most cases.

 

proc Get_HostID { } {
   if { [catch { exec "[MOM_ask_env_var UGII_BASE_DIR]\\UGFLEXLM\\lictool.exe" --getserverinfo } result] } {
      MOM_output_to_listing_device "Cannot execute lictool.exe"
      MOM_output_to_listing_device "Error: $::errorInfo"
   } else {
      regexp -nocase -- {Sold To ID:\s+(\d+)} $result tmp hostid
      if { [info exists hostid] } {
         return $hostid
      } else {
         return 0
      }
   }
}

Learn online





Solution Information