--- /dev/null
+#!/bin/bash
+#
+# Check if a network interface is up, fixing if needed.
+#
+
+# Parameters
+BASENAME="`basename $0`"
+IFACE="$1"
+
+# Syntax check
+if [ -z "$IFACE" ]; then
+ echo "usage: $BASENAME <interface>"
+ exit 1
+fi
+
+# Run
+if ! LANG=C LC_ALL=C ifconfig $IFACE | grep -q "inet addr:"; then
+ ifup --force $IFACE
+fi
$check_ssh = hiera('nodo::subsystem::monitor::check_ssh', absent),
$ping_rate = hiera('nodo::subsystem::monitor::ping_rate', '!100.0,20%!500.0,60%')
) {
+ file { '/usr/local/sbin/ifcheck' :
+ ensure => present,
+ owner => 'root',
+ group => 'root',
+ mode => '0755',
+ source => 'puppet:///modules/nodo/bin/ifcheck',
+ }
if $use_nagios != false {
--- /dev/null
+define nodo::subsystem::monitor::interface(
+ $ensure = 'present'
+ $hour = "*",
+ $minute = "*",
+)
+{
+ cron { "ifcheck-${name}":
+ command => "/usr/local/sbin/ifcheck ${name}",
+ user => 'root',
+ hour => $hour,
+ minute => $minute,
+ ensure => $ensure,
+ }
+}