wok-next view nagisk/receipt @ rev 20669
vde2: up / fix build
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri May 11 14:21:30 2018 +0300 (2018-05-11) |
parents | 9e01bc6321ea |
children |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="nagisk"
4 VERSION="1.2.5"
5 CATEGORY="network"
6 SHORT_DESC="Simple tool to monitor Asterisk from a Nagios server"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL3"
9 WEB_SITE="https://github.com/nicolargo/nagisk"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="https://codeload.github.com/nicolargo/nagisk/tar.gz/v$VERSION"
14 compile_rules() {
15 mkdir -p $install/usr/share/nagios/libexec/
16 cp -a $src/nagisk.pl $install/usr/share/nagios/libexec/
17 sed -i 's/^elsif/} &/' $install/usr/share/nagios/libexec/nagisk.pl
18 }
20 genpkg_rules() {
21 copy @std
22 DEPENDS="nagios-nrpe perl sudo"
23 }
25 post_install() {
26 grep -qs check_asterisk_version "$1/etc/nagios/nrpe.cfg" ||
27 cat >> "$1/etc/nagios/nrpe.cfg" <<EOT
28 command[check_asterisk_version]=/usr/share/nagios/libexec/nagisk.pl -c version
29 command[check_asterisk_peers]=/usr/share/nagios/libexec/nagisk.pl -c peers -w \$ARG1\$ -x \$ARG2\$
30 command[check_asterisk_peer]=/usr/share/nagios/libexec/nagisk.pl -c peer -p \$ARG1\$ -w \$ARG2\$ -x \$ARG3\$
31 command[check_asterisk_channels]=/usr/share/nagios/libexec/nagisk.pl -c channels -w \$ARG1\$ -x \$ARG2\$
32 command[check_asterisk_konference]=/usr/share/nagios/libexec/nagisk.pl -c konference -w \$ARG1\$ -x \$ARG2\$
33 command[check_asterisk_jabber]=/usr/share/nagios/libexec/nagisk.pl -c jabber -b \$ARG1\$
34 #command[check_asterisk_zaptel]=/usr/share/nagios/libexec/nagisk.pl -c zaptel
35 #command[check_asterisk_span]=/usr/share/nagios/libexec/nagisk.pl -c span -s \$ARG1\$
36 #command[check_asterisk_dahdi]=/usr/share/nagios/libexec/nagisk.pl -c dahdi
37 #command[check_asterisk_dahdi_span]=/usr/share/nagios/libexec/nagisk.pl -c dahdi_span -s \$ARG1\$
38 #command[check_asterisk_pri_span]=/usr/share/nagios/libexec/nagisk.pl -c pri_span -s \$ARG1\$
39 #command[check_asterisk_pri_spans]=/usr/share/nagios/libexec/nagisk.pl -c pri_spans
40 command[check_asterisk_registry]=/usr/share/nagios/libexec/nagisk.pl -c registry
41 EOT
42 grep '^nagios ALL=NOPASSWD' "$1/etc/sudoers" | grep -q asterisk ||
43 cat >> "$1/etc/sudoers" <<EOT
44 nagios ALL=NOPASSWD: /usr/sbin/asterisk
45 EOT
46 chroot "$1/" chown nagios:nagios /usr/share/nagios/libexec/nagisk.pl
47 }