diff --git a/README.md b/README.md index 696f515..8a9bde1 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,16 @@ This is based on script found in thread https://www.zabbix.com/forum/showthread.php?t=17273 -Tested with Zabbix 2.4 (http://www.zabbix.com/) and Backuppc v3 (http://backuppc.sourceforge.net/). +Tested with Zabbix 4.0 (http://www.zabbix.com/) and Backuppc v3 (http://backuppc.sourceforge.net/). ## Install 1. Add a line from 'sudo' file to your sudo config + cp etc/sudoers.d/zabbix-backuppc /etc/sudoers.d/zabbix-backuppc 2. copy 'zabbix-backuppc.pl' and 'zabbix-discover-backuppc.pl' to '/usr/local/bin' + cp usr/local/bin/*.pl /usr/local/bin 3. make it executable with backuppc user + chmod +x /usr/local/bin/*.pl 4. You need to have 'EnableRemoteCommands=1' in Zabbix agent config 4. Import 'backuppc_zbx_export_templates.xml' into Zabbix and configure it diff --git a/sudo b/etc/sudoers.d/zabbix_backuppc similarity index 100% rename from sudo rename to etc/sudoers.d/zabbix_backuppc diff --git a/zabbix-backuppc.pl b/usr/local/bin/zabbix-backuppc.pl similarity index 98% rename from zabbix-backuppc.pl rename to usr/local/bin/zabbix-backuppc.pl index cc66f1d..8b71392 100755 --- a/zabbix-backuppc.pl +++ b/usr/local/bin/zabbix-backuppc.pl @@ -345,7 +345,10 @@ sub zabbix_post { foreach my $server (@servers) { my $cmd = "zabbix_sender -z $server -p 10051 -s $zabbix_host -k $key -o '$val'"; - system("$cmd >/dev/null"); + $cmd_result=system("$cmd >/dev/null"); + if ( $cmd_result > 0 ) { + print ("Sending data failed. Try to execute the command manually to see errors (is your host correclty spelled ?)\n$cmd\n"); + } } } diff --git a/zabbix-discover-backuppc.pl b/usr/local/bin/zabbix-discover-backuppc.pl similarity index 100% rename from zabbix-discover-backuppc.pl rename to usr/local/bin/zabbix-discover-backuppc.pl diff --git a/backuppc_zbx_export_templates.xml b/zabbix-templates/zabbix-backuppc-template.xml similarity index 100% rename from backuppc_zbx_export_templates.xml rename to zabbix-templates/zabbix-backuppc-template.xml