diff options
| author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-02 13:16:24 +0200 |
|---|---|---|
| committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-02 13:16:24 +0200 |
| commit | b15adb7762b6caaecaa83637abfcf5fdb4802092 (patch) | |
| tree | 64eddbe2aa1a7f98a140be0f7973f05d7a781ae0 /contrib/check_dns_random.pl | |
| parent | c4d5882b9e1d07c7b61091062b7d085fa5f00284 (diff) | |
| download | monitoring-plugins-b15adb7762b6caaecaa83637abfcf5fdb4802092.tar.gz | |
Remove "contrib" plugins
These days, sites such as "Nagios Exchange" are a much better place for
publishing plugins not maintained by the Plugins Development Team.
Diffstat (limited to 'contrib/check_dns_random.pl')
| -rw-r--r-- | contrib/check_dns_random.pl | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/contrib/check_dns_random.pl b/contrib/check_dns_random.pl deleted file mode 100644 index 4bed4120..00000000 --- a/contrib/check_dns_random.pl +++ /dev/null | |||
| @@ -1,74 +0,0 @@ | |||
| 1 | #!/usr/bin/perl | ||
| 2 | # ------------------------------------------------------------------------------ | ||
| 3 | # File Name: check_dns_random.pl | ||
| 4 | # Author: Richard Mayhew - South Africa | ||
| 5 | # Date: 2000/01/26 | ||
| 6 | # Version: 1.0 | ||
| 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 | ||
| 14 | # changes :) | ||
| 15 | # License GPL | ||
| 16 | # ------------------------------------------------------------------------------ | ||
| 17 | # Date Author Reason | ||
| 18 | # ---- ------ ------ | ||
| 19 | # 1999/09/26 RM Creation | ||
| 20 | # ------------------------------------------------------------------------------ | ||
| 21 | |||
| 22 | # -----------------------------------------------------------------[ Require ]-- | ||
| 23 | require 5.004; | ||
| 24 | |||
| 25 | # --------------------------------------------------------------------[ Uses ]-- | ||
| 26 | use Socket; | ||
| 27 | use strict; | ||
| 28 | |||
| 29 | # --------------------------------------------------------------[ Enviroment ]-- | ||
| 30 | $ENV{PATH} = "/bin"; | ||
| 31 | $ENV{BASH_ENV} = ""; | ||
| 32 | $|=1; | ||
| 33 | |||
| 34 | my $host = shift || &usage; | ||
| 35 | |||
| 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"; | ||
| 39 | my $x = 0; | ||
| 40 | my $srv_file = ""; | ||
| 41 | my $z = ""; | ||
| 42 | my $y = ""; | ||
| 43 | |||
| 44 | open(DOMAIN,"<$domainfile") or die "Error Opening $domainfile File!\n"; | ||
| 45 | while (<DOMAIN>) { | ||
| 46 | $srv_file .= $_; | ||
| 47 | } | ||
| 48 | close(DOMAIN); | ||
| 49 | my @data = split(/\n/,$srv_file); | ||
| 50 | |||
| 51 | chomp $wc; | ||
| 52 | $wc =~ s/ //g; | ||
| 53 | $wc =~ s/domains//g; | ||
| 54 | |||
| 55 | $x = rand $wc; | ||
| 56 | ($z,$y) = split(/\./,$x); | ||
| 57 | |||
| 58 | system($check, $data[$z], $host); | ||
| 59 | exit ($? / 256); | ||
| 60 | |||
| 61 | sub usage | ||
| 62 | { | ||
| 63 | print "Minimum arguments not supplied!\n"; | ||
| 64 | print "\n"; | ||
| 65 | print "Perl Check Random DNS plugin for Nagios\n"; | ||
| 66 | print "Copyright (c) 2000 Richard Mayhew\n"; | ||
| 67 | print "\n"; | ||
| 68 | print "Usage: check_dns_random.pl <host>\n"; | ||
| 69 | print "\n"; | ||
| 70 | print "<host> = DNS server you would like to query.\n"; | ||
| 71 | exit -1; | ||
| 72 | |||
| 73 | } | ||
| 74 | |||
