* Initial import

This commit is contained in:
Gabriele Vivinetto 2019-07-11 17:31:23 +02:00
parent 52affd48ce
commit 24e71fb9cc
10 changed files with 65 additions and 8 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.deb

View File

@ -4,19 +4,23 @@ This is based on script found in thread https://www.zabbix.com/forum/showthread.
Tested with Zabbix 4.0 (http://www.zabbix.com/) and Backuppc v3 (http://backuppc.sourceforge.net/).
## Install
## Debian Package Build
fakeroot dpkg-deb --build src/ .
## Manual Install
Add a line from 'sudo' file to your sudo config
cp etc/sudoers.d/zabbix-backuppc /etc/sudoers.d/zabbix-backuppc
Copy 'zabbix-backuppc.pl' and 'zabbix-discover-backuppc.pl' to '/usr/local/bin'
Copy 'zabbix-backuppc.pl' and 'zabbix-discover-backuppc.pl' to '/usr/bin'
cp usr/local/bin/*.pl /usr/local/bin
cp usr/bin/*.pl /usr/bin
Make it executable with backuppc user
chmod +x /usr/local/bin/*.pl
chmod +x /usr/bin/*.pl
You need to have in Zabbix agent config
@ -87,7 +91,7 @@ Information about the BackupPc itself.
Discovery from individual backups
system.run["sudo -u backuppc /usr/local/bin/zabbix-discover-backuppc.pl"]
system.run["sudo -u backuppc /usr/bin/zabbix-discover-backuppc.pl"]
#### Items

View File

@ -1,2 +0,0 @@
zabbix ALL = (ALL) NOPASSWD: /usr/local/bin/zabbix-backuppc.pl,/usr/local/bin/zabbix-discover-backuppc.pl

1
src/DEBIAN/conffiles Normal file
View File

@ -0,0 +1 @@
/etc/sudoers.d/zabbix_backuppc

10
src/DEBIAN/control Normal file
View File

@ -0,0 +1,10 @@
Package: zabbix-backuppc
Version: 1.0.0-2019071103
Section: net
Priority: optional
Architecture: all
Depends: zabbix-agent (>=4.0), zabbix-sender (>=4.0)
Maintainer: Gabriele Vivinetto <gabriele.mailing@rvmgroup.it>
Description: Zabbiz agent scripts to monitor BackupPC
These scripts monitor a BackupPC server

41
src/DEBIAN/postinst Executable file
View File

@ -0,0 +1,41 @@
#!/bin/sh
# postinst script for tcng-config
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
/bin/sed -i -e 's/# EnableRemoteCommands=0/EnableRemoteCommands=1/' /etc/zabbix/zabbix_agentd.conf
/usr/sbin/service zabbix-agent restart
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

View File

@ -0,0 +1,2 @@
zabbix ALL = (ALL) NOPASSWD: /usr/bin/zabbix-backuppc.pl,/usr/bin/zabbix-discover-backuppc.pl

View File

@ -2224,7 +2224,7 @@
<type>7</type>
<snmp_community/>
<snmp_oid/>
<key>system.run[&quot;sudo -u backuppc /usr/local/bin/zabbix-backuppc.pl&quot;]</key>
<key>system.run[&quot;sudo -u backuppc /usr/bin/zabbix-backuppc.pl&quot;]</key>
<delay>300</delay>
<history>90d</history>
<trends>365d</trends>