Page 7 of 9

Re: Sporadic 'Connection refused' errors in 4.2.4

PostPosted: Tue Jan 31, 2017 12:25 pm
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!

Re: Sporadic 'Connection refused' errors in 4.2.4

PostPosted: Tue Jan 31, 2017 12:27 pm
by kernow5000
I'll turn the problematic checks on tomorrow and enable debugging, then update you here. :)

Re: Sporadic 'Connection refused' errors in 4.2.4

PostPosted: Tue Jan 31, 2017 1:21 pm
by dwhitfield
Sounds great, thanks!

UPDATE: Logs received and shared with techs

Re: Sporadic 'Connection refused' errors in 4.2.4

PostPosted: Wed Feb 01, 2017 5:00 am
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) :)

Re: Sporadic 'Connection refused' errors in 4.2.4

PostPosted: Wed Feb 01, 2017 5:58 am
by kernow5000
Running for an hour or so so far. Not a single connection refused error and everything reporting normally.

Re: Sporadic 'Connection refused' errors in 4.2.4

PostPosted: Wed Feb 01, 2017 6:32 am
by kernow5000
Put debug to -1 as I have plenty of space and 1 was only really showing function calls.

Ah that's better.

Re: Sporadic 'Connection refused' errors in 4.2.4

PostPosted: Wed Feb 01, 2017 9:30 am
by kernow5000
Same old connection refused errors again on the checks I re-enabled.

I'll pm you some logs.

Re: Sporadic 'Connection refused' errors in 4.2.4

PostPosted: Wed Feb 01, 2017 1:26 pm
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.

Re: Sporadic 'Connection refused' errors in 4.2.4

PostPosted: Thu Feb 02, 2017 6:48 am
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$

Re: Sporadic 'Connection refused' errors in 4.2.4

PostPosted: Thu Feb 02, 2017 11:06 am
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.