]>
Commit | Line | Data |
---|---|---|
cb1ceb33 | 1 | Summary: Nagios Notify Script |
3bcfd30f | 2 | Summary(pl.UTF-8): Skrypt powiadamiający dla Nagiosa |
cb1ceb33 | 3 | Name: nagios-notify |
c0301ee3 | 4 | Version: 0.14 |
c4f82a35 | 5 | Release: 4 |
cb1ceb33 ER |
6 | License: GPL v2 |
7 | Group: Applications | |
39dd881a | 8 | Source0: %{name}-%{version}.tar.bz2 |
c0301ee3 | 9 | # Source0-md5: 47c06d14e2944f222fe08298a62ef607 |
c6f91e86 | 10 | Patch0: headers.patch |
f84f47ad | 11 | Patch1: duration.patch |
4933d6f6 | 12 | URL: http://glen.alkohol.ee/nagios-notify/ |
39dd881a ER |
13 | Requires: awk |
14 | Requires: nagios-common | |
e6936a97 ER |
15 | # notify via emails |
16 | Suggests: /usr/lib/sendmail | |
850dbcf6 ER |
17 | # notify via jabber |
18 | Suggests: nagios-alert-jabber | |
19 | # notify to eggdrop bot (irc) | |
20 | Suggests: t0xirc | |
71436ab4 | 21 | BuildArch: noarch |
cb1ceb33 ER |
22 | BuildRoot: %{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 | |
28 | nagios-notify is template based notify script for Nagios. | |
29 | ||
f4a3b599 ER |
30 | You 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 |
42 | nagios-notify to oparty na szablonach skrypt powiadamiający dla | |
95e5a2ae JB |
43 | Nagiosa. |
44 | ||
0fa8160d JB |
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ą | |
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 | |
62 | rm -rf $RPM_BUILD_ROOT | |
95e5a2ae | 63 | |
39dd881a ER |
64 | %{__make} install \ |
65 | DESTDIR=$RPM_BUILD_ROOT | |
cb1ceb33 ER |
66 | |
67 | %clean | |
68 | rm -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 |
72 | if [ -f /etc/rc.d/init.d/nagios ]; then |
73 | %service -q nagios reload | |
74 | fi | |
09ceb5bf | 75 | |
b8ffe2bd ER |
76 | %triggerpostun -- %{name} < 0.12-0.7 |
77 | # recover renamed configs | |
78 | for 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,} | |
83 | done | |
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 | |
88 | if [ ! -f $o ]; then | |
89 | cp -a $f $o | |
90 | fi | |
91 | done | |
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 | |
95 | if [ ! -f $o ]; then | |
96 | cp -a $f $o | |
97 | fi | |
98 | done | |
7c82f458 ER |
99 | %banner -e %{name}-0.12 <<'EOF' |
100 | Templates have been renamed to follow Nagios 3.0 naming. | |
101 | ||
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: | |
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 | ||
108 | EOF | |
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 |