wok annotate nagisk/receipt @ rev 21787
voxelands: update bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jul 24 14:51:54 2019 +0200 (2019-07-24) |
parents | 9e01bc6321ea |
children | b569b85b0fb9 |
rev | line source |
---|---|
pascal@16740 | 1 # SliTaz package receipt. |
pascal@16740 | 2 |
pascal@16740 | 3 PACKAGE="nagisk" |
Hans-G?nter@21515 | 4 VERSION="1.2.9" |
pascal@16740 | 5 CATEGORY="network" |
pascal@16740 | 6 SHORT_DESC="Simple tool to monitor Asterisk from a Nagios server." |
pascal@16740 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@16740 | 8 LICENSE="GPL3" |
Hans-G?nter@21515 | 9 WEB_SITE="https://github.com/nicolargo/nagisk/" |
Hans-G?nter@21515 | 10 |
pascal@16740 | 11 TARBALL="$PACKAGE-$VERSION.tar.gz" |
Hans-G?nter@21515 | 12 WGET_URL="${WEB_SITE}archive/v$VERSION.tar.gz" |
pascal@16740 | 13 |
pascal@16740 | 14 DEPENDS="nagios-nrpe perl sudo" |
Hans-G?nter@21515 | 15 BUILD_DEPENDS="" |
pascal@16740 | 16 |
pascal@16740 | 17 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@16740 | 18 genpkg_rules() |
pascal@16740 | 19 { |
pascal@16740 | 20 mkdir -p $fs/usr/share/nagios/libexec |
Hans-G?nter@21515 | 21 cp -a $src/nagisk.pl $fs/usr/share/nagios/libexec |
Hans-G?nter@21515 | 22 sed -i 's/^elsif/} &/' $fs/usr/share/nagios/libexec/nagisk.pl |
pascal@16740 | 23 } |
pascal@16740 | 24 |
pascal@16740 | 25 # Pre and post install commands for Tazpkg. |
pascal@16740 | 26 post_install() |
pascal@16740 | 27 { |
pascal@18730 | 28 grep -qs check_asterisk_version "$1/etc/nagios/nrpe.cfg" || |
pascal@18730 | 29 cat >> "$1/etc/nagios/nrpe.cfg" <<EOT |
pascal@16740 | 30 command[check_asterisk_version]=/usr/share/nagios/libexec/nagisk.pl -c version |
pascal@16740 | 31 command[check_asterisk_peers]=/usr/share/nagios/libexec/nagisk.pl -c peers -w \$ARG1\$ -x \$ARG2\$ |
pascal@16740 | 32 command[check_asterisk_peer]=/usr/share/nagios/libexec/nagisk.pl -c peer -p \$ARG1\$ -w \$ARG2\$ -x \$ARG3\$ |
pascal@16740 | 33 command[check_asterisk_channels]=/usr/share/nagios/libexec/nagisk.pl -c channels -w \$ARG1\$ -x \$ARG2\$ |
pascal@16740 | 34 command[check_asterisk_konference]=/usr/share/nagios/libexec/nagisk.pl -c konference -w \$ARG1\$ -x \$ARG2\$ |
pascal@16740 | 35 command[check_asterisk_jabber]=/usr/share/nagios/libexec/nagisk.pl -c jabber -b \$ARG1\$ |
pascal@16740 | 36 #command[check_asterisk_zaptel]=/usr/share/nagios/libexec/nagisk.pl -c zaptel |
pascal@16740 | 37 #command[check_asterisk_span]=/usr/share/nagios/libexec/nagisk.pl -c span -s \$ARG1\$ |
pascal@16740 | 38 #command[check_asterisk_dahdi]=/usr/share/nagios/libexec/nagisk.pl -c dahdi |
pascal@16740 | 39 #command[check_asterisk_dahdi_span]=/usr/share/nagios/libexec/nagisk.pl -c dahdi_span -s \$ARG1\$ |
pascal@16740 | 40 #command[check_asterisk_pri_span]=/usr/share/nagios/libexec/nagisk.pl -c pri_span -s \$ARG1\$ |
pascal@16740 | 41 #command[check_asterisk_pri_spans]=/usr/share/nagios/libexec/nagisk.pl -c pri_spans |
pascal@16740 | 42 command[check_asterisk_registry]=/usr/share/nagios/libexec/nagisk.pl -c registry |
pascal@16740 | 43 EOT |
pascal@18730 | 44 grep '^nagios ALL=NOPASSWD' "$1/etc/sudoers" | grep -q asterisk || |
pascal@18730 | 45 cat >> "$1/etc/sudoers" <<EOT |
pascal@17694 | 46 nagios ALL=NOPASSWD: /usr/sbin/asterisk |
pascal@16740 | 47 EOT |
pascal@18730 | 48 chroot "$1/" chown nagios:nagios /usr/share/nagios/libexec/nagisk.pl |
pascal@16740 | 49 } |