From b59bf3e96c3751c190ed8418f2a1aa7cf1b132cf Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Mon, 22 Jul 2013 21:23:06 +0300 Subject: [PATCH] nagios: Added host target for HP ProCurve switches --- nagios/manifests/init.pp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/nagios/manifests/init.pp b/nagios/manifests/init.pp index 20b94c7..87f5e73 100644 --- a/nagios/manifests/init.pp +++ b/nagios/manifests/init.pp @@ -651,3 +651,38 @@ define nagios::host::esxi($user, $pass, $vendor="auto") { } } + + +# Define HP ProCurve target host. +# +# $name: +# Target hostname. +# $community: +# SNMP community. +# $group: +# Hostgroup. +# +define nagios::host::procurve($community, $group="NONE") { + + include snmp::utils + + # 4 = good, 3 = warning, 2 = bad + $warn = "4:,4:,4:" + $crit = "3:,3:,3:" + # Fan, PSU1, PSU2 + $oids = ".1.3.6.1.4.1.11.2.14.11.1.2.6.1.4.1,.1.3.6.1.4.1.11.2.14.11.1.2.6.1.4.2,.1.3.6.1.4.1.11.2.14.11.1.2.6.1.4.3" + + nagios::host { $name: + group => $group, + osname => "ProCurve", + osicon => "switch", + } + nagios::service { "${name}_check_snmp": + host => $name, + group => $group, + command => "check_snmp!-l FAN,PSU1,PSU2 -C ${community} -w ${warn} -c ${crit} -o ${oids}", + description => "Sensors", + require => Package["net-snmp-utils"], + } + +}