mibs 1.53 KB
Newer Older
1
2
3
4
5
6
7
8
9
#
# The template
#
use strict;
use libinstall;
use installvars;

my $MIBPATH       = "/usr/local/share/snmp/mibs";
my $CISCO_MIB_FTP = "ftp://ftp.cisco.com/pub/mibs/v2";
Leigh B Stoller's avatar
Leigh B Stoller committed
10
my $HP_MIB_FTP    = "http://www.emulab.net/downloads";
11
12
13

my @CISCO_MIBS = ("CISCO-SMI", "CISCO-TC", "CISCO-VTP-MIB", "CISCO-PAGP-MIB",
    "CISCO-PRIVATE-VLAN-MIB", "CISCO-STACK-MIB", "CISCO-VLAN-MEMBERSHIP-MIB",
14
		  "CISCO-C2900-MIB", "CISCO-CONFIG-COPY-MIB");
Leigh B Stoller's avatar
Leigh B Stoller committed
15

16
my @HP_MIBS = ("HP-ICF-OID", "BRIDGE-MIB");
17
18
19
20
21
22
23
24
25
26
27
28

sub Install($$$)
{
    my ($server, $isupdate, $impotent) = @_;

    # Replace if this script does an update for ip/domain.
    return 0
	if ($isupdate);

    Phase "mibs", "Fetching Cisco MIBs", sub {
        # Not needed in an inner elab, and it takes a long time.
	PhaseSkip("Not needed in ELABINELAB")
Leigh B Stoller's avatar
Leigh B Stoller committed
29
	    if ($ELABINELAB && !$PROTOGENI_GENIRACK);
30
31
32
33
34
35
36
37
38
39
	
	foreach my $mib (@CISCO_MIBS) {
	    my $localfile = "$MIBPATH/$mib.txt";
	    my $mibURL = "$CISCO_MIB_FTP/$mib.my";
	    Phase "$mib", "Fetching $mib", sub {
		DoneIfExists($localfile);
		FetchFileFatal($mibURL,$localfile);
	    };
	}
    };
Leigh B Stoller's avatar
Leigh B Stoller committed
40
41
42
43
44
45
46
47
48
49
50
51
52
53
    Phase "hpmibs", "Fetching HP MIBs", sub {
        # Not needed in an inner elab, and it takes a long time.
	PhaseSkip("Not needed in ELABINELAB")
	    if ($ELABINELAB && !$PROTOGENI_GENIRACK);
	
	foreach my $mib (@HP_MIBS) {
	    my $localfile = "$MIBPATH/$mib.txt";
	    my $mibURL = "$HP_MIB_FTP/$mib.txt";
	    Phase "$mib", "Fetching $mib", sub {
		DoneIfExists($localfile);
		FetchFileFatal($mibURL,$localfile);
	    };
	}
    };
54
55
56
57
58
59
    return 0;
}

# Local Variables:
# mode:perl
# End: