I would like to monitor one of smtp servers with windows and iis and check status of smtp service.
I use a wizard for this - the TCP/UDP Port Wizard. Everything looks good but I must check that server is not woring (it is test server for DEV).
How I can check and send alert when tcp port 25 will be available?
SMTP - state ok when unavailable
Re: SMTP - state ok when unavailable
Just to make sure I understand correctly, you want to check port 25 on a Windows host, and if port 25 is open, Nagios should return critical. Is that correct?
If so, you will have to build a new command for this. We can clone an existing command to make this easier, however. Go to Configure -> Core Config Manager -> Commands, and search for tcp. You will want to create a copy of check_tcp, and edit it.
Let's call the command check_tcp_negate, and we will use this as the command line,
Then save the new command.
If you already have a host for this server defined, then create a new service that uses this command. Provide 25 as $ARG1$, and if port 25 is closed, the check will return OK.
If so, you will have to build a new command for this. We can clone an existing command to make this easier, however. Go to Configure -> Core Config Manager -> Commands, and search for tcp. You will want to create a copy of check_tcp, and edit it.
Let's call the command check_tcp_negate, and we will use this as the command line,
Code: Select all
$USER1$/negate --ok=CRITICAL --critical=OK --substitute $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$If you already have a host for this server defined, then create a new service that uses this command. Provide 25 as $ARG1$, and if port 25 is closed, the check will return OK.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: SMTP - state ok when unavailable
It works 
Thank you for your help.
Thank you for your help.
Re: SMTP - state ok when unavailable
I am glad to hear that your issue has been resolved! I am closing this topic now. If you have any further questions/issues, please start a new thread. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!