Thank you, Michael. I don't know why I had them reversed other than to blame it 
on sleep deprivation.
Cheers


-----Original Message-----
From: icinga-users [mailto:[email protected]] On Behalf Of 
Michael Friedrich
Sent: Wednesday, December 02, 2015 4:50 PM
To: [email protected]
Subject: Re: [icinga-users] How to exclude some interfaces in a service check 
with apply - for



Am 02.12.2015 um 20:27 schrieb Jay Newman 
<[email protected]<mailto:[email protected]>>:

Assaf,
Thank you - but I am not trying to exclude some vlans and include others. I am 
just trying to exclude some interfaces if they include the name "vlan" in them. 
IE, virtual rather than physical interfaces.
I tried the statement "ignore where match (if_name,"VLAN")"  but it is not 
working.
I know that "if_name" is a valid variable, as I use it in display_name = 
if_name + " Input Errors" .

Check the docs on match() and its arguments. First one is the pattern, second 
the string.





From: icinga-users [mailto:[email protected]] On Behalf Of 
Assaf Flatto
Sent: Wednesday, December 02, 2015 7:35 AM
To: Icinga User's Corner 
<[email protected]<mailto:[email protected]>>
Subject: Re: [icinga-users] How to exclude some interfaces in a service check 
with apply - for

On 01/12/15 23:49, Jay Newman wrote:
Hello, all.
To monitor network switches, I have some host configurations set up as below.
This approach is successful in providing the service checks for each interface 
as expected, but there are a few interfaces that I want to exclude from a 
service check because the OID is invalid (IE, no input/output error counters on 
a VLAN rather than a physical interface.) Any suggestions on how to set up the 
"ignore" clause below so that it works?


object Host   "switch_1" {
import "generic-host"
address =  "10.1.1.1"
check_command = "check-host-alive"
vars.switch_make = "Cisco"
vars.switch_model = "Nexus 5000"
vars.interfaces["Ethernet1/1"] = {ifindex=436207616} 
vars.interfaces["Ethernet1/2"] = {ifindex=436211712} 
vars.interfaces["Ethernet1/3"] = {ifindex=436215808} ... many more ...
}

apply Service "if_inerrors-" for (if_name => config in host.vars.interfaces) {
  import "generic-service"
check_command = "check_sw_snmp"
vars.cmdopts= "$address$ $oid$ "
display_name = if_name + " Input Errors"
vars.oid="iso.3.6.1.2.1.2.2.1.14." + config.ifindex assign where 
host.vars.switch_model == "Nexus 6880"
assign where host.vars.switch_model == "Nexus 5000"
ignore where match (if_name,"VLAN")
}


You will need to define the vlan in the vars and then be able to define the 
exclude statement on the vlan.
this means that each interface will have to have a vlan key/value pair to allow 
the identifier to be recognized by Icinga.


Regards,
Jay Newman





_______________________________________________

icinga-users mailing list

[email protected]<mailto:[email protected]>

https://lists.icinga.org/mailman/listinfo/icinga-users





Assaf
_______________________________________________
icinga-users mailing list
[email protected]<mailto:[email protected]>
https://lists.icinga.org/mailman/listinfo/icinga-users

--
Michael Friedrich, DI (FH)
Senior Developer

NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
Tel: +49 911 92885-0 | Fax: +49 911 92885-77
GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461 http://www.netways.de | 
[email protected]

** OSDC 2016 - April - netways.de/osdc **
** OSBConf 2016 - September - osbconf.org ** 
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to