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_options d,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_period 24x7
max_check_attempts 8
normal_check_interval 10
retry_check_interval 2
contact_groups linux-admins
notification_period 24x7
notification_options c,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_period 24x7
max_check_attempts 8
normal_check_interval 20
retry_check_interval 5
contact_groups linux-admins
notification_period 24x7
notification_options c,r
check_command company_check_dns
event_handler networkdevice-notify-by-epager
event_handler_enabled 1
}
define command{
command_name company_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_name mkozlows
alias Mariusz Kozlowski
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c,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 [email protected]
pager [email protected]
}
define contact{
contact_name ktai
alias Ken Tai
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c,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 [email protected]
pager [email protected]
}
# 'mbarker' contact definition
define contact{
contact_name mbarker
alias Matt Barker
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c,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
[email protected],[email protected]
pager
[email protected],[email protected]
______________________________________________________________________
Confidentiality Notice: The information in this e-mail and any attachment(s)
is confidential and for the use of the addressee(s) only. If you have received
this e-mail in error, please delete this e-mail. Unauthorized use, reliance,
disclosure or copying of the contents of this e-mail, or any similar action, is
prohibited.
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
------------------------------------------------------------------------------
_______________________________________________
Nagios-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue.
::: Messages without supporting info will risk being sent to /dev/null