<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://t2bwiki.iihe.ac.be/index.php?action=history&amp;feed=atom&amp;title=NagiosPlugins</id>
	<title>NagiosPlugins - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://t2bwiki.iihe.ac.be/index.php?action=history&amp;feed=atom&amp;title=NagiosPlugins"/>
	<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/index.php?title=NagiosPlugins&amp;action=history"/>
	<updated>2026-05-16T10:57:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://t2bwiki.iihe.ac.be/index.php?title=NagiosPlugins&amp;diff=189&amp;oldid=prev</id>
		<title>Maintenance script: Created page with &quot; == HOWTO pack the nagios plugins into an RPM == PageOutline   === Building the RPM ===  *The plugins are gathered in an RPM for easy distribution over all nagios mo...&quot;</title>
		<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/index.php?title=NagiosPlugins&amp;diff=189&amp;oldid=prev"/>
		<updated>2015-08-26T12:28:50Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; == HOWTO pack the nagios plugins into an RPM == &lt;a href=&quot;/index.php?title=PageOutline&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;PageOutline (page does not exist)&quot;&gt;PageOutline&lt;/a&gt;   === Building the RPM ===  *The plugins are gathered in an RPM for easy distribution over all nagios mo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== HOWTO pack the nagios plugins into an RPM ==&lt;br /&gt;
[[PageOutline]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Building the RPM ===&lt;br /&gt;
&lt;br /&gt;
*The plugins are gathered in an RPM for easy distribution over all nagios monitored hosts. &lt;br /&gt;
*The RPM is build on egon. &lt;br /&gt;
&lt;br /&gt;
*A script can create the rpm&lt;br /&gt;
**Execute as follows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /root/nagiosPlugins/&lt;br /&gt;
version=1.10&lt;br /&gt;
./makeRPM.sh $version&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
**It will make $version rpm of the directory nagios-plugins-dedicated&lt;br /&gt;
**therefore, all the executables you need to distribute, also need to be place into /root/nagiosPlugins/nagios-plugins-dedicated&lt;br /&gt;
**all will be distributed to /usr/lib64/nagios/plugins/&lt;br /&gt;
**Copy the file to ccq3, via ccq:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scp /root/rpmbuild/RPMS/noarch/nagios-plugins-dedicated-$version-1.noarch.rpm ccq:/root/Joris&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Here are the commands to be executed to make the rpm w/o the script&lt;br /&gt;
**First a tar ball is made containing all the scripts&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /root/nagiosPlugins&lt;br /&gt;
tar -cjf nagios-plugins-dedicated-A.B.tar.gz nagios-plugins-dedicated-A.B/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
**The building of the RPM happens as follows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /root/rpmbuild&lt;br /&gt;
cp ../nagiosPlugins/nagios-plugins-dedicated-A.B.tar.gz SOURCES/&lt;br /&gt;
rpmbuild -ba SPECS/nagios-plugins-dedicated.spec &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
**&amp;#039;&amp;#039;&amp;#039;IMPORTANT:&amp;#039;&amp;#039;&amp;#039; don&amp;#039;t forget to adapt the spec file to rpm-ize the correct version A.B&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Uploading the RPM to the BEgrid repo ===&lt;br /&gt;
&lt;br /&gt;
*As a final step you have to upload the rpm to the begrid repo like [[GridAdminSurvivalGuide#AddsomeRPMstotheBEgridrepositorywithswrep| this]]&lt;br /&gt;
**the directory for uploading on ccq3:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/opt/CB5/tmp/src/begrid/cb-client/cb-client-swrep/rpm-nagios&lt;br /&gt;
scp ccq:/root/Joris/nagios-plugins-dedicated-A.B-1.noarch.rpm .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
**The command executed to upload to the repo:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./swrep.py --debug --mode=up --plat x86_64_sl5_5X,/sl5/sl54/updates --dir=/opt/CB5/tmp/src/begrid/cb-client/cb-client-swrep/rpm-nagios/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Don&amp;#039;t forget to add the correct line to the repo template file and include somewhere this rpm so that it gets installed on the machine&lt;br /&gt;
&lt;br /&gt;
=== Links to info and tutorials ===&lt;br /&gt;
&lt;br /&gt;
*Following links contain some information on how to build your own RPM files:&lt;br /&gt;
**http://fedoraproject.org/wiki/How_to_create_an_RPM_package&lt;br /&gt;
**http://tldp.org/HOWTO/RPM-HOWTO/build.html &lt;br /&gt;
**http://www.rpm.org/max-rpm/s1-rpm-build-creating-spec-file.html&lt;br /&gt;
**http://narrabilis.com/mybook/appendices/packages&lt;br /&gt;
**http://stackoverflow.com/questions/1879734/rpm-build-error or http://spot.fedorapeople.org/Summit2008/2008-RPM-Spec-examples.pdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Tutorial to build an rpm ===&lt;br /&gt;
&lt;br /&gt;
*The aim of this section is to provide a minimal working example to build your own RPM&lt;br /&gt;
*It is a mixture of the tutorials listed in the links section. Please have a closer look there on the meaning of the section (with a %) in the file as well on the directory structure of the rpm package.&lt;br /&gt;
*For this example I have put the directory tree in a specific directory and added a line in .rpmmacros to point to it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/root/rpmbuild/&lt;br /&gt;
cat ~/.rpmmacros &lt;br /&gt;
%_topdir /root/rpmbuild/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*It should be noted that RPMs should not be built with root privileges.&lt;br /&gt;
&lt;br /&gt;
*Example spec file located in the SPEC directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Summary: a test for helloworld&lt;br /&gt;
Name: testhello&lt;br /&gt;
License: GPL&lt;br /&gt;
Version: 1.1&lt;br /&gt;
Source: test.tar.gz&lt;br /&gt;
Release: 1&lt;br /&gt;
Group: Applications&lt;br /&gt;
#BuildRoot: /tmp/rpm-buildroot-%{name}-%{version}&lt;br /&gt;
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root&lt;br /&gt;
BuildArch: noarch&amp;quot;&lt;br /&gt;
&lt;br /&gt;
%description&lt;br /&gt;
This is a description for the testhello&lt;br /&gt;
&lt;br /&gt;
%prep&lt;br /&gt;
echo &amp;quot;1.&amp;quot; $PWD&lt;br /&gt;
ls -l&lt;br /&gt;
&lt;br /&gt;
%setup&lt;br /&gt;
echo &amp;quot;2.&amp;quot; $PWD&lt;br /&gt;
ls -l&lt;br /&gt;
&lt;br /&gt;
%build&lt;br /&gt;
echo &amp;quot;3.&amp;quot; $PWD&lt;br /&gt;
ls -l&lt;br /&gt;
gcc -o test test.c&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;rm -rf %{buildroot}&amp;quot;&lt;br /&gt;
rm -rf %{buildroot}&lt;br /&gt;
echo &amp;quot;mkdir -p %{buildroot}%{_bindir}&amp;quot;&lt;br /&gt;
mkdir -p %{buildroot}%{_bindir}&lt;br /&gt;
echo &amp;quot;cp test.c %{buildroot}%{_bindir}/test.c&amp;quot;&lt;br /&gt;
cp test.c %{buildroot}%{_bindir}/test.c&lt;br /&gt;
&lt;br /&gt;
%clean&lt;br /&gt;
rm -rf %{buildroot}&lt;br /&gt;
&lt;br /&gt;
##or alternatively &lt;br /&gt;
##make test&lt;br /&gt;
&lt;br /&gt;
#echo &amp;quot;%{buildroot}&amp;quot;&lt;br /&gt;
#ls -l /var/tmp&lt;br /&gt;
#ls -l %{buildroot}&lt;br /&gt;
#echo %{_bindir}&lt;br /&gt;
&lt;br /&gt;
%files&lt;br /&gt;
%defattr(-,root,root,-)&lt;br /&gt;
%{_bindir}/test.c&lt;br /&gt;
&lt;br /&gt;
%changelog&lt;br /&gt;
&lt;br /&gt;
*Thu Apr 7 2011 Joris Maes &amp;lt;jmmaes@cern.ch&amp;gt; 1.1-1&lt;br /&gt;
- initial package for testing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Be careful to create a tar ball with a top directory. I.e. the test.c is put in a directory called testhello-1.1 which then tarred &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar cvf test.tar.gz testhello-1.1/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*To finally build the rpm execute the following line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpmbuild -ba  testhello.spec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TracNotice|{{PAGENAME}}}}&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>