Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial release build script and vagrant project

  • Loading branch information...
commit a4daf994d99224e84441e68a4847339f7b7e205a 1 parent dc4deef
arioch authored
View
5 .gitignore
@@ -0,0 +1,5 @@
+*.deb
+*.rpm
+packages/*/*/*.deb
+packages/*/*/*.rpm
+vagrant/.vagrant
View
52 README.md
@@ -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
42 build.sh
@@ -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
2  build.txt
@@ -0,0 +1,2 @@
+# Nagios plugin version iteration
+check_bacula 0.0.4 1
View
0  packages/debian/5/.placeholder
No changes.
View
0  packages/debian/6/.placeholder
No changes.
View
0  packages/rhel/5/.placeholder
No changes.
View
0  packages/rhel/6/.placeholder
No changes.
View
1  vagrant/.vagrant
@@ -0,0 +1 @@
+{"active":{"debianbuild":"32ae16d3-1135-4831-8aae-4c83e2498495"}}
View
1  vagrant/Vagrantfile
View
19 vagrant/Vagrantfile-0.8
@@ -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
6 vagrant/Vagrantfile-1.0
@@ -0,0 +1,6 @@
+# placeholder
+#
+
+
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
View
22 vagrant/manifests/build.pp
@@ -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 :
View
0  vagrant/modules/.placeholder
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.