Refine your search:

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 <module> "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 <module> "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

asked 30 Dec '11, 01:48

kochera's gravatar image

kochera
8116
accept rate: 0%

edited 25 Jun '12, 11:30

hexx's gravatar image

hexx ♦
14.5k91670


One Answer:

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.

  • Get a copy of the modified version of serverinfo.py. You'll have to use your splunk.com credentials to download this file.
  • Make a backup of your original serverinfo.py:
    cp $SPLUNK_HOME/etc/apps/sos/bin/serverinfo.py $SPLUNK_HOME/etc/apps/sos/bin/serverinfo.py.old
  • Copy the modified serverinfo.py file in place:
    cp serverinfo_SUP-384.py $SPLUNK_HOME/etc/apps/sos/bin/serverinfo.py
  • Hit the SoS app home view again @ http[s]://<splunkweb_host>:<splunkweb_port>/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.

link

answered 03 Jan '12, 19:04

hexx's gravatar image

hexx ♦
14.5k91670
accept rate: 55%

edited 03 Jan '12, 20:14

1

Hi, works just perfect. Thanks a lot,

andy

(03 Jan '12, 22:04) kochera

Thank you for the confirmation, I'll greenlight this fix into the SoS 2.1 code.

(03 Jan '12, 23:53) hexx ♦
1

FYI this has been fixed in SoS 2.1 which is now live.

(10 Jan '12, 18:49) hexx ♦
Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×36

Asked: 30 Dec '11, 01:48

Seen: 886 times

Last updated: 25 Jun '12, 11:30

Copyright © 2005-2012 Splunk Inc. All rights reserved.