send email

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.
Locked
inserm
Posts: 24
Joined: Tue Jul 31, 2012 6:05 am

send email

Post by inserm »

hello
I tested the sending of email I added the following to the file localhost.cfg
define service {

use local-service
host_name localhost
service_description SMTP Response Check
check_command check_smtp! 5-t-e "my email address"
}
but I like error: Invalid SMTP response received from host: 220 ESMTP Exim 4.72
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: send email

Post by nscott »

The -e that you're giving it is the expect string, which you are telling it is "my email address", but its returning "220 ESMTP Exim 4.72". Try defining the command as follows:

Code: Select all

use local-service
host_name localhost
service_description SMTP Response Check
check_command check_smtp!-t 5
}
Nicholas Scott
Former Nagios employee
inserm
Posts: 24
Joined: Tue Jul 31, 2012 6:05 am

Re: send email

Post by inserm »

I tried with this:

Code: Select all

define service{
    use            			local-service	
    host_name        			localhost
    service_description    		SMTP Response Check
    check_command        		check_smtp!-t 5 -e "my_email_address"
    }
he displays a warning: Invalid SMTP response received from host: 220 "my_email_address" ESMTP Postfix (Debian / GNU)
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: send email

Post by nscott »

The -e whats tripping you up in this command. When the plugin connects tot he mail server, the string its expecting is "my_email_address", and its getting a the wrong string back in return.
Nicholas Scott
Former Nagios employee
Locked