wok-current view nagisk/receipt @ rev 21515
updated nagisk (1.2.5 -> 1.2.9)
author | Hans-G?nter Theisgen |
---|---|
date | Fri May 03 13:11:28 2019 +0100 (2019-05-03) |
parents | 9e01bc6321ea |
children | b569b85b0fb9 |
line source
1 # SliTaz package receipt.
3 PACKAGE="nagisk"
4 VERSION="1.2.9"
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="${WEB_SITE}archive/v$VERSION.tar.gz"
14 DEPENDS="nagios-nrpe perl sudo"
15 BUILD_DEPENDS=""
17 # Rules to gen a SliTaz package suitable for Tazpkg.
18 genpkg_rules()
19 {
20 mkdir -p $fs/usr/share/nagios/libexec
21 cp -a $src/nagisk.pl $fs/usr/share/nagios/libexec
22 sed -i 's/^elsif/} &/' $fs/usr/share/nagios/libexec/nagisk.pl
23 }
25 # Pre and post install commands for Tazpkg.
26 post_install()
27 {
28 grep -qs check_asterisk_version "$1/etc/nagios/nrpe.cfg" ||
29 cat >> "$1/etc/nagios/nrpe.cfg" <<EOT
30 command[check_asterisk_version]=/usr/share/nagios/libexec/nagisk.pl -c version
31 command[check_asterisk_peers]=/usr/share/nagios/libexec/nagisk.pl -c peers -w \$ARG1\$ -x \$ARG2\$
32 command[check_asterisk_peer]=/usr/share/nagios/libexec/nagisk.pl -c peer -p \$ARG1\$ -w \$ARG2\$ -x \$ARG3\$
33 command[check_asterisk_channels]=/usr/share/nagios/libexec/nagisk.pl -c channels -w \$ARG1\$ -x \$ARG2\$
34 command[check_asterisk_konference]=/usr/share/nagios/libexec/nagisk.pl -c konference -w \$ARG1\$ -x \$ARG2\$
35 command[check_asterisk_jabber]=/usr/share/nagios/libexec/nagisk.pl -c jabber -b \$ARG1\$
36 #command[check_asterisk_zaptel]=/usr/share/nagios/libexec/nagisk.pl -c zaptel
37 #command[check_asterisk_span]=/usr/share/nagios/libexec/nagisk.pl -c span -s \$ARG1\$
38 #command[check_asterisk_dahdi]=/usr/share/nagios/libexec/nagisk.pl -c dahdi
39 #command[check_asterisk_dahdi_span]=/usr/share/nagios/libexec/nagisk.pl -c dahdi_span -s \$ARG1\$
40 #command[check_asterisk_pri_span]=/usr/share/nagios/libexec/nagisk.pl -c pri_span -s \$ARG1\$
41 #command[check_asterisk_pri_spans]=/usr/share/nagios/libexec/nagisk.pl -c pri_spans
42 command[check_asterisk_registry]=/usr/share/nagios/libexec/nagisk.pl -c registry
43 EOT
44 grep '^nagios ALL=NOPASSWD' "$1/etc/sudoers" | grep -q asterisk ||
45 cat >> "$1/etc/sudoers" <<EOT
46 nagios ALL=NOPASSWD: /usr/sbin/asterisk
47 EOT
48 chroot "$1/" chown nagios:nagios /usr/share/nagios/libexec/nagisk.pl
49 }