]>
Commit | Line | Data |
---|---|---|
1aa82fb7 ER |
1 | %define plugin check_scan |
2 | Summary: A nmap scanner plugin for Nagios | |
3 | Name: nagios-plugin-%{plugin} | |
ddb074f7 ER |
4 | Version: 20051011 |
5 | Release: 1 | |
1aa82fb7 ER |
6 | License: GPL v2+ |
7 | Group: Networking | |
8 | Source0: http://www.altsec.info/check_scan.sh | |
9 | # Source0-md5: 8e79becb95012c2aedf0b9c68373f928 | |
b0bc1bec | 10 | Source1: %{plugin}.cfg |
f870cc69 | 11 | Patch0: pld.patch |
1aa82fb7 | 12 | URL: http://www.altsec.info/check_scan.html |
f870cc69 | 13 | Requires: coreutils |
1aa82fb7 | 14 | Requires: grep |
f870cc69 | 15 | Requires: nagios-common |
1aa82fb7 | 16 | Requires: nmap |
1aa82fb7 ER |
17 | BuildArch: noarch |
18 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
19 | ||
20 | %define _sysconfdir /etc/nagios/plugins | |
21 | %define nrpeddir /etc/nagios/nrpe.d | |
22 | %define plugindir %{_prefix}/lib/nagios/plugins | |
f870cc69 | 23 | %define statedir /var/lib/nagios/check_scan |
1aa82fb7 ER |
24 | |
25 | %description | |
26 | A nmap scanner plugin for Nagios | |
27 | ||
28 | Here's what it does: | |
29 | - On the initial scan, it creates a baseline scan for future | |
30 | comparison. | |
31 | - On each subsequent check, it compares the new scan against the | |
32 | baseline. | |
33 | - Changes are reported in "warning" status, showing the open port. | |
34 | ||
35 | check_scan.sh does a "TCP connect scan", so it doesn't have to run as | |
36 | root. | |
37 | ||
38 | %prep | |
39 | %setup -qcT | |
40 | cp -p %{SOURCE0} %{plugin} | |
f870cc69 | 41 | %patch0 -p1 |
1aa82fb7 ER |
42 | |
43 | %install | |
44 | rm -rf $RPM_BUILD_ROOT | |
2df0d49f | 45 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{plugindir},%{statedir}/{files,scans}} |
1aa82fb7 | 46 | install -p %{plugin} $RPM_BUILD_ROOT%{plugindir}/%{plugin} |
b0bc1bec | 47 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg |
1aa82fb7 ER |
48 | |
49 | %clean | |
50 | rm -rf $RPM_BUILD_ROOT | |
51 | ||
52 | %files | |
53 | %defattr(644,root,root,755) | |
b0bc1bec | 54 | %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg |
1aa82fb7 | 55 | %attr(755,root,root) %{plugindir}/%{plugin} |
2df0d49f ER |
56 | %dir %attr(750,root,nagios) %{statedir} |
57 | %dir %attr(770,root,nagios) %{statedir}/files | |
58 | %dir %attr(770,root,nagios) %{statedir}/scans |