2
# ------------------------------------------------------------------------------
3
# File Name: check_dns_random.pl
4
# Author: Richard Mayhew - South Africa
7
# Description: This script will check to see if dns resolves hosts
8
# randomly from a list using the check_dns plugin.
9
# Email: netsaint@splash.co.za
10
# ------------------------------------------------------------------------------
11
# Copyright 1999 (c) Richard Mayhew
12
# Credits go to Ethan Galstad for coding Nagios
13
# If any changes are made to this script, please mail me a copy of the
16
# ------------------------------------------------------------------------------
19
# 1999/09/26 RM Creation
20
# ------------------------------------------------------------------------------
22
# -----------------------------------------------------------------[ Require ]--
25
# --------------------------------------------------------------------[ Uses ]--
29
# --------------------------------------------------------------[ Enviroment ]--
34
my $host = shift || &usage;
36
my $domainfile = "/usr/local/nagios/etc/domains.list";
37
my $wc = `/usr/bin/wc -l $domainfile`;
38
my $check = "/usr/local/nagios/libexec/check_dns";
44
open(DOMAIN,"<$domainfile") or die "Error Opening $domainfile File!\n";
49
my @data = split(/\n/,$srv_file);
56
($z,$y) = split(/\./,$x);
58
system($check, $data[$z], $host);
63
print "Minimum arguments not supplied!\n";
65
print "Perl Check Random DNS plugin for Nagios\n";
66
print "Copyright (c) 2000 Richard Mayhew\n";
68
print "Usage: check_dns_random.pl <host>\n";
70
print "<host> = DNS server you would like to query.\n";