wok annotate nagisk/receipt @ rev 24984
Up ufr2 (2.40-2)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue May 10 07:46:30 2022 +0000 (2022-05-10) |
parents | b569b85b0fb9 |
children |
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" |
pascal@24308 | 9 WEB_SITE="https://github.com/nicolargo/nagisk" |
Hans-G?nter@21515 | 10 |
pascal@16740 | 11 TARBALL="$PACKAGE-$VERSION.tar.gz" |
pascal@24975 | 12 WGET_URL="$WEB_SITE/archive/refs/tags/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@24308 | 17 # What is the latest version available today? |
pascal@24308 | 18 current_version() |
pascal@24308 | 19 { |
pascal@24308 | 20 wget -O - $WEB_SITE/tags 2>/dev/null | \ |
pascal@24308 | 21 sed '/archive.*tar/!d;s|.*/[A-Za-z_-]*\(.*\).tar.*|\1|;q' |
pascal@24308 | 22 } |
pascal@24308 | 23 |
pascal@16740 | 24 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@16740 | 25 genpkg_rules() |
pascal@16740 | 26 { |
pascal@16740 | 27 mkdir -p $fs/usr/share/nagios/libexec |
Hans-G?nter@21515 | 28 cp -a $src/nagisk.pl $fs/usr/share/nagios/libexec |
Hans-G?nter@21515 | 29 sed -i 's/^elsif/} &/' $fs/usr/share/nagios/libexec/nagisk.pl |
pascal@16740 | 30 } |
pascal@16740 | 31 |
pascal@16740 | 32 # Pre and post install commands for Tazpkg. |
pascal@16740 | 33 post_install() |
pascal@16740 | 34 { |
pascal@18730 | 35 grep -qs check_asterisk_version "$1/etc/nagios/nrpe.cfg" || |
pascal@18730 | 36 cat >> "$1/etc/nagios/nrpe.cfg" <<EOT |
pascal@16740 | 37 command[check_asterisk_version]=/usr/share/nagios/libexec/nagisk.pl -c version |
pascal@16740 | 38 command[check_asterisk_peers]=/usr/share/nagios/libexec/nagisk.pl -c peers -w \$ARG1\$ -x \$ARG2\$ |
pascal@16740 | 39 command[check_asterisk_peer]=/usr/share/nagios/libexec/nagisk.pl -c peer -p \$ARG1\$ -w \$ARG2\$ -x \$ARG3\$ |
pascal@16740 | 40 command[check_asterisk_channels]=/usr/share/nagios/libexec/nagisk.pl -c channels -w \$ARG1\$ -x \$ARG2\$ |
pascal@16740 | 41 command[check_asterisk_konference]=/usr/share/nagios/libexec/nagisk.pl -c konference -w \$ARG1\$ -x \$ARG2\$ |
pascal@16740 | 42 command[check_asterisk_jabber]=/usr/share/nagios/libexec/nagisk.pl -c jabber -b \$ARG1\$ |
pascal@16740 | 43 #command[check_asterisk_zaptel]=/usr/share/nagios/libexec/nagisk.pl -c zaptel |
pascal@16740 | 44 #command[check_asterisk_span]=/usr/share/nagios/libexec/nagisk.pl -c span -s \$ARG1\$ |
pascal@16740 | 45 #command[check_asterisk_dahdi]=/usr/share/nagios/libexec/nagisk.pl -c dahdi |
pascal@16740 | 46 #command[check_asterisk_dahdi_span]=/usr/share/nagios/libexec/nagisk.pl -c dahdi_span -s \$ARG1\$ |
pascal@16740 | 47 #command[check_asterisk_pri_span]=/usr/share/nagios/libexec/nagisk.pl -c pri_span -s \$ARG1\$ |
pascal@16740 | 48 #command[check_asterisk_pri_spans]=/usr/share/nagios/libexec/nagisk.pl -c pri_spans |
pascal@16740 | 49 command[check_asterisk_registry]=/usr/share/nagios/libexec/nagisk.pl -c registry |
pascal@16740 | 50 EOT |
pascal@18730 | 51 grep '^nagios ALL=NOPASSWD' "$1/etc/sudoers" | grep -q asterisk || |
pascal@18730 | 52 cat >> "$1/etc/sudoers" <<EOT |
pascal@17694 | 53 nagios ALL=NOPASSWD: /usr/sbin/asterisk |
pascal@16740 | 54 EOT |
pascal@18730 | 55 chroot "$1/" chown nagios:nagios /usr/share/nagios/libexec/nagisk.pl |
pascal@16740 | 56 } |