rrdcached installation script issue (again)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

rrdcached installation script issue (again)

Post by rajasegar »

This is the 3rd time I am bringing up this issue for the same problem.
Looks to me exactly same issue.

Previous thread
https://support.nagios.com/forum/viewto ... 16&t=37298

See the logs which I just executed, it is self explanatory

Code: Select all

[nagios@MYUCBPNAGIAPP01 ~]$ wget http://assets.nagios.com/downloads/nagiosxi/scripts/xi-rrdcached.sh
--2016-03-30 11:03:53--  http://assets.nagios.com/downloads/nagiosxi/scripts/xi-rrdcached.sh
Connecting to 172.16.19.95:8080... connected.
Proxy request sent, awaiting response... 301 Moved Permanently
Location: https://assets.nagios.com/downloads/nagiosxi/scripts/xi-rrdcached.sh [following]
--2016-03-30 11:03:53--  https://assets.nagios.com/downloads/nagiosxi/scripts/xi-rrdcached.sh
Connecting to 172.16.19.95:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 3465 (3.4K) [application/x-sh]
Saving to: âxi-rrdcached.shâ

100%[==============================================================================================================================>] 3,465       --.-K/s   in 0s

2016-03-30 11:03:55 (85.9 MB/s) - âxi-rrdcached.shâ

[nagios@MYUCBPNAGIAPP01 ~]$ ls -lrt
total 2614532
-rw-rw-r--  1 nagios nagios       3465 Mar  2 00:07 xi-rrdcached.sh
-rw-r--r--  1 nagios nagios 2677265605 Mar 29 01:31 1459213336.tar.gz
-rw-r--r--. 1 nagios nagios        204 Mar 30 11:03 cookie.txt

[nagios@MYUCBPNAGIAPP01 ~]$ sudo ./xi-rrdcached.sh
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
epel/metalink                                                                                                                                    | 4.8 kB     00:00
 * base: buaya.klas.or.id
 * epel: epel.mirror.net.in
 * extras: buaya.klas.or.id
 * rpmforge: apt.sw.be
 * updates: buaya.klas.or.id
base                                                                                                                                             | 3.7 kB     00:00
cr                                                                                                                                               | 3.3 kB     00:00
download.mono-project.com_repo_centos_                                                                                                           | 2.9 kB     00:00
epel                                                                                                                                             | 4.3 kB     00:00
epel/primary_db                                                                                                                                  | 5.8 MB     00:51
extras                                                                                                                                           | 3.4 kB     00:00
nagios-base                                                                                                                                      | 1.5 kB     00:00
nagiosxi-deps                                                                                                                                    | 1.5 kB     00:00
rpmforge                                                                                                                                         | 1.9 kB     00:00
updates                                                                                                                                          | 3.4 kB     00:00
updates/primary_db                                                                                                                               | 4.6 MB     06:56
Package libxml2-2.7.6-20.el6_7.1.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package libxml2-devel.x86_64 0:2.7.6-20.el6_7.1 will be installed
---> Package pango-devel.x86_64 0:1.28.1-10.el6 will be installed
--> Processing Dependency: glib2-devel >= 2.17.3-1 for package: pango-devel-1.28.1-10.el6.x86_64
--> Processing Dependency: cairo-devel >= 1.7.6 for package: pango-devel-1.28.1-10.el6.x86_64
--> Processing Dependency: pkgconfig(xft) for package: pango-devel-1.28.1-10.el6.x86_64
--> Processing Dependency: pkgconfig(gobject-2.0) for package: pango-devel-1.28.1-10.el6.x86_64
--> Processing Dependency: pkgconfig(gmodule-no-export-2.0) for package: pango-devel-1.28.1-10.el6.x86_64
--> Processing Dependency: pkgconfig(glib-2.0) for package: pango-devel-1.28.1-10.el6.x86_64
--> Processing Dependency: pkgconfig(cairo) for package: pango-devel-1.28.1-10.el6.x86_64
--> Processing Dependency: libXrender-devel for package: pango-devel-1.28.1-10.el6.x86_64
--> Processing Dependency: libXft-devel for package: pango-devel-1.28.1-10.el6.x86_64
--> Processing Dependency: libXext-devel for package: pango-devel-1.28.1-10.el6.x86_64
--> Running transaction check
---> Package cairo-devel.x86_64 0:1.8.8-6.el6_6 will be installed
--> Processing Dependency: pkgconfig(pixman-1) >= 0.12.0 for package: cairo-devel-1.8.8-6.el6_6.x86_64
--> Processing Dependency: pixman-devel >= 0.12.0 for package: cairo-devel-1.8.8-6.el6_6.x86_64
---> Package glib2-devel.x86_64 0:2.28.8-4.el6 will be installed
---> Package libXext-devel.x86_64 0:1.3.2-2.1.el6 will be installed
---> Package libXft-devel.x86_64 0:2.3.1-2.el6 will be installed
---> Package libXrender-devel.x86_64 0:0.9.8-2.1.el6 will be installed
--> Running transaction check
---> Package pixman-devel.x86_64 0:0.32.4-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                                      Arch                               Version                                      Repository                           Size
========================================================================================================================================================================
Installing:
 libxml2-devel                                x86_64                             2.7.6-20.el6_7.1                             updates                             1.1 M
 pango-devel                                  x86_64                             1.28.1-10.el6                                base                                276 k
Installing for dependencies:
 cairo-devel                                  x86_64                             1.8.8-6.el6_6                                base                                314 k
 glib2-devel                                  x86_64                             2.28.8-4.el6                                 base                                299 k
 libXext-devel                                x86_64                             1.3.2-2.1.el6                                base                                 74 k
 libXft-devel                                 x86_64                             2.3.1-2.el6                                  base                                 19 k
 libXrender-devel                             x86_64                             0.9.8-2.1.el6                                base                                 17 k
 pixman-devel                                 x86_64                             0.32.4-4.el6                                 base                                 20 k

Transaction Summary
========================================================================================================================================================================
Install       8 Package(s)

Total download size: 2.1 M
Installed size: 14 M
Downloading Packages:
(1/8): cairo-devel-1.8.8-6.el6_6.x86_64.rpm                                                                                                      | 314 kB     00:23
(2/8): glib2-devel-2.28.8-4.el6.x86_64.rpm                                                                                                       | 299 kB     00:20
(3/8): libXext-devel-1.3.2-2.1.el6.x86_64.rpm                                                                                                    |  74 kB     00:03
(4/8): libXft-devel-2.3.1-2.el6.x86_64.rpm                                                                                                       |  19 kB     00:02
(5/8): libXrender-devel-0.9.8-2.1.el6.x86_64.rpm                                                                                                 |  17 kB     00:01
(6/8): libxml2-devel-2.7.6-20.el6_7.1.x86_64.rpm                                                                                                 | 1.1 MB     00:48
(7/8): pango-devel-1.28.1-10.el6.x86_64.rpm                                                                                                      | 276 kB     00:10
(8/8): pixman-devel-0.32.4-4.el6.x86_64.rpm                                                                                                      |  20 kB     00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                    19 kB/s | 2.1 MB     01:52
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libXrender-devel-0.9.8-2.1.el6.x86_64                                                                                                                1/8
  Installing : libXft-devel-2.3.1-2.el6.x86_64                                                                                                                      2/8
  Installing : libXext-devel-1.3.2-2.1.el6.x86_64                                                                                                                   3/8
  Installing : glib2-devel-2.28.8-4.el6.x86_64                                                                                                                      4/8
  Installing : pixman-devel-0.32.4-4.el6.x86_64                                                                                                                     5/8
  Installing : cairo-devel-1.8.8-6.el6_6.x86_64                                                                                                                     6/8
  Installing : pango-devel-1.28.1-10.el6.x86_64                                                                                                                     7/8
  Installing : libxml2-devel-2.7.6-20.el6_7.1.x86_64                                                                                                                8/8
  Verifying  : libxml2-devel-2.7.6-20.el6_7.1.x86_64                                                                                                                1/8
  Verifying  : pixman-devel-0.32.4-4.el6.x86_64                                                                                                                     2/8
  Verifying  : glib2-devel-2.28.8-4.el6.x86_64                                                                                                                      3/8
  Verifying  : libXrender-devel-0.9.8-2.1.el6.x86_64                                                                                                                4/8
  Verifying  : pango-devel-1.28.1-10.el6.x86_64                                                                                                                     5/8
  Verifying  : cairo-devel-1.8.8-6.el6_6.x86_64                                                                                                                     6/8
  Verifying  : libXft-devel-2.3.1-2.el6.x86_64                                                                                                                      7/8
  Verifying  : libXext-devel-1.3.2-2.1.el6.x86_64                                                                                                                   8/8

Installed:
  libxml2-devel.x86_64 0:2.7.6-20.el6_7.1                                               pango-devel.x86_64 0:1.28.1-10.el6

Dependency Installed:
  cairo-devel.x86_64 0:1.8.8-6.el6_6           glib2-devel.x86_64 0:2.28.8-4.el6       libXext-devel.x86_64 0:1.3.2-2.1.el6      libXft-devel.x86_64 0:2.3.1-2.el6
  libXrender-devel.x86_64 0:0.9.8-2.1.el6      pixman-devel.x86_64 0:0.32.4-4.el6

Complete!
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package rrdtool-perl.x86_64 0:1.3.8-7.el6 will be erased
--> Processing Dependency: rrdtool-perl for package: nagiosxi-deps-5.2.5-1.noarch
--> Running transaction check
---> Package nagiosxi-deps.noarch 0:5.2.5-1 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                               Arch                           Version                              Repository                                              Size
========================================================================================================================================================================
Removing:
 rrdtool-perl                          x86_64                         1.3.8-7.el6                          @base                                                   58 k
Removing for dependencies:
 nagiosxi-deps                         noarch                         5.2.5-1                              @/nagiosxi-deps-5.2.5-1.noarch                         0.0

Transaction Summary
========================================================================================================================================================================
Remove        2 Package(s)

Installed size: 58 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : nagiosxi-deps-5.2.5-1.noarch                                                                                                                         1/2
  Erasing    : rrdtool-perl-1.3.8-7.el6.x86_64                                                                                                                      2/2
  Verifying  : rrdtool-perl-1.3.8-7.el6.x86_64                                                                                                                      1/2
  Verifying  : nagiosxi-deps-5.2.5-1.noarch                                                                                                                         2/2

Removed:
  rrdtool-perl.x86_64 0:1.3.8-7.el6

Dependency Removed:
  nagiosxi-deps.noarch 0:5.2.5-1

Complete!
--2016-03-30 11:14:36--  http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.4.tar.gz
Connecting to 172.16.19.95:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: unspecified [application/x-tar]
Saving to: ârrdtool-1.4.4.tar.gzâ

    [                       <=>                                                                                                     ] 5,877,760    956K/s   in 6.4s

2016-03-30 11:14:43 (896 KB/s) - ârrdtool-1.4.4.tar.gzâ


gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
gwakem
Posts: 238
Joined: Mon Jan 23, 2012 2:02 pm
Location: Asheville, NC

Re: rrdcached installation script issue (again)

Post by gwakem »

I just ran this also, and it downloaded rrdtool-1.4.4.tar.gz, then unzipped and navigated into the directory fine. I don't think the issue is the script.

You do connect through a proxy, per your log:

Connecting to 172.16.19.95:8080... connected.

Whats up with the odd pre and post additions around the filename (ie. the â)? Is it possible the package may be mangled by the proxy?

Saving to: ârrdtool-1.4.4.tar.gzâ

Out of curiosity, what is the output of ls -lh on the file? Cause it sure looks like a tar.gz to me..
--
Griffin Wakem
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: rrdcached installation script issue (again)

Post by ssax »

The script is simple enough where it just uses wget to get the file directly from their site, if the file is bad or not gzipped (and actually a tar file with a .gz name) then it's either oss.oetiker.ch releasing it that way or something in your path (proxy, etc) may be interferring with it like gwakem stated.

You could replace this code in the script:

Code: Select all

wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.4.tar.gz
tar -xzf rrdtool-1.4.4.tar.gz
With this:

Code: Select all

wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.4.tar.gz
OUTPUT=$(file rrdtool-1.4.4.tar.gz)
if [[ $OUTPUT == *"gzip"* ]]; then
        tar -xzf rrdtool-1.4.4.tar.gz
else
        tar -xf rrdtool-1.4.4.tar.gz
fi
The script is coded properly, their is either an issue with the file at oss.oetiker.ch or something modifying it in-between (web gateway, proxy, IPS, etc). I would check the logs on the devices in your path to see.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: rrdcached installation script issue (again)

Post by rajasegar »

ssax wrote:The script is simple enough where it just uses wget to get the file directly from their site, if the file is bad or not gzipped (and actually a tar file with a .gz name) then it's either oss.oetiker.ch releasing it that way or something in your path (proxy, etc) may be interferring with it like gwakem stated.

You could replace this code in the script:

Code: Select all

wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.4.tar.gz
tar -xzf rrdtool-1.4.4.tar.gz
With this:

Code: Select all

wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.4.tar.gz
OUTPUT=$(file rrdtool-1.4.4.tar.gz)
if [[ $OUTPUT == *"gzip"* ]]; then
        tar -xzf rrdtool-1.4.4.tar.gz
else
        tar -xf rrdtool-1.4.4.tar.gz
fi
The script is coded properly, their is either an issue with the file at oss.oetiker.ch or something modifying it in-between (web gateway, proxy, IPS, etc). I would check the logs on the devices in your path to see.
I really doubt the proxy is changing the tar.gz file to tar file.
It is either the proxy is caching it which I really doubt as or proxy has low capacity for caching or the source is a tar file.

Please double confirm from your end and close this case.

Code: Select all

[nagios@MYUCBPNAGIAPP01 ~]$ ls -lrt
total 2626016
-rw-r--r--   1 root   root      5877760 Jul  6  2010 rrdtool-1.4.4.tar.gz.1
-rw-r--r--   1 root   root      5877760 Jul  6  2010 rrdtool-1.4.4.tar.gz
-rw-r--r--   1 nagios nagios 2677265605 Mar 29 01:31 1459213336.tar.gz
-rwxrwxr-x   1 nagios nagios       3465 Mar 30 11:34 xi-rrdcached.sh
drwxrwxrwx  11   1003   1001       4096 Mar 30 11:35 rrdtool-1.4.4
-rw-r--r--.  1 nagios nagios        204 Mar 31 08:38 cookie.txt

5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: rrdcached installation script issue (again)

Post by rkennedy »

Can you please modify the script as @ssax suggested, and let us know the result?

I just downloaded the file, and it's a different size on my end.

Code: Select all

[root@localhost ~]# ls -lrt rrdtool-1.4.4.tar.gz
-rw-r--r-- 1 root root 1345477 Jul  5  2010 rrdtool-1.4.4.tar.gz
Former Nagios Employee
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: rrdcached installation script issue (again)

Post by ssax »

Some web gateways extract the archive in order to scan them and replace files in them they deem a threat based on heuristics or blocked file type settings.

Here is how to verify that it's a gzip file:

Code: Select all

[root@localhost etc]# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.4.tar.gz
--2016-03-31 09:13:11--  http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.4.tar.gz
Resolving oss.oetiker.ch... 213.144.138.195, 2001:1620:202d::c3
Connecting to oss.oetiker.ch|213.144.138.195|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1345477 (1.3M) [application/x-tar]
Saving to: “rrdtool-1.4.4.tar.gz”

100%[==============================================================================================================>] 1,345,477    888K/s   in 1.5s

2016-03-31 09:13:17 (888 KB/s) - “rrdtool-1.4.4.tar.gz” saved [1345477/1345477]

[root@localhost etc]# file rrdtool-1.4.4.tar.gz
rrdtool-1.4.4.tar.gz: gzip compressed data, from Unix, last modified: Mon Jul  5 14:33:23 2010, max compression
You may try downloading it on a machine that doesn't go through your proxy/filter/etc to verify as well.
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: rrdcached installation script issue (again)

Post by bwallace »

What kind of proxy device is it? I used to support a McAfee Webgateway proxy and it was not uncommon to see this behavior, I recall filing bugs for it in fact. Try bypassing this from the proxy or at least from the rule on the proxy which opens/scans compressed files.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked