wok view nagisk/receipt @ rev 16740

Add nagisk
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jun 08 15:15:22 2014 +0200 (2014-06-08)
parents
children b5f37c66eddd
line source
1 # SliTaz package receipt.
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 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="https://github.com/nicolargo/nagisk"
11 WGET_URL="https://codeload.github.com/nicolargo/nagisk/tar.gz/v$VERSION"
13 DEPENDS="nagios-nrpe perl sudo"
14 BUILD_DEPENDS="wget"
16 # Rules to gen a SliTaz package suitable for Tazpkg.
17 genpkg_rules()
18 {
19 mkdir -p $fs/usr/share/nagios/libexec
20 cp -a $src/nagisk.pl $fs/usr/share/nagios/libexec
21 sed -i 's/^elsif/} &/' $fs/usr/share/nagios/libexec/nagisk.pl
22 }
24 # Pre and post install commands for Tazpkg.
25 post_install()
26 {
27 grep -qs check_asterisk_version $1/etc/nagios/nrpe.cfg ||
28 cat >> $1/etc/nagios/nrpe.cfg <<EOT
29 command[check_asterisk_version]=/usr/share/nagios/libexec/nagisk.pl -c version
30 command[check_asterisk_peers]=/usr/share/nagios/libexec/nagisk.pl -c peers -w \$ARG1\$ -x \$ARG2\$
31 command[check_asterisk_peer]=/usr/share/nagios/libexec/nagisk.pl -c peer -p \$ARG1\$ -w \$ARG2\$ -x \$ARG3\$
32 command[check_asterisk_channels]=/usr/share/nagios/libexec/nagisk.pl -c channels -w \$ARG1\$ -x \$ARG2\$
33 command[check_asterisk_konference]=/usr/share/nagios/libexec/nagisk.pl -c konference -w \$ARG1\$ -x \$ARG2\$
34 command[check_asterisk_jabber]=/usr/share/nagios/libexec/nagisk.pl -c jabber -b \$ARG1\$
35 #command[check_asterisk_zaptel]=/usr/share/nagios/libexec/nagisk.pl -c zaptel
36 #command[check_asterisk_span]=/usr/share/nagios/libexec/nagisk.pl -c span -s \$ARG1\$
37 #command[check_asterisk_dahdi]=/usr/share/nagios/libexec/nagisk.pl -c dahdi
38 #command[check_asterisk_dahdi_span]=/usr/share/nagios/libexec/nagisk.pl -c dahdi_span -s \$ARG1\$
39 #command[check_asterisk_pri_span]=/usr/share/nagios/libexec/nagisk.pl -c pri_span -s \$ARG1\$
40 #command[check_asterisk_pri_spans]=/usr/share/nagios/libexec/nagisk.pl -c pri_spans
41 command[check_asterisk_registry]=/usr/share/nagios/libexec/nagisk.pl -c registry
42 EOT
43 grep '^nagios ALL= NOPASSWD' $1/etc/sudoers | grep -q asterisk ||
44 cat >> $1/etc/sudoers <<EOT
45 www ALL= NOPASSWD: /usr/sbin/asterisk
46 EOT
47 chown nagios:nagios $1/usr/share/nagios/libexec
48 chown nagios:nagios $1/usr/share/nagios/libexec/nagisk.pl
49 }