From: Buchan M. <bg...@st...> - 2009-12-29 15:42:49
|
On Tuesday, 29 December 2009 10:55:40 W.J.M. Nelis wrote: > > On Monday, 26 October 2009 06:42:16 Colin Coe wrote: > > > Hi all > > > > > > Apologies if this has been asked (and answered) in the past but google > > > hasn't found me what I want. > > > > > > I've just setup Xymon and devmon and I'm monitoring Cisco switches > > > among other devices. The problem is that switch interfaces that have > > > no devices attached are causing the device to be shown in red. > > > > Firstly, I note that you should consider whether this should be the > > correct > > practice. E.g., in some environments I have worked in, the requirement > > is that > > unused ports be shut, or that unused ports that are not shut be in a > > restricted VLAN, and are only allowed on some switch blades (and > > configuration > > management tools/processes in place to inform everyone of changes that > > are > > made). > > > > > Is > > > there a way to prevent this? > > > > Sure, add exceptions for the interfaces, e.g.: > > > > DEVMON:except(if > > _stat;ifName;na:Gi11/.*|Gi4/.*|ATM2/0.*|Gi5/46|GI7/1|ma0|CPP*) > > > > If you have a few specific interfaces that you want alarms on, you can > > do it > > the other way, e.g. with (if_stat;ifName;ao;Gi1/.*). Please see the > > coverage > > of the except option in the "USING" file for more detail. > > I recently solved a similar problem, with the additional restraint that > the "interesting interfaces" should be specified in the templates only, > while the interfaces which are shutdown are listed only in the bb-hosts > file. Devmon ignores interfaces which are "shut", so you shouldn't need to exclude them in bb-hosts ... > My final setup is as follows: > - in the templates, file exceptions, the exception "only" is used to > select the interfaces of interest. The exception "ignore" is thus not used. > - in bb-hosts, for "all" tests, the "ignore" exception is used and the > "only" exception is not used. This is obviously not a generic solution, which means that you have to maintain local modifications to the templates (which is not what I want to encourage). > Thus the devmon configuration in bb-hosts does not contain dependencies > on tests, which is encoded only in the templates. The devmon > configuration in bb-hosts does contain for each networking device the > list of disabled interfaces. In my case, those lists are generated from > a configuration database. BTW, I've got a local hack to write some devmon test data to a database ... there are some minor issues with the feature I was wanting to create (effectively using devmon as part of a network discovery tool). Would this be of interest? > For example: > in /opt/devmon/templates/cisco-6509/exceptions: > ifName : only : Gi.+|Po.+ > in /home/xymon/server/etc/bb-hosts: > DEVMON:model(cisco;6509),except(all;ifName;i:Gi5/1|Gi5/2) > > The nett result is that the interesting interfaces which are not > disabled are shown by devmon. But, my 6509's and 6513's with Fa interfaces (some of which are connected to critical servers) and a 6513 with a PO (STM) interface - one of our two links to our upstream provider - would not benefit from something like this, so you'll have to maintain this locally, where you could have excluded all interfaces classes with a regex in your except option in bb-hosts. So, it may work for you, but I would prefer to not recommend local changes to templates where they can easily be avoided, and that people push required changes to templates (and new ones) upstream. Regards, Buchan |