NagiosEnterprises / ncpa

Nagios Cross-Platform Agent
Other
177 stars 95 forks source link

Reopen issue 464 #468

Closed hbouma1 closed 6 years ago

hbouma1 commented 6 years ago

After testing of NCPA build from https://assets.nagios.com/downloads/ncpa/ncpa-2.1.5.sle11.x86_64.rpm the issue still exists. Please re-open the issue as it is not fixed. image

jomann09 commented 6 years ago

Did you install zlib on the system? I tested it on a basic install of SLES 11, but we do install zlib for the build so it may be a problem if it's not installed on the system.

hbouma1 commented 6 years ago

Yes, zlib is installed and an available module in Python.

We are seeing this on a base install of SLES 11 SP4 as well as our entire environment of SLES servers.

root@XXXXXXXX [/tmp] $ zypper install ./ncpa-2.1.5.sle11.x86_64.rpm Refreshing service 'spacewalk'. Loading repository data... Reading installed packages... Resolving package dependencies...

The following NEW package is going to be installed: ncpa

The following package is not supported by its vendor: ncpa

1 new package to install. Overall download size: 11.5 MiB. After the operation, additional 32.0 MiB will be used. Continue? [y/n/? shows all options] (y): y Retrieving package ncpa-2.1.5-1.x86_64 (1/1), 11.5 MiB (32.0 MiB unpacked) Retrieving package ncpa-2.1.5-1.x86_64 (1/1), 11.5 MiB (32.0 MiB unpacked) Installing: ncpa-2.1.5-1 [done] Additional rpm output: Started NCPA Listener zipimport.ZipImportError: can't decompress data; zlib not available Fatal Python error: unable to locate initialization module /etc/init.d/ncpa_listener: line 27: 2044 Aborted $BASEDIR/ncpa_listener --start Started NCPA Passive zipimport.ZipImportError: can't decompress data; zlib not available Fatal Python error: unable to locate initialization module /etc/init.d/ncpa_passive: line 27: 2051 Aborted $BASEDIR/ncpa_passive --start

root@XXXXXXXX [/tmp] $ zypper search zlib Refreshing service 'spacewalk'. Loading repository data... Reading installed packages...

S | Name | Summary | Type --+-------------------------+------------------------------------+-------- i | CL-slessp4-zlib-12902-1 | moderate: Security update for zlib | patch | php53-zlib | PHP5 Extension Module | package i | zlib | Data Compression Library | package i | zlib-32bit | Data Compression Library | package

$ python Python 2.6.9 (unknown, Mar 14 2018, 09:27:15) [GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2 Type "help", "copyright", "credits" or "license" for more information.

help("modules")

Please wait a moment while I gather a list of all available modules...

BaseHTTPServer atexit imaplib rpm Bastion audiodev imghdr runpy CDROM audioop imp satsolver CGIHTTPServer audit imputil sched ConfigParser auparse inspect scout Cookie base64 io select DLFCN bdb itertools sets DocXMLRPCServer binascii json sgmllib HTMLParser binhex keyword sha IN bisect lib2to3 shelve MimeWriter bsddb libYCP shlex OpenSSL bz2 libxml2 shutil Queue cPickle libxml2mod signal SSSDConfig cProfile linecache site SimpleHTTPServer cStringIO linuxaudiodev smtpd SimpleXMLRPCServer calendar locale smtplib SocketServer cgi logging snack StringIO cgitb macpath sndhdr TYPES chunk macurl2path socket UserDict cmath mailbox spwd UserList cmd mailcap sqlite3 UserString code markupbase sre YCPDeclarations codecs marshal sre_compile _LWPCookieJar codeop math sre_constants _MozillaCookieJar collections md5 sre_parse builtin colorsys mhlib ssl future commands mimetools stat _abcoll compileall mimetypes statvfs _ast compiler mimify string _audit contextlib mmap stringold _bisect cookielib modulefinder stringprep _bsddb copy multifile strop _bytesio copy_reg multiprocessing struct _codecs crypt mutex subprocess _codecs_cn csv netrc sunau _codecs_hk ctypes new sunaudio _codecs_iso2022 datetime nis suseRegister _codecs_jp dbhash nntplib symbol _codecs_kr dbus ntpath symtable _codecs_tw dbus_bindings nturl2path sys _collections decimal numbers syslog _csv difflib opcode tabnanny _ctypes dircache operator tarfile _ctypes_test dis optparse telnetlib _dbus_bindings distutils os tempfile _dbus_glib_bindings dmidecode os2emxpath termios _elementtree dmidecodemod ossaudiodev textwrap _fileio doctest parser this _functools drv_libxml2 pdb thread _hashlib dumbdbm pickle threading _heapq dummy_thread pickletools time _hotshot dummy_threading pipes timeit _json email pkgutil toaiff _locale encodings platform token _lsprof errno plistlib tokenize _md5 ethtool popen2 trace _multibytecodec exceptions poplib traceback _multiprocessing fcntl posix tty _random filecmp posixfile types _satsolver fileinput posixpath unicodedata _sha fnmatch pprint unittest _sha256 formatter profile urllib _sha512 fpformat pstats urllib2 _snack fractions pty urlparse _socket ftplib pwd user _sqlite3 functools py_compile uu _sre future_builtins pyclbr uuid _ssl gc pydoc warnings _strptime genericpath pydoc_topics wave _struct getopt pyexpat weakref _symtable getpass pysss webbrowser _testcapi gettext pysss_murmur whichdb _threading_local glob quopri wsgiref _warnings grp random xdrlib _weakref gzip re xml abc hashlib readline xmllib aifc heapq repr xmlrpclib anydbm hmac resource xxsubtype argparse hotshot rexec ycp array htmlentitydefs rfc822 zipfile ast htmllib rhn zipimport asynchat httplib rlcompleter zlib asyncore ihooks robotparser zypp_plugin

Enter any module name to get more help. Or, type "modules spam" to search for modules whose descriptions contain the word "spam".

jomann09 commented 6 years ago

The python version installed on the system doesn't actually matter. NCPA comes with it's own frozen version of Python 2.7.x (using cx_freeze) so modules in your version of python is not the issue. The NCPA binary is having problems extracting the zip file inside /usr/local/ncpa that includes the files that it requires in order to actually run the agent - which means somehow it is not able to use the zlib library on the system. You could try manually setting the library path to see why it is not finding zlib.

hbouma1 commented 6 years ago

Please let me know if there are steps in the installation process that I am missing. I just duplicated the issue on a fresh install of SLES 11 SP4 64bit by doing the following:

· Go to https://download.suse.com/index.jsp

· I selected SUSE Linux Enterprise Server, SUSE Linux Enterprise Server 11 SP4, All Dates.

· Downloaded SUSE Linux Enterprise Server 11 SP4 for AMD64/Intel64https://download.suse.com/Download?buildid=tqRrEpjl5SY~ (SLES-11-SP4-DVD-x86_64-GM-DVD1.iso).

· Install to VMWare Workstation using defaults

· First boot, I logged in, started a terminal and entered the following:

Tue Jun 19 09:36:49 EDT 2018 linux-4sig:~/Desktop # zypper install zlib Loading repository data... Reading installed packages... 'zlib' is already installed. No update candidate for 'zlib-1.2.7-0.12.3.x86_64'. The highest available version is already installed. Resolving package dependencies...

Nothing to do. linux-4sig:~/Desktop # wget https://assets.nagios.com/downloads/ncpa/ncpa-2.1.5.sle11.x86_64.rpm --2018-06-19 09:37:31-- https://assets.nagios.com/downloads/ncpa/ncpa-2.1.5.sle11.x86_64.rpm Resolving assets.nagios.com... 72.14.181.71, 2600:3c00::f03c:91ff:fedf:b821 Connecting to assets.nagios.com|72.14.181.71|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 12090779 (12M) [application/x-rpm] Saving to: `ncpa-2.1.5.sle11.x86_64.rpm'

100%[===================================>] 12,090,779 9.06M/s in 1.3s

2018-06-19 09:37:33 (9.06 MB/s) - `ncpa-2.1.5.sle11.x86_64.rpm' saved [12090779/12090779]

linux-4sig:~/Desktop # zypper install ./ncpa-2.1.5.sle11.x86_64.rpm PackageKit is blocking zypper. This happens if you have an updater applet or other software management application using PackageKit running. Tell PackageKit to quit? [yes/no] (no): y Loading repository data... Reading installed packages... Resolving package dependencies...

The following NEW package is going to be installed: ncpa

The following package is not supported by its vendor: ncpa

1 new package to install. Overall download size: 11.5 MiB. After the operation, additional 32.0 MiB will be used. Continue? [y/n/? shows all options] (y): y Retrieving package ncpa-2.1.5-1.x86_64 (1/1), 11.5 MiB (32.0 MiB unpacked) Retrieving package ncpa-2.1.5-1.x86_64 (1/1), 11.5 MiB (32.0 MiB unpacked) Installing: ncpa-2.1.5-1 [done] Additional rpm output: Started NCPA Listener zipimport.ZipImportError: can't decompress data; zlib not available Fatal Python error: unable to locate initialization module /etc/init.d/ncpa_listener: line 27: 14166 Aborted $BASEDIR/ncpa_listener --start Started NCPA Passive zipimport.ZipImportError: can't decompress data; zlib not available Fatal Python error: unable to locate initialization module /etc/init.d/ncpa_passive: line 27: 14173 Aborted $BASEDIR/ncpa_passive –start

jomann09 commented 6 years ago

So it looks like my export was removed from the init script, can you try installing the new version https://assets.nagios.com/downloads/ncpa/ncpa-2.1.5.sle11.x86_64.rpm

hbouma1 commented 6 years ago

That worked.

Thank you!

jomann09 commented 6 years ago

Awesome!