-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall.pl
executable file
·38 lines (32 loc) · 1.01 KB
/
install.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/perl -w
# Configuration
my $binDir = "/usr/bin/erd/";
my $agentInstallDir = "./agent-plugin/";
my $agentConfDir = "/etc/zabbix/zabbix_agentd.d";
my @files = (
"ERD",
"nodes_discovery.pl",
"shards_discovery.pl",
"node_status.pl",
"node_statistics.pl",
"validator_statistics.pl",
"heartbeat_statistics.pl"
);
print("###\n### Installing the Elrond Zabbix Plugin.\n###\n");
print("Installing packages.\n");
system("apt install libwww-perl libjson-perl libcache-cache-perl -y 2>/dev/null");
print("Copying zabbix scripts:\n");
system("mkdir -p $binDir/ERD");
foreach my $file(@files){
$filePath = $agentInstallDir . $file;
print(" $filePath => $binDir\n");
system("cp -r -f $filePath $binDir");
}
print("Setting up zabbix agent:\n");
my $agentConfig = $agentInstallDir . "erd_nodes.conf";
print(" $agentConfig => $agentConfDir\n");
system("cp -f $agentConfig $agentConfDir");
print("Restarting zabbix agent.\n");
system("service zabbix-agent restart");
print("### DONE!\n");
exit 0;