Forum Discussion
daniel_chien_18
Jun 11, 2011Historic F5 Account
For Microsoft WINS server monitor (Netbios name server), it may need to create an external monitor with perl script that queries Netbios name.
1.Install the following Perl code from CPAN to /usr/lib/perl5/site_perl/5.8.8/Net (BIG-IP LTM 10.x)
Net::NBName http://search.cpan.org/~jmacfarla/Net-NBName-0.26/lib/Net/NBName.pm
Net::Netmask http://search.cpan.org/dist/Net-Netmask/
You may want to install on other CentOS system first and then copy over.
2.Create a perl script in /usr/bin/monitors
!/usr/bin/perl
use strict;
use Net::NBName;
my $nb = Net::NBName->new;
my $host = shift;
my $port = shift;
my $param = shift;
$host =~ s/::ffff://;
if ($param =~ /^([\w-]+)\(\w{1,2})$/) {
my $name = $1;
my $suffix = hex $2;
my $nq;
if (defined($host) && $host =~ /\d+\.\d+\.\d+\.\d+/) {
printf "querying %s for %s<%02X>...\n", $host, $name, $suffix;
$nq = $nb->name_query($host, $name, $suffix);
} else {
printf "broadcasting for %s<%02X>...\n", $name, $suffix;
$nq = $nb->name_query(undef, $name, $suffix);
}
if ($nq) {
print $nq->as_string;
print "UP\n";
}
}
3.Create an external monitor. The external Program is the perl script created above. The Arguments is the netbios name you want to query. The format is netbios_namesuffix. You can find by “nbtstat –n” on the WINS server. For example, for domain name, it is domain_name00
Daniel