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