Monitoring JMX

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re: Monitoring JMX

Postby jankogaga » Tue May 15, 2018 7:49 am

I have followed https://support.nagios.com/kb/article.php?id=515.
I run Centos 7 in a docker container

when trying
Code: Select all
make install-init


I get:
Code: Select all
No init file to install
make: *** [install-init] Error 1


I think that is related to the docker implementation.
jankogaga
 
Posts: 25
Joined: Thu Apr 19, 2018 8:16 am

Re: Monitoring JMX

Postby tgriep » Tue May 15, 2018 12:43 pm

The make install-init is looking for the following script
rh-upstart-init
in the startup folder.
Does it exist and does the rh-upstart-init.in file exist in that folder?

Can you post the config.log file from the nrpe source folder?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 6658
Joined: Thu Oct 30, 2014 9:02 am

Re: Monitoring JMX

Postby jankogaga » Wed May 16, 2018 2:56 am

/tmp/nrpe-nrpe-3.2.1/startup/rh-upstart-init.in does exist.
Here is attached /tmp/nrpe-nrpe-3.2.1/config.log
Attachments
config.log
(62.84 KiB) Downloaded 10 times
jankogaga
 
Posts: 25
Joined: Thu Apr 19, 2018 8:16 am

Re: Monitoring JMX

Postby scottwilkerson » Wed May 16, 2018 8:02 am

Actually it should be just
Code: Select all
/tmp/nrpe-nrpe-3.2.1/startup/rh-upstart-init


However, pardon my ignorance, but can you run traditional services now in a docker container? I ask because last I worked with them a few years ago you could not.
User avatar
scottwilkerson
CTO
 
Posts: 9131
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Monitoring JMX

Postby jankogaga » Wed May 16, 2018 8:48 am

Both, /tmp/nrpe-nrpe-3.2.1/startup/rh-upstart-init and /tmp/nrpe-nrpe-3.2.1/startup/rh-upstart-init.in exist.
I tried now starting "make install-init" from startup folder:
Code: Select all
[root@test-difin startup]# make install-init
make: *** No rule to make target `install-init'.  Stop.


Regarding docker container:
In Dockerfile you can add:
Code: Select all
COPY            supervisord.conf /etc/supervisord.conf
ENTRYPOINT      ["/usr/bin/supervisord"]


In supervisord.conf define what services-daemon will be started.
E.g. for nrpe deamon I would add (maybe I am wrong):
Code: Select all
[program:nrpe]
command=/usr/sbin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
jankogaga
 
Posts: 25
Joined: Thu Apr 19, 2018 8:16 am

Re: Monitoring JMX

Postby scottwilkerson » Wed May 16, 2018 9:04 am

There is no "init" file for docker then, the configure script can't detect you are in docker, you would have to skip that part and add the supervisord item

But I believe the command is as follows
Code: Select all
[program:nrpe]
command=/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
User avatar
scottwilkerson
CTO
 
Posts: 9131
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Monitoring JMX

Postby jankogaga » Wed May 16, 2018 10:03 am

Thanks scottwilkerson.
This command does the trick.
Now, I get:
Code: Select all
[root@test-difin /]# netstat -anp |grep 5666
tcp        0      0 0.0.0.0:5666            0.0.0.0:*               LISTEN      -
tcp6       0      0 :::5666                 :::*                    LISTEN      -


but still on the Nagios Core server:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 10.30.30.33
connect to address 10.30.30.33 port 5666: Connection refused
connect to host 10.30.30.33 port 5666: Connection refused
jankogaga
 
Posts: 25
Joined: Thu Apr 19, 2018 8:16 am

Re: Monitoring JMX

Postby scottwilkerson » Wed May 16, 2018 10:35 am

Well we are getting somewhere, again, my docker is VERY rusty, but don't you have to map ports to expose them to the outside world?
User avatar
scottwilkerson
CTO
 
Posts: 9131
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Monitoring JMX

Postby jankogaga » Thu May 17, 2018 3:32 am

The port mapping is already done:
Code: Select all
-p 10.30.30.33:5666:5666

firewall rules on docker'host is set:
Code: Select all
-A PREROUTING -i eth0 -p tcp --dport 5666 -j DNAT --to-destination 10.30.30.33
-A PREROUTING -i eth0 -p udp --dport 5666 -j DNAT --to-destination 10.30.30.33

-A ufw-user-input -p tcp --dport 5666 -j ACCEPT
-A ufw-user-input -p udp --dport 5666 -j ACCEPT

But still can't connect to it from Nagioc Core
jankogaga
 
Posts: 25
Joined: Thu Apr 19, 2018 8:16 am

Re: Monitoring JMX

Postby scottwilkerson » Thu May 17, 2018 8:34 am

The
Code: Select all
Connection refused


is not coming form NRPE, it is at a different layer, like something is blocking the port e.g. firewall, or NRPE isn't actually bound to the port which doesn't seem to be the case because of your netstat output
User avatar
scottwilkerson
CTO
 
Posts: 9131
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

PreviousNext

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 25 guests