From: Klomp, H. <kl...@nl...> - 2007-11-22 07:39:57
|
Hi All, I'm trying to create a template for monitoring our printers with devmon. I'm using the "hrPrinterDetectedErrorState" snmp variable (.1.3.6.1.2.1.2= 5.3.5.1.2.1) to get the status of the printer. According to the MIB the error conditions are encoded as bits in a octet= string. So I think this means that I have to convert the octet to a number to do = a switch My transforms file looks like: =3D=3D=3D=3D=3D transforms file =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D PrinterErrorNum : CONVERT : {hrPrinterDetectedErrorState} o= ct hrPrinterErrorState : SWITCH : {PrinterErrorNum} 0 =3D norma= l, 1 =3D request service, 2 =3D offline, 4 =3D jamed, 8 =3Ddoor open, 16 = =3Dnow toner, 32 =3D low toner, 64 =3D no paper, 128 =3D low paper sysUpTimeSecs : MATH : {sysUpTime} / 100 UpTimeTxt : ELAPSED : {sysUpTimeSecs} =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D In the output a get a clear error for the hrPrinterErrorState. According to the debug output devmon is first making the switch before it= is doing the convert. =3D=3D=3D=3D debug output =3D=3D=3D=3D [07-11-19@10:10:34] DEBUG TESTS: Doing math transform on pzn2401/sysUpTim= eSecs [07-11-19@10:10:34] DEBUG TESTS: Doing elapsed transform on pzn2401/UpTim= eTxt [07-11-19@10:10:34] DEBUG TESTS: Doing switch transform on pzn2401/hrPrin= terErrorState [07-11-19@10:10:34] DEBUG TESTS: Doing convert transform on pzn2401/Print= erErrorNum [07-11-19@10:10:34] DEBUG TEST: Rendering status message for pzn2401 [07-11-19@10:10:34] DEBUG TESTS: pzn2401 had one or more clear errors dur= ing test status =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D How can I force devmon to first execute the convert insted of the switch = ? Regards, Bert Klomp |