Sporadic 'Connection refused' errors in 4.2.4

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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Sporadic 'Connection refused' errors in 4.2.4

Post by dwhitfield »

@kernow5000, what would you like to do? As I see it, we have three options:

1. Leave this open in case you want to dig into it in the future.
2. Lock the thread
3. Turn debugging back on and send us the logs.

Seems like 3 is probably out, so 1 or 2?

Thanks!
kernow5000
Posts: 58
Joined: Mon Jan 09, 2017 9:06 am

Re: Sporadic 'Connection refused' errors in 4.2.4

Post by kernow5000 »

I'll turn the problematic checks on tomorrow and enable debugging, then update you here. :)
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Sporadic 'Connection refused' errors in 4.2.4

Post by dwhitfield »

Sounds great, thanks!

UPDATE: Logs received and shared with techs
kernow5000
Posts: 58
Joined: Mon Jan 09, 2017 9:06 am

Re: Sporadic 'Connection refused' errors in 4.2.4

Post by kernow5000 »

Problematic checks re-enabled for the day and logging enabled (debug=1)

All set to email notifications only so shouldn't get too annoying. I'll PM logs to one of you tomorrow probably.

(Please treat with sensitivity) :)
kernow5000
Posts: 58
Joined: Mon Jan 09, 2017 9:06 am

Re: Sporadic 'Connection refused' errors in 4.2.4

Post by kernow5000 »

Running for an hour or so so far. Not a single connection refused error and everything reporting normally.
kernow5000
Posts: 58
Joined: Mon Jan 09, 2017 9:06 am

Re: Sporadic 'Connection refused' errors in 4.2.4

Post by kernow5000 »

Put debug to -1 as I have plenty of space and 1 was only really showing function calls.

Ah that's better.
kernow5000
Posts: 58
Joined: Mon Jan 09, 2017 9:06 am

Re: Sporadic 'Connection refused' errors in 4.2.4

Post by kernow5000 »

Same old connection refused errors again on the checks I re-enabled.

I'll pm you some logs.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Sporadic 'Connection refused' errors in 4.2.4

Post by tgriep »

It looks like there is a missing " in the notify-host-by-email command. There should be one between the -s and the $NOTIFICATIONTYPE$.
Edit that command and change it from

Code: Select all

command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s  $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
to

Code: Select all

command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s  "$NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
Save it out and restart nagios

Make sure the notify-service-by-email command is correct as well.
Be sure to check out our Knowledgebase for helpful articles and solutions!
kernow5000
Posts: 58
Joined: Mon Jan 09, 2017 9:06 am

Re: Sporadic 'Connection refused' errors in 4.2.4

Post by kernow5000 »

That is actually there, I just use nano and you know.. Column width clipping and all that.

Code: Select all

 command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$

Code: Select all

command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
kernow5000
Posts: 58
Joined: Mon Jan 09, 2017 9:06 am

Re: Sporadic 'Connection refused' errors in 4.2.4

Post by kernow5000 »

(They are the standard notification commands that come in commands.cfg with Nagios... basically)

Unlikely they are wrong, as they haven't been altered.
Locked