The gurus have asked me to include the following scripting in our branch
office Nagios server configuration in order to monitor a remote co-location
site DNS server . I understand how/where to include the
host/service/contact/command definitions scripting, but where (what
file(s)) do I include the company_check_dns scripting command set procedure
listed near the bottom? I am running v3.0.2 on Fedora with the quick
installation setup.
***
We need to monitor DNS server at ip x.x.x.x both for ICMP and DNS.
Here are definitions for nagios that used to use, they will have to be
modified by you to work with the DNS server.
linux-admins group would have 3 names Larry, Moe and Curly.
***
define host {
use generic-host
host_name dns20
alias ns20
address x.x.x.x
max_check_attempts 3
notification_period 24x7
notification_optionsd,u,r
check_command check-host-alive
contact_groups linux-admins
}
define service {
use generic-service
host_name dns20
service_description PING
is_volatile 0
check_period24x7
max_check_attempts 8
normal_check_interval 10
retry_check_interval2
contact_groups linux-admins
notification_period 24x7
notification_optionsc,r
check_command check_ping!100.0,20%!900.0,60%
event_handler networkdevice-notify-by-epager
event_handler_enabled 1
}
define service {
use generic-service
host_name dns20
service_description dns_check
is_volatile 0
check_period24x7
max_check_attempts 8
normal_check_interval 20
retry_check_interval5
contact_groups linux-admins
notification_period 24x7
notification_optionsc,r
check_command company_check_dns
event_handler networkdevice-notify-by-epager
event_handler_enabled 1
}
define command{
command_namecompany_check_dns
command_line$USER2$/company_check_dns $HOSTADDRESS$
}
### company_check_dns
#!/bin/bash
PATH=$PATH:/usr/lib/nagios/company-plugins
DOMAINSTOCHECK="ftp.company1.com company.com company2.com comp\
any3.com company4.com company5.com"
for i in `echo $DOMAINSTOCHECK`; do
RESULT=`check_dns -H $i -s $1 | grep CRITICAL`
if [ "x$RESULT" != "x" ]
then
echo "DNS CRITICAL - $1 - $i"
exit 2
fi
done
echo "DNS ok - $1";
exit 0
###end of company_check_dns
# 'mkozlows' contact definition
define contact{
contact_namemkozlows
alias Mariusz Kozlowski
service_notification_period 24x7
host_notification_period24x7
service_notification_optionsc,r
host_notification_options d,r
service_notification_commands notify-by-email,notify-by-epager
host_notification_commands
host-notify-by-email,host-notify-by-epager
email mariusz.kozlow...@fitchratings.com
pager 9178053...@cingularme.com
}
define contact{
contact_namektai
alias Ken Tai
service_notification_period 24x7
host_notification_period24x7
service_notification_optionsc,r
host_notification_options d,r
service_notification_commands notify-by-email,notify-by-epager
host_notification_commands
host-notify-by-email,host-notify-by-epager
email kenneth@fitchratings.com
pager 9178053...@cingularme.com
}
# 'mbarker' contact definition
define contact{
contact_namembarker
alias Matt Barker
service_notification_period 24x7
host_notification_period24x7
service_notification_optionsc,r
host_notification_options d,r
service_notification_commands notify-by-email,notify-by-epager
host_notification_commands
host-notify-by-email,host-notify-by-epager
email
matthew.bar...@fitchratings.com,mbarker9...@gmail.com
pager
6462564...@cingularme.com,5167493...@cingularme.com
__