From: Schwimmer, E. E *H. <EE...@hs...> - 2006-03-10 15:55:20
|
Hrm, I have some revervations about implementing logical code inside of the templates (regular expression substitution was bad enough). You might be able to get away with something similar to what I did in the apc-9619 environmental test. The humidity test sometimes just doesn't work, and returns a negative number. So I duplicated the oid using the MATH transform, and then used the threshold message to set 'n/a' if it was lower than 0,=20 or the value of the original oid, if it was above zero. The problem here is that you might run out of threshold colors. This MIGHT work: In your transforms file:=20 {newTonerLevel} : MATH : {origTonerLevel} {toner} : WORST : {origTonerLevel} {newTonerLevel} In your thresholds file: {newTonerLevel} : red : -2 : Unknown {newTonerLevel} : yellow : -3 : Some remaining supply {newTonerLevel} : green : -1 : No restrictions on this parameter {origTonerLevel} : red : <5 : Toner is very low. {origTonerLevel} : yellow : <15 : Toner is low. {origTonerLevel} : green : >=3D15 : Toner is okay. In your messages file: Toner level : {toner.color} {toner} Ugh. That is ugly. I'll have to think about how to handle this. Something similar should work for your dhcp addresses if you need a quick fix before I figure out how to deal with this. Used the attached patch to fix the complaints about non-numeric values in a numeric comparison. -Eric Schwimmer Network Engineer UVA HSCS Network Engineering =20 > -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Whilding, Craig > Sent: Friday, March 10, 2006 9:40 AM > To: dev...@li... > Subject: [Devmon] Printer toner monitoring/dhcp monitoring >=20 > I want to monitor printer toner and other consumables. This=20 > is all under mib group 1.3.6.1.2.1.43.11.1. >=20 > =20 >=20 > The problem I have is that is the level or total is not being=20 > measured it can return negative numbers: >=20 > =20 >=20 > The value (-1) means other and specifically indicates that > the sub-unit places no restrictions on this parameter. > The value (-2) means unknown. A value of (-3) means that the > printer knows that there is some supply/remaining space, > respectively." >=20 > =20 >=20 > How should I go about implementing this? It could do with=20 > some sort of if then else logic. >=20 > =20 >=20 > =20 >=20 > There is a similar problem with dhcp free addresses. We have=20 > some disabled ranges that must be kept in place (networks are=20 > managed by someone else's dept). As there is no oid I know of=20 > for disabled range I want to monitor this through an=20 > exception if addresses in use and free addresses is 0 -=20 > ignore. Currently I cant do this as exceptions only work on=20 > the primary alias. >=20 > =20 >=20 > =20 >=20 > Its also still giving the "127.0.0.1 (insert real ip) isn't=20 > numeric in numeric ne (!=3D) at /..../dm_test.pm line=20 > 1867/1851,<$__ANONIO__> line 198" errors. Any ideas? >=20 > =20 >=20 > Thanks, >=20 > Craig >=20 >=20 |