Changeset 2196 for pykota/trunk
- Timestamp:
- 04/07/05 23:22:38 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounters/hardware.py
r2183 r2196 44 44 hasSNMP = 1 45 45 pageCounterOID = ".1.3.6.1.2.1.43.10.2.1.4.1.1" # SNMPv2-SMI::mib-2.43.10.2.1.4.1.1 46 pageCounterOID2 = ".1.3.6.1.2.1.43.10.2.1.5.1.1" # SNMPv2-SMI::mib-2.43.10.2.1.5.1.1 46 47 hrPrinterStatusOID = ".1.3.6.1.2.1.25.3.5.1.1.1" # SNMPv2-SMI::mib-2.25.3.5.1.1.1 47 48 printerStatusValues = { 1 : 'other', … … 71 72 self.parent = parent 72 73 self.printerHostname = printerhostname 73 self.printerInternalPageCounter = self.printerStatus = None 74 self.printerInternalPageCounter = None 75 self.printerInternalPageCounter2 = None 76 self.printerStatus = None 77 self.deviceStatus = None 74 78 75 79 def retrieveSNMPValues(self) : … … 80 84 req.apiAlphaSetPdu(ver.GetRequestPdu()) 81 85 req.apiAlphaGetPdu().apiAlphaSetVarBindList((pageCounterOID, ver.Null()), \ 82 (hrPrinterStatusOID, ver.Null())) 86 (pageCounterOID2, ver.Null()), \ 87 (hrPrinterStatusOID, ver.Null()), \ 88 (hrDeviceStatusOID, ver.Null())) 83 89 tsp = Manager() 84 90 try : … … 109 115 # keep maximum value seen for printer's internal page counter 110 116 self.printerInternalPageCounter = max(self.printerInternalPageCounter, self.values[0]) 111 self.printerStatus = self.values[1] 112 self.parent.filter.logdebug("SNMP answer is decoded : PageCounter : %s Status : %s" % (self.values[0], self.values[1])) 117 self.printerInternalPageCounter2 = max(self.printerInternalPageCounter2, self.values[1]) 118 self.printerStatus = self.values[2] 119 self.deviceStatus = self.values[3] 120 self.parent.filter.logdebug("SNMP answer is decoded : PageCounters : (%s, %s) PrinterStatus : %s DeviceStatus : %s" % tuple(self.values)) 113 121 except IndexError : 114 122 self.parent.filter.logdebug("SNMP answer is incomplete : %s" % str(self.values)) … … 177 185 self.printerHostname = printerhostname 178 186 self.printerInternalPageCounter = self.printerStatus = None 179 self.printerInternalPageCounter = self.printerStatus = None180 187 self.timedout = 0 181 188