Search
j0ke.net Open Build Service
>
Projects
>
server:monitoring
:
icinga
:
production
>
nagios-plugins-dns
> check_dns_random-new.pl
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File check_dns_random-new.pl of Package nagios-plugins-dns
#!/usr/bin/perl -w # Date Author Reason # ---- ------ ------ # 1999/09/26 RM Creation # 2006/04/18 TS Update / Rewrite # ------------------------------------------------------------------------------ # -----------------------------------------------------------------[ Require ]-- require 5.004; # --------------------------------------------------------------------[ Uses ]-- use strict; # --------------------------------------------------------------[ Enviroment ]-- $|=1; my $host = shift || &usage; my $domainfile = "/etc/nagios/domains.list"; my $check = "/usr/lib/nagios/plugins/check_dns"; open(DOMAIN,"<$domainfile") or die "Error Opening $domainfile File!\n"; my @data = <DOMAIN>; close(DOMAIN); my $randomline = int(rand @data); system($check, '-H', $data[$randomline], '-s', $host); exit ($? / 256); sub usage { print "Minimum arguments not supplied!\n"; print "\n"; print "Perl Check Random DNS plugin for Nagios\n"; print "Copyright (c) 2000 Richard Mayhew\n"; print "\n"; print "Usage: check_dns_random.pl <host>\n"; print "\n"; print "<host> = DNS server you would like to query.\n"; exit -1; }