Python segmentation fault


I am having a problem with a python script. Whenever Icinga executes it as a check a segmentation fault occurs but when I execute it manually in the servers there is no problem

/bin/lmstat: line 21: 25765 Segmentation fault      $DIREC/linux/lmutil lmstat $*

The part of the code that causes the seg fault:

command = subprocess.Popen(['/bin/lmstat', '-c', '/opt/flexadm/folders/', daemon,  '/license.dat'],stdout=subprocess.PIPE, universal_newlines=True)

Does anyone know why this happens?

When you execute the script manually which user context are you using? Is it the same as icinga does?

I executed it with icinga and nagios users

Is SELinux configured? If yes, check the labels (ls -Z) and also the audit.log (/var/log/audit/audit.log) or the message log (/var/log/messages | grep SELinux) if there are denied access attempts.