Page 1 of 1

plugin install challenges

Posted: Wed Jul 03, 2019 10:50 am
by SteveBeauchemin
I am trying to add a Logstash plugin and am unsure how to deal with the failure.

This is the message

Code: Select all

/usr/local/nagioslogserver/logstash/bin/logstash-plugin install logstash-filter-jdbc_static
Validating logstash-filter-jdbc_static
Unable to download data from https://rubygems.org - Errno::ECONNREFUSED: Connection refused - Connection refused (https://api.rubygems.org/latest_specs.4.8.gz)
ERROR: Installation aborted, verification failed for logstash-filter-jdbc_static
The system I am on was not setup by me. I inherited it and any problems that it has.

Internet access is through a proxy server. I have ENV variables in place for https_proxy, http, and ftp.

I appreciate any suggestions or help getting around this.

Thanks

Steve B

Re: plugin install challenges

Posted: Wed Jul 03, 2019 12:10 pm
by SteveBeauchemin
Do I need to install ruby and rubygems for this plugin addon? logstash-filter-jdbc_static

How did your system do the install? My system is a naked NLS install. Am I lacking some dependencies maybe?

Please advise.

Steve B

Re: plugin install challenges

Posted: Wed Jul 03, 2019 12:43 pm
by SteveBeauchemin
Like I said, I inherited this system, so I'm struggling here.

Are there ENV settings I should have? Should the gem binary be in my path?
/usr/local/nagioslogserver/logstash/vendor/jruby/bin

There has to be some secret... come on. - spill it. haha... no more secrets okay?

Since the normal install syntax did not work for me.

If I have gem in my path can I then install using the syntax? :
from the web site https://rubygems.org/gems/logstash-filter-jdbc_static

Code: Select all

gem install logstash-filter-jdbc_static
Steve B

Re: plugin install challenges

Posted: Wed Jul 03, 2019 12:45 pm
by cdienger
Everything should be there on a bare system to download it. Did you set both HTTP_PROXY and http_proxy? I've seen it mentioned on ES boards that it is case sensitive and https://www.elastic.co/guide/en/logstas ... ugins.html mentions both:

Code: Select all

export HTTP_PROXY=http://proxyip:port
export HTTPS_PROXY=http://proxyip:port
export http_proxy=http://proxyip:port
export http_proxys=http://proxyip:port

Re: plugin install challenges

Posted: Wed Jul 03, 2019 1:00 pm
by SteveBeauchemin
I always set those up whenever I get a new system, so that is in place and looks correct.

Code: Select all

FTP_PROXY=http://proxy.domain.com:port/
HTTPS_PROXY=http://proxy.domain.com:port/
HTTP_PROXY=http://proxy.domain.com:port/
ftp_proxy=http://proxy.domain.com:port/
http_proxy=http://proxy.domain.com:port/
https_proxy=http://proxy.domain.com:port/
no_proxy=.domain.com,localhost,127.0.0.1
And I learned a while back that some code uses lower case, some upper case, so I just add them both as a reflex.
I use /etc/profile.d/proxy.sh and stuff them there so I always get them set.

Good thinking. But not my answer today. How about the path variable. Any special locations there that I should have?

Why can't stuff just work magically...

Steve B

Re: plugin install challenges

Posted: Wed Jul 03, 2019 1:24 pm
by scottwilkerson
Here's an alternative method:

Code: Select all

cd /tmp
wget https://rubygems.org/downloads/logstash-filter-jdbc_static-1.0.6.gem
/usr/local/nagioslogserver/logstash/bin/logstash-plugin install --local logstash-filter-jdbc_static-1.0.6.gem

Re: plugin install challenges

Posted: Wed Jul 03, 2019 2:21 pm
by SteveBeauchemin
Okay, Wrote this before I saw Scott's post...

I think I found one of your secrets...

I tried to run "gem env" and it failed. So I found the gem binary and added that to my path.

Now it was found, but when it failed to run properly it told me more information

Code: Select all

gem env
/usr/local/nagioslogserver/logstash/vendor/jruby/bin/jruby: line 388: /usr/bin/java/bin/java: Not a directory
/usr/local/nagioslogserver/logstash/vendor/jruby/bin/jruby: line 388: exec: /usr/bin/java/bin/java: cannot execute: Not a directory
I made a file named /etc/profile.d/java.sh

Code: Select all

cat /etc/profile.d/java.sh
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64/jre
export PATH=$PATH:/usr/local/nagioslogserver/logstash/vendor/jruby/bin
Note: These work for my system - anyone else reading this in the future should make sure the locations are proper for your system.

Basically added to my path so gem will run, and told the system where java lives.

I am making progress. Now I got further along and the install syntax is trying to work. I had to modify the syntax you provided as it had a big typo in it. The perils of copy and paste I guess.

Now my error has evolved to some download error. It looks like there are dependencies that need to be installed. So this is the new error...

Code: Select all

sudo /usr/local/nagioslogserver/logstash/bin/logstash-plugin install logstash-filter-jdbc_static
Validating logstash-filter-jdbc_static
Installing logstash-filter-jdbc_static
Error Bundler::HTTPError, retrying 1/10
Network error while fetching https://rubygems.org/quick/Marshal.4.8/rest-client-1.8.0-x86-mswin32.gemspec.rz
Error Bundler::HTTPError, retrying 2/10
Network error while fetching https://rubygems.org/quick/Marshal.4.8/rest-client-1.8.0-x86-mswin32.gemspec.rz
Error Bundler::HTTPError, retrying 3/10
Network error while fetching https://rubygems.org/quick/Marshal.4.8/rest-client-1.8.0-x86-mswin32.gemspec.rz
While I waited for the 10 or 10 failure I manually downloaded the file. It takes a 'very' long time to get 10 of 10 fails for such a tiny file.

-- next story...

Maybe I don't need the JAVA_HOME and PATH stuff added. Will find out on the next server since I have 4.

-- now...

Scott - !!!

sudo /usr/local/nagioslogserver/logstash/bin/logstash-plugin install --local /tmp/logstash-filter-jdbc_static-1.0.6.gem
Validating /tmp/logstash-filter-jdbc_static-1.0.6.gem
Installing logstash-filter-jdbc_static
Installation successful

And that's that. Done in 45 seconds. wow...

okay. Lets close this and I'll move on to the next challenge. Configuring it all...

So, Thanks a Ton guys. Have a great holiday weekend. Happy 4th !

Steve B

Re: plugin install challenges

Posted: Wed Jul 03, 2019 2:30 pm
by SteveBeauchemin
Did not need java.sh

The other 3 servers, using local install, were done in 3 minutes.

Cool...

Please close this. and Thanks again.

Steve B

Re: plugin install challenges

Posted: Wed Jul 03, 2019 2:52 pm
by scottwilkerson
SteveBeauchemin wrote:Did not need java.sh

The other 3 servers, using local install, were done in 3 minutes.

Cool...

Please close this. and Thanks again.

Steve B
Happy 4th to you sir!

Glad to help

Locking thread