]> git.pld-linux.org Git - packages/nagios-notify.git/blame - nagios-notify.spec
rel 4; more information about service/host downtime
[packages/nagios-notify.git] / nagios-notify.spec
CommitLineData
cb1ceb33 1Summary: Nagios Notify Script
3bcfd30f 2Summary(pl.UTF-8): Skrypt powiadamiający dla Nagiosa
cb1ceb33 3Name: nagios-notify
c0301ee3 4Version: 0.14
c4f82a35 5Release: 4
cb1ceb33
ER
6License: GPL v2
7Group: Applications
39dd881a 8Source0: %{name}-%{version}.tar.bz2
c0301ee3 9# Source0-md5: 47c06d14e2944f222fe08298a62ef607
c6f91e86 10Patch0: headers.patch
f84f47ad 11Patch1: duration.patch
4933d6f6 12URL: http://glen.alkohol.ee/nagios-notify/
39dd881a
ER
13Requires: awk
14Requires: nagios-common
e6936a97
ER
15# notify via emails
16Suggests: /usr/lib/sendmail
850dbcf6
ER
17# notify via jabber
18Suggests: nagios-alert-jabber
19# notify to eggdrop bot (irc)
20Suggests: t0xirc
71436ab4 21BuildArch: noarch
cb1ceb33
ER
22BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
ed2c1ad4 24%define _sysconfdir /etc/nagios
09ceb5bf 25%define _sbindir /usr/lib/nagios
cb1ceb33
ER
26
27%description
28nagios-notify is template based notify script for Nagios.
29
f4a3b599
ER
30You should use this script because:
31- the templates are easily edited in text editor
0fa8160d 32- you won't be worried about if the command definition contains shell
e6936a97
ER
33 syntax errors (which Nagios happily discards without any trace in logs
34 :/)
f4a3b599
ER
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
8c22d59d 38- minimal dependency (just coreutils and awk that you most likely
f4a3b599
ER
39 already have installed)
40
25d3d64f
JR
41%description -l pl.UTF-8
42nagios-notify to oparty na szablonach skrypt powiadamiający dla
95e5a2ae
JB
43Nagiosa.
44
0fa8160d
JB
45Powody, 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ą
e6936a97 48 błędy składni powłoki (które Nagios ucina bez żadnego śladu w logach)
0fa8160d 49- można zmieniać szablony bez restartu Nagiosa
e6936a97
ER
50- przy użyciu zaawansowanych szablonów można wysyłać tekst wzbogacony
51 (nawet z obrazkami) przez jabbera w przypadku używania pakietu
52 nagios-notify-jabber
53- minimalne zależności (tylko coreutils i awk, które zwykle i tak są
54 zainstalowane)
0fa8160d 55
cb1ceb33 56%prep
39dd881a 57%setup -q
c6f91e86 58%patch0 -p1
f84f47ad 59%patch1 -p1
cb1ceb33
ER
60
61%install
62rm -rf $RPM_BUILD_ROOT
95e5a2ae 63
39dd881a
ER
64%{__make} install \
65 DESTDIR=$RPM_BUILD_ROOT
cb1ceb33
ER
66
67%clean
68rm -rf $RPM_BUILD_ROOT
69
09ceb5bf 70%triggerpostun -- %{name} < 0.10
59e84365 71%{__sed} -i -e 's,/usr/sbin/%{name},%{_sbindir}/%{name},' %{_sysconfdir}/plugins/%{name}.cfg
e5fc242a
ER
72if [ -f /etc/rc.d/init.d/nagios ]; then
73 %service -q nagios reload
74fi
09ceb5bf 75
b8ffe2bd
ER
76%triggerpostun -- %{name} < 0.12-0.7
77# recover renamed configs
78for a in %{_sysconfdir}/templates/*.rpmsave; do
79 [ -f $a ] || continue
80 f=${a%%.rpmsave}
81 [ -f $f ] && cp -f $f{,.rpmnew}
82 mv -f $f{.rpmsave,}
83done
84# copy from new files if originals weren't modified but removed by upgrade
85for a in eggdrop jabber sms; do
86 o=%{_sysconfdir}/templates/host-notify-by-$a.tmpl
87 f=%{_sysconfdir}/templates/notify-host-by-$a.tmpl
88 if [ ! -f $o ]; then
89 cp -a $f $o
90 fi
91done
92for 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
95 if [ ! -f $o ]; then
96 cp -a $f $o
97 fi
98done
7c82f458
ER
99%banner -e %{name}-0.12 <<'EOF'
100Templates have been renamed to follow Nagios 3.0 naming.
101
102They have been recovered by rpm trigger, but if you want to use new style
103naming these commands might help you out quickly:
104
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'
107
108EOF
b8ffe2bd 109
cb1ceb33
ER
110%files
111%defattr(644,root,root,755)
eb8330a0 112%doc ChangeLog
b014ae4e 113%dir %{_sysconfdir}/templates
ed2c1ad4 114%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/templates/*
09ceb5bf 115%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plugins/%{name}.cfg
cb1ceb33 116%attr(755,root,root) %{_sbindir}/nagios-notify
This page took 0.084058 seconds and 4 git commands to generate.