Optional[String] $naemon_url = undef,
Optional[String] $naemon_token = undef,
) inherits profile::monitoring::params {
+ $real_hostname = lookup("base_installation::real_hostname")
+
ensure_packages(["naemon", "cnagios"], { ensure => latest })
file { "/etc/naemon":
enable => true,
}
+ file { "/usr/local/sbin/i_naemon_force_check":
+ ensure => present,
+ mode => "0755",
+ content => template("profile/monitoring/force_check.sh.erb"),
+ }
+
unless ($naemon_url == undef or empty($naemon_url)) {
file { "/etc/naemon/send_nrdp.sh":
ensure => "file",
--- /dev/null
+#!/bin/bash
+
+date=$(date +%s)
+host="<%= @real_hostname %>"
+service="$2"
+
+if [ -z "$service" ]; then
+ printf "[%lu] SCHEDULE_FORCED_HOST_SVC_CHECKS;$host;%lu\n" $date $date | sudo -u naemon tee /var/lib/naemon/naemon.cmd
+else
+ printf "[%lu] SCHEDULE_FORCED_SVC_CHECK;$host;$service;%lu\n" $date $date | sudo -u naemon tee /var/lib/naemon/naemon.cmd
+fi