November 2007
Beginner
642 pages
15h 43m
English
You want to know how to use Nagios to monitor your mail server. You want it to keep an eye on SMTP, POP, SSH, and IMAP services.
Add new host and service definition entries to the hosts.cfg and services.cfg files. You may also need some new command definitions in commands.cfg.
First, make sure these entries exist in commands.cfg:
# 'check_pop' command definition
define command{
command_name check_pop
command_line $USER1$/check_pop -H $HOSTADDRESS$
}
# 'check_smtp' command definition
define command{
command_name check_smtp
command_line $USER1$/check_smtp -H $HOSTADDRESS$
}
# 'check_imap' command definition
define command{
command_name check_imap
command_line $USER1$/check_imap -H $HOSTADDRESS$
}
# 'check_ssh' command definition
define command{
command_name check_ssh
command_line $USER1$/check_ssh -H $HOSTADDRESS$
}Next, create a host definition for the server:
# define a Mail server host
define host{
use generic-host
host_name postfix1
alias mail server1
address 192.168.1.27
check_command check-host-alive
max_check_attempts 10
check_period 24x7
notification_interval 120
notification_period 24x7
notification_options d,r
contact_groups admins
}Add your new server to an existing group; or, create a new group for it, as this example shows:
define hostgroup{
hostgroup_name mail_servers
alias Mail Servers
members postfix1
}Next, define the four services (POP, IMAP, SMTP, and SSH) in services.cfg. Each service requires a separate definition. ...
Read now
Unlock full access