SMTP server monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
adam.sage
Posts: 30
Joined: Tue Mar 25, 2014 8:13 am

Re: SMTP server monitoring

Post by adam.sage »

###############################################################################
#
# Host configuration file
#
# Created by: Nagios Core Config Manager 2.2.2
# Date: 2014-10-13 15:59:49
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define host {
host_name mg1
use xiwizard_mailserver_host
address 10.0.11.87
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
contacts nagiosadmin
notification_interval 60
notification_period xi_timeperiod_24x7
icon_image mailserver.png
statusmap_image mailserver.png
_xiwizard mailserver
register 1
}

###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################

###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.2.2
# Date: 2014-10-13 16:00:52
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
host_name mg1
service_description / Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 20% -c 10% -p /'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}

define service {
host_name mg1
service_description APT Updates
use xiwizard_nrpe_service
check_command check_nrpe!check_apt!-a '-U'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}

define service {
host_name mg1
service_description Blacklist Status
use xiwizard_mailserver_service
check_command check_mailserver_rbl!-B zen.spamhaus.org bl.spamcop.net dnsbl.ahbl.org dnsbl.njabl.org dnsbl.sorbs.net virbl.dnsbl.bit.nl rbl.efnet.org phishing.rbl.msrbl.net 0spam.fusionzero.com list.dsbl.org multihop.dsbl.org unconfirmed.dsbl.org will-spam-for-food.eu.org blacklist.spambag.org blackholes.brainerd.net blackholes.uceb.org spamsources.dnsbl.info map.spam-rbl.com ns1.unsubscore.com psbl.surriel.com l2.spews.dnsbl.sorbs.net bl.csma.biz sbl.csma.biz dynablock.njabl.org no-more-funn.moensted.dk ubl.unsubscore.com dnsbl-1.uceprotect.net dnsbl-2.uceprotect.net dnsbl-3.uceprotect.net spamguard.leadmon.net opm.blitzed.org bl.spamcannibal.org rbl.schulte.org dnsbl.ahbl.org virbl.dnsbl.bit.nl combined.rbl.msrbl.net
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard mailserver
register 1
}

define service {
host_name mg1
service_description CPU Stats
use xiwizard_nrpe_service
check_command check_nrpe!check_cpu_stats!-a '-w 85 -c 95'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}

define service {
host_name mg1
service_description Cron Scheduling Daemon
use xiwizard_nrpe_service
check_command check_nrpe!check_init_service!-a 'cron'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}

define service {
host_name mg1
service_description IMAP
use xiwizard_imap_service
check_command check_xi_service_imap!-j
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard mailserver
register 1
}

define service {
host_name mg1
service_description Load
use xiwizard_nrpe_service
check_command check_nrpe!check_load!-a '-w 15,10,5 -c 30,20,10'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}

define service {
host_name mg1
service_description Memory Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_mem!-a '-w 20 -c 10'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}

define service {
host_name mg1
service_description Open Files
use xiwizard_nrpe_service
check_command check_nrpe!check_open_files!-a '-w 30 -c 50'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}

define service {
host_name mg1
service_description Ping
use xiwizard_mailserver_ping_service,xiwizard_linuxserver_ping_service
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}

define service {
host_name mg1
service_description POP
use xiwizard_pop_service
check_command check_xi_service_pop!-j
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard mailserver
register 1
}

define service {
host_name mg1
service_description SMTP
use xiwizard_smtp_service
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard mailserver
register 1
}

define service {
host_name mg1
service_description SSH Server
use xiwizard_nrpe_service
check_command check_nrpe!check_init_service!-a 'ssh'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}

define service {
host_name mg1
service_description Swap Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_swap!-a '-w 50 -c 20'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}

define service {
host_name mg1
service_description Total Processes
use xiwizard_nrpe_service
check_command check_nrpe!check_procs!-a '-w 150 -c 250'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}

define service {
host_name mg1
service_description Users
use xiwizard_nrpe_service
check_command check_nrpe!check_users!-a '-w 5 -c 10'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard linux-server
register 1
}

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: SMTP server monitoring

Post by Box293 »

Thanks for that.

Lets test the command that Nagios is using which is currently causing a critical status:

From the command line:

Code: Select all

/usr/local/nagios/libexec/check_icmp -H 10.0.11.87 -w 3000.0,80% -c 5000.0,100% -p 5
What result does this produce?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
adam.sage
Posts: 30
Joined: Tue Mar 25, 2014 8:13 am

Re: SMTP server monitoring

Post by adam.sage »

[root@nagios ~]# /usr/local/nagios/libexec/check_icmp -H 10.0.11.87 -w 3000.0,80% -c 5000.0,100% -p 5
CRITICAL - 10.0.11.87: rta nan, lost 100%|rta=0.000ms;3000.000;5000.000;0; pl=100%;80;100;; rtmax=0.000ms;;;; rtmin=0.000ms;;;;
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: SMTP server monitoring

Post by lmiltchev »

What is the version of the plugin that you are using?

Code: Select all

./check_icmp -V
Do you get "Critical" as well if you use "check_ping" instead?
Be sure to check out our Knowledgebase for helpful articles and solutions!
adam.sage
Posts: 30
Joined: Tue Mar 25, 2014 8:13 am

Re: SMTP server monitoring

Post by adam.sage »

[root@nagios libexec]# ./check_icmp -V
check_icmp v2.0.2 (nagios-plugins 2.0.2)
[root@nagios libexec]# /usr/local/nagios/libexec/check_ping -H 10.0.11.87 -w 3000.0,80% -c 5000.0,100% -p 5
PING OK - Packet loss = 0%, RTA = 0.64 ms|rta=0.639000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0

I'm assuming my firewall is blocking something, but I was under the impression that ping uses icmp? I have a Cisco ASA 5510 firewall, what do I need to allow through?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: SMTP server monitoring

Post by Box293 »

http://danxlog.blogspot.com/2011/02/che ... -vpns.html

This explains the difference between the two:

Sometimes happens that your host is down and check_ping doesn't generate an alert notification, but why?

Many of you may know that check_ping is just a nagios wrapper to the ping command while check_icmp makes the control itself, but this is not the only difference. This kind of issue usually happens when involves host monitoring over vpn's.

If an host is down over a vpn the result for a missing icmp echo will be "ping timeout" instead of the usual "host unreachable" if that host was in the same network. For this reason, Nagios will interpret the timeout as a soft error and will not generate the notification.

Instead, using the check_icmp will generate a hard error and so the notification will occur.

I strongly advertise to use check_ping on local networks monitoring only, while check_icmp if you monitor hosts over vpns.

To replace the command, just open command.cfg and at the section check-host-alive, just replace check_ping with check_icmp.

Does this help?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
adam.sage
Posts: 30
Joined: Tue Mar 25, 2014 8:13 am

Re: SMTP server monitoring

Post by adam.sage »

These hosts are actually not over a vpn, just on different networks. mg1 is in the DMZ and nagios is in the main network. Also, I monitor a lot of hosts over VPN and they all work fine.

I have a rule allowing ICMP packets through the DMZ to nagios, are there any other ports/protocols that need forwarded?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: SMTP server monitoring

Post by Box293 »

I think it's probably simplest to change your check to check_ping as that seems to be working.

I don't understand why check_icmp is not working as check_ping is technically the same thing but the way the work are different (which I don't know the exact differences).
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
adam.sage
Posts: 30
Joined: Tue Mar 25, 2014 8:13 am

Re: SMTP server monitoring

Post by adam.sage »

Since this host is part of a template, what do I do to change to ping for this host?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: SMTP server monitoring

Post by Box293 »

Simply change the host object directly, select the check_ping "Check command" and define the values as per this screenshot. They will override the template.
check_ping.png
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked