No output on stdout) stderr: connection refused

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: No output on stdout) stderr: connection refused

Post by tgriep »

All of the host and service checks that are running on the Nagios Core server are on the Nagios server itself and not on the remote servers.

Take a look at the Nagios Core documentation in the link below, especially the Configuring and Running Nagios sections. Lots if good information there.
https://assets.nagios.com/downloads/nag ... n/toc.html
In the configuration you posted, you have the IP address for all of the hosts set to the same IP address and that is causing the issue, they should be the IP address for the remote systems.
Change those and restart nagios and if the remote hosts are configured, the checks should start to function.
Be sure to check out our Knowledgebase for helpful articles and solutions!
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: No output on stdout) stderr: connection refused

Post by donnyforbes »

In the configuration you posted, you have the IP address for all of the hosts set to the same IP address and that is causing the issue, they should be the IP address for the remote systems.

Can yo give me an example of where I change this?
Is this from the nagios server /usr/local/nagios/etc/objects/command.cfg ???
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: No output on stdout) stderr: connection refused

Post by tgriep »

Which file did you get the following information from?

Code: Select all

    #remote Linux/Unix hosts

    define host{
    use linux-box ; Inherit default values from a template
    host_name huey  ; The name or IP or remote server
    alias RHEL 7.3 ; A longer name for the server
    address 192.168.1.186 ; IP address of the nagios server
    }

    define host{
    use linux-box ; Inherit default values from a template
    host_name duey  ; The name or IP or remote server
    alias RHEL 7.3 ; A longer name for the server
    address 192.168.1.186 ; IP address of the nagios server
    }

    define host{
    use linux-box ; Inherit default values from a template
    host_name louie   ; The name or IP or remote server
    alias RHEL 7.3 ; A longer name for the server
    address 192.168.1.186 ; IP address of the nagios server
    }

    define host{
    use linux-box ; Inherit default values from a template
    host_name proxy4gl   ; The name or IP or remote server
    alias RHEL 7.3 ; A longer name for the server
    address 192.168.1.186 ; IP address of the nagios server
    }

    define host{
    use linux-box ; Inherit default values from a template
    host_name taz2   ; The name or IP or remote server
    alias RHEL 7.3 ; A longer name for the server
    address 192.168.1.186 ; IP address of the nagios server
    }

    define host{
    use linux-box ; Inherit default values from a template
    host_name tank   ; The name or IP or remote server
    alias RHEL 7.3 ; A longer name for the server
    address 192.168.1.186 ; IP address of the nagios server
    }

    define host{
    use linux-box ; Inherit default values from a template
    host_name ernestine   ; The name or IP or remote server
    alias RHEL 7.3 ; A longer name for the server
    address 192.168.1.186 ; IP address of the nagios server
    }
That is the one you would edit.
Be sure to check out our Knowledgebase for helpful articles and solutions!
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: No output on stdout) stderr: connection refused

Post by donnyforbes »

from server command.cfg file

Code: Select all

#remote Linux/Unix hosts

define host{
use linux-box ; Inherit default values from a template
host_name huey  ; The name or IP or remote server
alias RHEL 7.3 ; A longer name for the server
address 192.168.1.186 ; IP address of the nagios server
}
Do you mean change all of these
host_name huey ; The name or IP or remote server ------> host_name <ip_address> ; The name or IP or remote server
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: No output on stdout) stderr: connection refused

Post by tgriep »

Change the IP address to the remote server's IP address called huey.
Be sure to check out our Knowledgebase for helpful articles and solutions!
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: No output on stdout) stderr: connection refused

Post by donnyforbes »

I did that, however when saving and restarting it failed so I had to change it back to the huey or do I have to do change all of them then restart?
Please advise...
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: No output on stdout) stderr: connection refused

Post by donnyforbes »

Is there a way to use the hostname there instead of IP so I don't have to change it for all of them? If not its okay I will change it, however when I tried on one "huey" it gave me an error where trying to start back up....
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: No output on stdout) stderr: connection refused

Post by donnyforbes »

This is what it is now

Code: Select all

define host{
use linux-box ; Inherit default values from a template
host_name huey  ; The name or IP or remote server
alias RHEL 7.3 ; A longer name for the server
address 192.168.1.186 ; IP address of the nagios server
}
This is what I changed it to

Code: Select all

define host{
use linux-box ; Inherit default values from a template
host_name 192.168.1.42  ; The name or IP or remote server
alias RHEL 7.3 ; A longer name for the server
address 192.168.1.186 ; IP address of the nagios server
}
Is this what you mean?
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: No output on stdout) stderr: connection refused

Post by tgriep »

https://assets.nagios.com/downloads/nag ... .html#host
You would change the address line to the IP address of the server called huey
Find this section

Code: Select all

define host{
use linux-box ; Inherit default values from a template
host_name huey  ; The name or IP or remote server
alias RHEL 7.3 ; A longer name for the server
address 192.168.1.186 ; IP address of the nagios server
change the line that starts with the address option
This is the line you would edit and change the IP address to the server called huey
address 192.168.1.186 ; IP address of the nagios server
This comment
; IP address of the nagios server
can be removed from that line as it is not a correct description and is misleading.

Use, you can use the host name in the address filed as long as the host name is setup in your DNS servers.
The following description came from the link at the top of this post. Please read it if you need any help on the options.
address: This directive is used to define the address of the host. Normally, this is an IP address, although it could really be anything you want (so long as it can be used to check the status of the host). You can use a FQDN to identify the host instead of an IP address, but if DNS services are not available this could cause problems.
Be sure to check out our Knowledgebase for helpful articles and solutions!
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: No output on stdout) stderr: connection refused

Post by donnyforbes »

Does this look right now?

Code: Select all

define host{
use linux-box ; Inherit default values from a template
host_name huey  ; The name or IP or remote server
alias RHEL 7.3 ; A longer name for the server
address 192.168.1.42 ; IP address of the nagios server
}
Or do I need to change the host_name to the <ip_address> as well?
Locked