90 lines
2.2 KiB
Python
90 lines
2.2 KiB
Python
|
|
"""
|
||
|
|
Check NX License Configuration
|
||
|
|
"""
|
||
|
|
|
||
|
|
import os
|
||
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
print("="*60)
|
||
|
|
print("NX LICENSE CONFIGURATION CHECK")
|
||
|
|
print("="*60)
|
||
|
|
|
||
|
|
# Check environment variables
|
||
|
|
print("\n--- Environment Variables ---")
|
||
|
|
|
||
|
|
license_vars = [
|
||
|
|
'SPLM_LICENSE_SERVER',
|
||
|
|
'UGII_LICENSE_BUNDLE',
|
||
|
|
'LM_LICENSE_FILE',
|
||
|
|
'NX_LICENSE_FILE',
|
||
|
|
]
|
||
|
|
|
||
|
|
for var in license_vars:
|
||
|
|
value = os.environ.get(var)
|
||
|
|
if value:
|
||
|
|
print(f" ✓ {var} = {value}")
|
||
|
|
else:
|
||
|
|
print(f" ✗ {var} = (not set)")
|
||
|
|
|
||
|
|
# Check license server files
|
||
|
|
print("\n--- License Server Files ---")
|
||
|
|
|
||
|
|
possible_license_files = [
|
||
|
|
Path("C:/Program Files/Siemens/License Server/ugslmd.opt"),
|
||
|
|
Path("C:/Program Files/Siemens/License Server/server.lic"),
|
||
|
|
Path("C:/Program Files (x86)/Siemens/License Server/ugslmd.opt"),
|
||
|
|
]
|
||
|
|
|
||
|
|
for lic_file in possible_license_files:
|
||
|
|
if lic_file.exists():
|
||
|
|
print(f" ✓ Found: {lic_file}")
|
||
|
|
else:
|
||
|
|
print(f" ✗ Not found: {lic_file}")
|
||
|
|
|
||
|
|
# Check NX installation licensing
|
||
|
|
print("\n--- NX Installation License Info ---")
|
||
|
|
|
||
|
|
nx_dirs = [
|
||
|
|
Path("C:/Program Files/Siemens/NX2412"),
|
||
|
|
Path("C:/Program Files/Siemens/Simcenter3D_2412"),
|
||
|
|
]
|
||
|
|
|
||
|
|
for nx_dir in nx_dirs:
|
||
|
|
if nx_dir.exists():
|
||
|
|
print(f"\n{nx_dir.name}:")
|
||
|
|
license_file = nx_dir / "ugslmd.lic"
|
||
|
|
if license_file.exists():
|
||
|
|
print(f" ✓ License file: {license_file}")
|
||
|
|
else:
|
||
|
|
print(f" ✗ No ugslmd.lic found")
|
||
|
|
|
||
|
|
print("\n" + "="*60)
|
||
|
|
print("RECOMMENDATIONS:")
|
||
|
|
print("="*60)
|
||
|
|
|
||
|
|
print("""
|
||
|
|
1. If you see SPLM_LICENSE_SERVER:
|
||
|
|
- License server is configured ✓
|
||
|
|
|
||
|
|
2. If no environment variables are set:
|
||
|
|
- You may need to set SPLM_LICENSE_SERVER
|
||
|
|
- Format: port@hostname (e.g., 28000@localhost)
|
||
|
|
- Or: path to license file
|
||
|
|
|
||
|
|
3. Common fixes:
|
||
|
|
- Set environment variable in Windows:
|
||
|
|
setx SPLM_LICENSE_SERVER "28000@your-license-server"
|
||
|
|
|
||
|
|
- Or use license file:
|
||
|
|
setx SPLM_LICENSE_FILE "C:\\path\\to\\license.dat"
|
||
|
|
|
||
|
|
4. For local/node-locked license:
|
||
|
|
- Check License Server is running
|
||
|
|
- Services → Siemens License Server should be running
|
||
|
|
|
||
|
|
5. For network license:
|
||
|
|
- Verify license server hostname/IP
|
||
|
|
- Check port (usually 28000)
|
||
|
|
- Verify firewall allows connection
|
||
|
|
""")
|