Nagios do not send Notification Emails

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.
BAK
Posts: 12
Joined: Thu Jul 04, 2013 6:34 am

Re: Nagios do not send Notification Emails

Post by BAK »

192.168.120.1 is unreachable, in the command.cfg file there is nothing about the HTTP check,
but in /etc/nagios-plugin/config/http.cfg:

Code: Select all

# 'check_http' command definition
define command{
	command_name	check_http
	command_line	/usr/lib/nagios/plugins/check_http -H '$HOSTADDRESS$' -I '$HOSTADDRESS$'
	}

# 'check_http_hostname' command definition
define command{
	command_name	check_httpname
	command_line	/usr/lib/nagios/plugins/check_http -H '$HOSTNAME$' -I '$HOSTADDRESS$'
	}

# 'check_http2' command definition
define command{
	command_name	check_http2
	command_line	/usr/lib/nagios/plugins/check_http -H '$ARG1$' -I '$HOSTADDRESS$' -w '$ARG2$' -c '$ARG3$'
	}

# 'check_squid' command definition
define command{
	command_name	check_squid
	command_line	/usr/lib/nagios/plugins/check_http -H '$HOSTADDRESS$' -p '$ARG1$'  -u '$ARG2$'  -e 'HTTP/1.0 200 OK'
	}

# 'check_https' command definition
define command{
	command_name    check_https
	command_line	/usr/lib/nagios/plugins/check_http --ssl -H '$HOSTADDRESS$' -I '$HOSTADDRESS$'
	}

# 'check_https_hostname' command definition
define command{
	command_name	check_https_hostname
	command_line	/usr/lib/nagios/plugins/check_http --ssl -H '$HOSTNAME$' -I '$HOSTADDRESS$'
	}

# 'check_https_auth' command definition
define command{
	command_name	check_https_auth
	command_line	/usr/lib/nagios/plugins/check_http --ssl -H '$HOSTADDRESS$' -I '$HOSTADDRESS$' -a '$ARG1$'
	}

# 'check_https_auth_hostname' command definition
define command{
	command_name	check_https_auth_hostname
	command_line	/usr/lib/nagios/plugins/check_http --ssl -H '$HOSTNAME$' -I '$HOSTADDRESS$' -a '$ARG1$'
	}

# 'check_cups' command definition
define command{
	command_name	check_cups
	command_line	/usr/lib/nagios/plugins/check_http -I '$HOSTADDRESS$' -p 631
	}

####
# use these checks, if you want to test IPv4 connectivity on IPv6 enabled systems
####

# 'check_http_4' command definition
define command{
        command_name    check_http_4
        command_line    /usr/lib/nagios/plugins/check_http -H '$HOSTADDRESS$' -I '$HOSTADDRESS$' -4
        }

# 'check_http_hostname_4' command definition
define command{
	command_name	check_httpname_4
	command_line	/usr/lib/nagios/plugins/check_http -H '$HOSTNAME$' -I '$HOSTADDRESS$' -4
	}

# 'check_http2_4' command definition
define command{
        command_name    check_http2_4
        command_line    /usr/lib/nagios/plugins/check_http -H '$ARG1$' -I '$HOSTADDRESS$' -w '$ARG2$' -c '$ARG3$' -4
        }

# 'check_squid_4' command definition
define command{
        command_name    check_squid_4
        command_line    /usr/lib/nagios/plugins/check_http -H '$HOSTADDRESS$' -p '$ARG1$'  -u '$ARG2$'  -e 'HTTP/1.0 200 OK' -4
        }

# 'check_https_4' command definition
define command{
        command_name    check_https_4
        command_line    /usr/lib/nagios/plugins/check_http --ssl -H '$HOSTADDRESS$' -I '$HOSTADDRESS$' -4
	}

# 'check_https_hostname_4' command definition
define command{
	command_name	check_https_hostname_4
	command_line	/usr/lib/nagios/plugins/check_http --ssl -H '$HOSTNAME$' -I '$HOSTADDRESS$' -4
	}

# 'check_https_auth_4' command definition
define command{
        command_name    check_https_auth_4
        command_line    /usr/lib/nagios/plugins/check_http --ssl -H '$HOSTADDRESS$' -I '$HOSTADDRESS$' -a '$ARG1$' -4
        }

# 'check_https_auth_hostname_4' command definition
define command{
	command_name	check_https_auth_hostname_4
	command_line	/usr/lib/nagios/plugins/check_http --ssl -H '$HOSTNAME' -I '$HOSTADDRESS$' -a '$ARG1$' -4
	}

# 'check_cups_4' command definition
define command{
	command_name	check_cups_4
	command_line	/usr/lib/nagios/plugins/check_http -I '$HOSTADDRESS$' -p 631 -4
	}
The service is defined as follows:

Code: Select all

define service{
	use                     generic-service
	hostgroup_name          servers
	service_description     HTTP Conection
	check_command           check_http!192.168.120.1!5!8
}
Maybe I wrote the check_command in a wrong way.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nagios do not send Notification Emails

Post by sreinhardt »

Well your definition looks fine aside from that the last two arguments are not being used with the current command definition. What happens if you run that command from the command line? Also what happens if you add the -v command while running from the command line?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked