Hi,
running SoS on a Solaris x86 search generates some errors in the serverinfo.py script.
**************
command="serverinfo", Error '[Errno 2] No such file or directory'. Traceback (most recent call last): File "/appl/splunk/etc/apps/sos/bin/serverinfo.py", line 90, in "total_phys_mem_gb" : meminfo(), File "/appl/splunk/etc/apps/sos/bin/serverinfo.py", line 32, in meminfo pseudohandle = subprocess.Popen(["system_profiler", "SPHardwareDataType"], shell=False, stdout=subprocess.PIPE) File "/appl/splunk/lib/python2.6/subprocess.py", line 621, in init errread, errwrite) File "/appl/splunk/lib/python2.6/subprocess.py", line 1126, in execute_child raise child_exception OSError: [Errno 2] No such file or directory
[psplka006] command="serverinfo", Error '[Errno 2] No such file or directory'. Traceback (most recent call last): File "/appl/splunk/var/run/searchpeers/pspka028-1325238061/apps/sos/bin/serverinfo.py", line 90, in "total_phys_mem_gb" : meminfo(), File "/appl/splunk/var/run/searchpeers/pspka028-1325238061/apps/sos/bin/serverinfo.py", line 32, in meminfo pseudohandle = subprocess.Popen(["system_profiler", "SPHardwareDataType"], shell=False, stdout=subprocess.PIPE) File "/appl/splunk/lib/python2.6/subprocess.py", line 621, in __init _ errread, errwrite) File "/appl/splunk/lib/python2.6/subprocess.py", line 1126, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory
****************
Do you plan to fix this or should we do it ourselves?
cheers,
Andy
Thank you for reporting this error! I have opened a bug against the app (SUP-384) and added it to the known issues for the 2.0 release of the SoS app.
I have added the following code to serverinfo.py in order to report physical memory size on Solaris systems by means of prtconf:
if sys.platform.startswith("sun"):
try:
pseudohandle = subprocess.Popen(["prtconf"], shell=False, stdout=subprocess.PIPE)
stdout, stderr = pseudohandle.communicate()
TotalPhys_re = re.compile(r'^Memory size:\s+(\d+)\s+Megabytes')
for line in stdout.splitlines():
TotalPhys_match = TotalPhys_re.match(line)
if TotalPhys_match:
TotalPhys = int(round(float(TotalPhys_match.group(1))/1024))
except:
TotalPhys = "not available"
This fix would be integrated in the next release of SoS. In the meantime, you can try this modified version of serverinfo.py to replace $SPLUNK_HOME/etc/apps/sos/bin/serverinfo.py
, which should resolve your issue.
cp $SPLUNK_HOME/etc/apps/sos/bin/serverinfo.py $SPLUNK_HOME/etc/apps/sos/bin/serverinfo.py.old
cp serverinfo_SUP-384.py $SPLUNK_HOME/etc/apps/sos/bin/serverinfo.py
http[s]://:/app/sos/home
You should no longer see any error banners in the Home view indicating that the serverinfo command disgracefully failed.
Let me know if it works or if you have any suggestions to determine the system physical memory on a Solaris system using different code.
Thank you for reporting this error! I have opened a bug against the app (SUP-384) and added it to the known issues for the 2.0 release of the SoS app.
I have added the following code to serverinfo.py in order to report physical memory size on Solaris systems by means of prtconf:
if sys.platform.startswith("sun"):
try:
pseudohandle = subprocess.Popen(["prtconf"], shell=False, stdout=subprocess.PIPE)
stdout, stderr = pseudohandle.communicate()
TotalPhys_re = re.compile(r'^Memory size:\s+(\d+)\s+Megabytes')
for line in stdout.splitlines():
TotalPhys_match = TotalPhys_re.match(line)
if TotalPhys_match:
TotalPhys = int(round(float(TotalPhys_match.group(1))/1024))
except:
TotalPhys = "not available"
This fix would be integrated in the next release of SoS. In the meantime, you can try this modified version of serverinfo.py to replace $SPLUNK_HOME/etc/apps/sos/bin/serverinfo.py
, which should resolve your issue.
cp $SPLUNK_HOME/etc/apps/sos/bin/serverinfo.py $SPLUNK_HOME/etc/apps/sos/bin/serverinfo.py.old
cp serverinfo_SUP-384.py $SPLUNK_HOME/etc/apps/sos/bin/serverinfo.py
http[s]://:/app/sos/home
You should no longer see any error banners in the Home view indicating that the serverinfo command disgracefully failed.
Let me know if it works or if you have any suggestions to determine the system physical memory on a Solaris system using different code.
FYI this has been fixed in SoS 2.1 which is now live.
Thank you for the confirmation, I'll greenlight this fix into the SoS 2.1 code.
Hi,
works just perfect. Thanks a lot,
andy