Permalink
Browse files

Initial release build script and vagrant project

  • Loading branch information...
arioch
arioch committed Mar 23, 2012
1 parent dc4deef commit a4daf994d99224e84441e68a4847339f7b7e205a
View
@@ -0,0 +1,5 @@
+*.deb
+*.rpm
+packages/*/*/*.deb
+packages/*/*/*.rpm
+vagrant/.vagrant
View
@@ -1,17 +1,51 @@
-This is a selection of plugins we use for both Nagios and Icinga.
+### Nagios-plugins
+
+This is a selection of plugins for both Nagios and Icinga.
Packages for RHEL/CentOS and Debian/Ubuntu will be built in a CI fashion in the near future.
+A script to build the packages yourself has been included.
+
+### Requirements
+
+* [FPM](https://github.com/jordansissel/fpm)
+* Ruby (for FPM)
+* rpmbuild
+
+### Usage
+
+RHEL/CentOS:
+
+ yum install rpm-build
+ gem install fpm --no-rdoc --no-ri
+ sh build.sh
+
+Debian:
+
+ apt-get install rpm
+ gem install fpm --no-rdoc --no-ri
+ sh build.sh
+
+
+### Optional
+
+* Vagrant
+
+An example Vagrant project has been included to get you started right away.
+
+ cd vagrant
+ vagrant up
+ vagrant ssh
+ cd build
+ sh build.sh
+
+### Available plugins
+
<table>
<tr>
<th>Plugin</th><th>Author(s)</th><th>Source</th>
</tr>
<tr>
- <td></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td>check_bacula.pl</td>
+ <td>check_bacula</td>
<td>Julian Hein</td>
<td><a href="http://exchange.nagios.org/directory/Plugins/Backup-and-Recovery/Bacula/check_bacula-2Epl/details/">upstream</a></td>
</tr>
@@ -22,3 +56,7 @@ Packages for RHEL/CentOS and Debian/Ubuntu will be built in a CI fashion in the
</tr>
</table>
+### Contributions
+
+As usual contributions are highly encouraged.
+If you'd like to do so, please do not hesitate send pull requests.
View
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+## Script: build.sh
+## Version: 0.1
+## Date: 2012-03-23
+## Author: Tom De Vylder <tomdv@inuits.eu>
+## Contrib:
+
+set -e
+
+rm -rf *.deb
+rm -rf *.rpm
+
+for PLUGIN in $(grep -viE '^#' build.txt | awk {'print $1'})
+do
+ PLUGIN_NAME_DEBIAN=$(echo ${PLUGIN} | sed -e 's/check_/check-/g')
+ PLUGIN_NAME_RHEL=$(echo ${PLUGIN} | sed -e 's/check_//g')
+ PLUGIN_VERSION=$(grep -E "^${PLUGIN}\s" build.txt | awk {'print $2'})
+ PLUGIN_ITERATION=$(grep -E "^${PLUGIN}\s" build.txt | awk {'print $3'})
+
+ echo "[ Building: ${PLUGIN} ----------------------- ]\n"
+ # Build Debian 5/6 package
+ fpm -s dir -t deb --architecture all \
+ -n nagios-plugin-${PLUGIN_NAME_DEBIAN} \
+ -v ${PLUGIN_VERSION} --iteration ${PLUGIN_ITERATION} \
+ --prefix /usr/lib/nagios/plugins/ \
+ ${PLUGIN}
+ cp nagios-plugin-${PLUGIN_NAME_DEBIAN}_${PLUGIN_VERSION}-${PLUGIN_ITERATION}_all.deb packages/debian/5/
+ mv nagios-plugin-${PLUGIN_NAME_DEBIAN}_${PLUGIN_VERSION}-${PLUGIN_ITERATION}_all.deb packages/debian/6/
+ echo
+
+ # Build RHEL 5/6 x86_64 package
+ fpm -s dir -t rpm --architecture x86_64 \
+ -n nagios-plugins-${PLUGIN_NAME_RHEL} \
+ -v ${PLUGIN_VERSION} --iteration ${PLUGIN_ITERATION} \
+ --prefix /usr/lib64/nagios/plugins/ \
+ ${PLUGIN}
+ cp nagios-plugins-${PLUGIN_NAME_RHEL}-${PLUGIN_VERSION}-${PLUGIN_ITERATION}.x86_64.rpm packages/rhel/5/
+ mv nagios-plugins-${PLUGIN_NAME_RHEL}-${PLUGIN_VERSION}-${PLUGIN_ITERATION}.x86_64.rpm packages/rhel/6/
+ echo "\n\n\n"
+done
+
View
@@ -0,0 +1,2 @@
+# Nagios plugin version iteration
+check_bacula 0.0.4 1
No changes.
No changes.
No changes.
No changes.
View
@@ -0,0 +1 @@
+{"active":{"debianbuild":"32ae16d3-1135-4831-8aae-4c83e2498495"}}
View
View
@@ -0,0 +1,19 @@
+Vagrant::Config.run do |config|
+ config.vm.share_folder "v-data", "/home/vagrant/build", "../"
+
+ config.vm.define :debianbuild do |debianbuild_config|
+ debianbuild_config.vm.box = "debian6-64-envpuppet"
+ debianbuild_config.vm.box_url = "http://files.penumbra.be/vagrant/debian6-64-envpuppet-latest.box"
+ debianbuild_config.vm.host_name = "debianbuild.labs.penumbra.be"
+ debianbuild_config.vm.network "192.168.97.11"
+
+ debianbuild_config.vm.provision :puppet do |puppet|
+ puppet.manifests_path = "manifests"
+ puppet.module_path = "modules"
+ puppet.manifest_file = "build.pp"
+ end
+ end
+end
+
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
View
@@ -0,0 +1,6 @@
+# placeholder
+#
+
+
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
View
@@ -0,0 +1,22 @@
+exec {
+ 'repo update':
+ command => '/usr/bin/apt-get update';
+}
+
+Package {
+ require => Exec['repo update'],
+}
+
+package {
+ 'make': ensure => present;
+ 'rpm': ensure => present;
+}
+
+package {
+ 'fpm':
+ ensure => present,
+ provider => gem;
+}
+
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
No changes.

0 comments on commit a4daf99

Please sign in to comment.