UNSOLVED

Druehl1

updated

13 years ago

D

Druehl1

2 Intern

•

223 Posts

0

3597

January 8th, 2014 07:00

Need Help: Avamar proactive_check script

Hello,

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";

    }

    # close our ping handle

    $p->close();

  • 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.

  • iop2go

    1 Rookie

    •

    54 Posts

    885

    0

    Posted January 13th, 2014 10:00

    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:

    Something to that effect should work:

    #!/bin/bash

    while read server

    do

         ping $server

    if [ $? -ne 0 ]; then

      echo "Server seem down, aborting"

    fi

    "

    if [ $? -eq 0 ]; then

    call proactive_check.pl here

    fi

    done