1 Summary: Nagios Notify Script
2 Summary(pl.UTF-8): Skrypt powiadamiający dla Nagiosa
8 Source0: %{name}-%{version}.tar.bz2
9 # Source0-md5: 47c06d14e2944f222fe08298a62ef607
11 Patch1: duration.patch
12 URL: http://glen.alkohol.ee/nagios-notify/
14 Requires: nagios-common
16 Suggests: /usr/lib/sendmail
18 Suggests: nagios-alert-jabber
19 # notify to eggdrop bot (irc)
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 %define _sysconfdir /etc/nagios
25 %define _sbindir /usr/lib/nagios
28 nagios-notify is template based notify script for Nagios.
30 You should use this script because:
31 - the templates are easily edited in text editor
32 - you won't be worried about if the command definition contains shell
33 syntax errors (which Nagios happily discards without any trace in logs
35 - you can change templates without restarting Nagios
36 - with advanced templates you can send richtext (even images!) over
37 jabber if you use nagios-notify-jabber
38 - minimal dependency (just coreutils and awk that you most likely
39 already have installed)
41 %description -l pl.UTF-8
42 nagios-notify to oparty na szablonach skrypt powiadamiający dla
45 Powody, dla których dobrze jest używać tego skryptu:
46 - szablony można łatwo modyfikować w edytorze tekstu,
47 - nie trzeba się zbytnio martwić jeśli definicje poleceń zawierają
48 błędy składni powłoki (które Nagios ucina bez żadnego śladu w logach)
49 - można zmieniać szablony bez restartu Nagiosa
50 - przy użyciu zaawansowanych szablonów można wysyłać tekst wzbogacony
51 (nawet z obrazkami) przez jabbera w przypadku używania pakietu
53 - minimalne zależności (tylko coreutils i awk, które zwykle i tak są
62 rm -rf $RPM_BUILD_ROOT
65 DESTDIR=$RPM_BUILD_ROOT
68 rm -rf $RPM_BUILD_ROOT
70 %triggerpostun -- %{name} < 0.10
71 %{__sed} -i -e 's,/usr/sbin/%{name},%{_sbindir}/%{name},' %{_sysconfdir}/plugins/%{name}.cfg
72 if [ -f /etc/rc.d/init.d/nagios ]; then
73 %service -q nagios reload
76 %triggerpostun -- %{name} < 0.12-0.7
77 # recover renamed configs
78 for a in %{_sysconfdir}/templates/*.rpmsave; do
81 [ -f $f ] && cp -f $f{,.rpmnew}
84 # copy from new files if originals weren't modified but removed by upgrade
85 for a in eggdrop jabber sms; do
86 o=%{_sysconfdir}/templates/host-notify-by-$a.tmpl
87 f=%{_sysconfdir}/templates/notify-host-by-$a.tmpl
92 for a in eggdrop email jabber-embedimage jabber-richtext jabber sms; do
93 o=%{_sysconfdir}/templates/notify-by-$a.tmpl
94 f=%{_sysconfdir}/templates/notify-service-by-$a.tmpl
99 %banner -e %{name}-0.12 <<'EOF'
100 Templates have been renamed to follow Nagios 3.0 naming.
102 They have been recovered by rpm trigger, but if you want to use new style
103 naming these commands might help you out quickly:
105 # grep -r host-notify-by- /etc/nagios -l | xargs sed -i -e 's,host-notify-by-,notify-host-by-,g'
106 # grep -r notify-by- /etc/nagios -l | xargs sed -i -e 's,notify-by-,notify-service-by-,g'
111 %defattr(644,root,root,755)
113 %dir %{_sysconfdir}/templates
114 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/templates/*
115 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plugins/%{name}.cfg
116 %attr(755,root,root) %{_sbindir}/nagios-notify