I need some help in expanding the given proactive check Perl script.
We have a huge avamar installation with 105 singel node server which have to be rolled out.
As check after the base installation I plan the use the proactive_check script, but there is one thing which would be great to be in this script. A ping check, to check if e.g the Domain Controller or the Avamar replication server is reachable.
I saw that there is a Perl module called Net::Ping, but as I am no Perl expert and the script has about 5000 lines, I am not able to add this method to the script.
Perhpas someone has used something lilke this before and can help me here.
This is the script I want to use/add:
#!/usr/bin/perl -w
use Net::Ping;
# Host can be either an IP or domain name
my $host = "www.google.com";
#optionally specify a timeout in seconds (Defaults to 5 if not set)
my $timeout = 10;
# Create a new ping object
$p = Net::Ping->new("icmp");
# Optionally specify a port number (Defaults to echo port is not used)
# $p->port_number("80");
# perform the ping
if( $p->ping($host, $timeout) )
{
print "Host ".$host." is alive\n";
}
else
{
print "Warning: ".$host." appears to be down or icmp packets are blocked by their server\n";
Because I'm way lazy, and I'd rather slit my wrists open than write another line of Perl that I can't understand 6 months later, I would just use a bash wrapper, i.e:
Leo Li
4 Apprentice
•
9030 Posts
885
0
Posted January 12th, 2014 19:00
Hey,
I have researched it, but I cannot find any related info. I suggest you to consult with Avamar engineering for this. Maybe they can help to you.