]> git.pld-linux.org Git - packages/nagios-nrpe.git/blob - nagios-nrpe.spec
- nrpe is enough to run the plugins, nagios itself is not required
[packages/nagios-nrpe.git] / nagios-nrpe.spec
1 %define         nsusr           nagios
2 %define         nsgrp           nagios
3 Summary:        Nagios remote plugin execution service/plugin
4 Summary(pl):    Demon i wtyczka zdalnego wywo³ywania wtyczek Nagios
5 Name:           nagios-nrpe
6 Version:        2.0
7 Release:        2
8 License:        GPL v2
9 Group:          Networking
10 Source0:        http://dl.sourceforge.net/nagios/nrpe-%{version}.tar.gz
11 # Source0-md5:  70ef9502a3b7e49fa520dbceabfa04d0
12 Source1:        nrpe.init
13 URL:            http://www.nagios.org/
14 BuildRequires:  autoconf
15 BuildRequires:  automake
16 BuildRequires:  rpmbuild(macros) >= 1.159
17 BuildRequires:  openssl-tools
18 Requires(pre):  /usr/bin/getgid
19 Requires(pre):  /bin/id
20 Requires(pre):  /usr/sbin/groupadd
21 Requires(pre):  /usr/sbin/useradd
22 Requires(post,postun):  /sbin/chkconfig
23 Requires:       nagios-plugins
24 Provides:       group(%{nsgrp})
25 Provides:       user(%{nsusr})
26 Provides:       nagios-core
27 Obsoletes:      netsaint-nrpe
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %define         _sysconfdir     /etc/nagios
31 %define         _datadir        %{_prefix}/share/%{name}
32 %define         _plugindir      %{_libdir}/nagios/plugins
33 %define         _localstatedir  %{_var}/log/nagios
34 %define         nsport          5666
35
36 %description
37 Nagios nrpe allows you to remotely execute plugins on other hosts
38 and report the plugin output back to the monitoring host.
39
40 %description -l pl
41 Nagios npre pozwala zdalnie uruchamiaæ wtyczki na innych hostach,
42 a wynik ich dzia³ania zwracaæ z powrotem do hosta monitoruj±cego.
43
44 %package plugin
45 Summary:        check_nrpe plugin for Nagios
46 Summary(pl):    Wtyczka check_nrpe dla Nagiosa
47 Group:          Networking
48
49 %description plugin
50 check_nrpe plugin for Nagios. This plugin allows running plugins on
51 remote machines using nrpe service.
52
53 %description plugin -l pl
54 Wtyczka check_nrpe dla Nagiosa. Pozwala na zdalne uruchamianie
55 wtyczek na innych komputerach za pomoc± demona nrpe.
56
57 %prep
58 %setup -q -n nrpe-%{version}
59
60 %build
61 %{__aclocal}
62 %{__autoconf}
63
64 %configure \
65         --with-init-dir=/etc/rc.d/init.d \
66         --with-nrpe-port=%{nsport} \
67         --with-nrpe-user=%{nsusr} \
68         --with-nrpe-grp=%{nsgrp} \
69         --prefix=%{_prefix} \
70         --exec-prefix=%{_sbindir} \
71         --bindir=%{_sbindir} \
72         --libexecdir=%{_plugindir} \
73         --datadir=%{_prefix}/share/nagios \
74         --sysconfdir=%{_sysconfdir} \
75         --localstatedir=%{_localstatedir} 
76
77 %{__make} all
78
79 %install
80 rm -rf $RPM_BUILD_ROOT
81 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir},%{_libdir}/nagios/plugins,%{_sbindir}} \
82         $RPM_BUILD_ROOT%{_localstatedir}
83
84 install nrpe.cfg $RPM_BUILD_ROOT/etc/nagios/nrpe.cfg
85 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/nrpe
86 install src/nrpe $RPM_BUILD_ROOT%{_sbindir}
87 install src/check_nrpe $RPM_BUILD_ROOT%{_plugindir}
88
89 %clean
90 rm -rf $RPM_BUILD_ROOT
91
92 %pre
93 if [ -n "`getgid %{nsgrp}`" ]; then
94         if [ "`getgid %{nsgrp}`" != "72" ]; then
95                 echo "Error: group %{nsgrp} doesn't have gid=72. Correct this before installing %{name}." 1>&2
96                 exit 1
97         fi
98 else
99         if [ -n "`getgid netsaint`" -a "`getgid netsaint`" = "72" ]; then
100                 /usr/sbin/groupmod -n %{nsgrp} netsaint
101         else
102                 /usr/sbin/groupadd -g 72 -f %{nsgrp}
103         fi
104 fi
105 if [ -n "`id -u %{nsusr} 2>/dev/null`" ]; then
106         if [ "`id -u %{nsusr}`" != "72" ]; then
107                 echo "Error: user %{nsusr} doesn't have uid=72. Correct this before installing %{name}." 1>&2
108                 exit 1
109         fi
110 else
111         if [ -n "`id -u netsaint 2>/dev/null`" -a "`id -u netsaint`" = "72" ]; then
112                 /usr/sbin/usermod -d /tmp -l %{nsusr} netsaint
113         else
114                 /usr/sbin/useradd -u 72 -d %{_libdir}/%{nsusr} -s /bin/false -c "%{name} User" -g %{nsgrp} %{nsusr} 1>&2
115         fi
116 fi
117
118 %post
119 /sbin/chkconfig --add nrpe
120 if [ -f /var/lock/subsys/nrpe ]; then
121         /etc/rc.d/init.d/nrpe restart 1>&2
122 fi
123
124 %preun
125 if [ "$1" = "0" ] ; then
126         if [ -f /var/lock/subsys/nrpe ]; then
127                 /etc/rc.d/init.d/nrpe stop 1>&2
128         fi
129         /sbin/chkconfig --del nrpe
130 fi
131
132 %postun
133 if [ "$1" = "0" ]; then
134         %userremove %{nsusr}
135         %groupremove %{nsgrp}
136 fi
137
138 %files
139 %defattr(644,root,root,755)
140 %doc Changelog LEGAL README* SECURITY
141 %attr(754,root,root) /etc/rc.d/init.d/nrpe
142 %attr(751,root,%{nsgrp}) %dir %{_sysconfdir}
143 %attr(644,root,%{nsgrp}) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/nrpe.cfg
144 %attr(755,root,root) %{_sbindir}/nrpe
145 %dir %{_libdir}/nagios
146
147 %files plugin
148 %defattr(644,root,root,755)
149 %dir %{_plugindir}
150 %attr(755,root,root) %{_plugindir}/*
This page took 0.078204 seconds and 4 git commands to generate.