forked from gluster-rhsc/nagios-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgluster-nrpe-plugin.spec
executable file
·74 lines (63 loc) · 2.09 KB
/
gluster-nrpe-plugin.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#===============================================================================
# Copyright 2014 Red Hat
# Name: gluster-nrpe-plugin.spec
#-------------------------------------------------------------------------------
# Purpose: RPM Spec file for installing gluster nrpe plugins
# Version 1.00:13 Feb 2014 Created.
#===============================================================================
# No debuginfo:
%define __spec_install_post %{nil}
%define debug_package %{nil}
%define __os_install_post %{_dbpath}/brp-compress
#%%define _topdir /home/mbarto/rpm
#%%define _tmppath %{_topdir}/tmp
%define name gluster-nrpe
%define summary gluster-nrpe plugins for nodes
%define version 1.1
%define release 1
%define license GPLv2+
%define group Applications/System
%define source %{name}-%{version}.tar.gz
%define url http://www.redhat.com
%define buildroot %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Name: %{name}
Summary: %{summary}
Version: %{version}
Release: %{release}
License: %{license}
Group: %{group}
Source0: %{source}
BuildArch: noarch
Requires: filesystem, bash, grep
Provides: %{name}
URL: %{url}
Buildroot: %{buildroot}
%description
Gluster nrpe plugins script for monitoring disk, network, cup and memory
details and configure nrpe to work with nagios server.
%prep
%setup -q
%build
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
cp -a * /usr/lib64/nagios/plugins/
%clean
rm -rf %{buildroot}
%post
if [ $1 == 1 ]; then
cat >> /etc/nagios/nrpe.cfg <<EOF
"EOF"
### gluster nrpe plugins ###
command[check_disk_gluster]=/usr/bin/python /usr/lib64/nagios/plugins/check_disk_gluster -w 20 -c 10
command[check_memory_gluster]=/usr/bin/python /usr/lib64/nagios/plugins/check_memory_gluster -w 20 -c 10
command[check_cpu_gluster]=/usr/bin/python /usr/lib64/nagios/plugins/check_cpu_gluster -w 20 -c 10
command[check_network_gluster]=/usr/bin/python /usr/lib64/nagios/plugins/check_network_gluster -w 20 -c 10
EOF
fi
EOF
%files
%defattr(-, root, root, -)
%changelog
* Thu Feb 13 2014 Timothy Asir Jeyasing
- Initial release