Changeset 2075 for pykota/trunk
- Timestamp:
- 02/20/05 23:58:55 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounters/hardware.py
r2027 r2075 22 22 # 23 23 # $Log$ 24 # Revision 1.36 2005/02/20 22:58:55 jalet 25 # Added some informations from RFC3805 and RFC2790 26 # 24 27 # Revision 1.35 2005/01/12 22:44:06 jalet 25 28 # Tried to fix a problem with printers which are slow to pass into printing mode. … … 162 165 else : 163 166 hasSNMP = 1 164 pageCounterOID = ".1.3.6.1.2.1.43.10.2.1.4.1.1" 165 hrPrinterStatusOID = ".1.3.6.1.2.1.25.3.5.1.1.1" 167 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 168 hrPrinterStatusOID = ".1.3.6.1.2.1.25.3.5.1.1.1" # SNMPv2-SMI::mib-2.25.3.5.1.1.1 166 169 printerStatusValues = { 1 : 'other', 167 170 2 : 'unknown', … … 170 173 5 : 'warmup', 171 174 } 175 hrDeviceStatusOID = ".1.3.6.1.2.1.25.3.2.1.5.1" # SNMPv2-SMI::mib-2.25.3.2.1.5.1 176 deviceStatusValues = { 1 : 'unknown', 177 2 : 'running', 178 3 : 'warning', 179 4 : 'testing', 180 5 : 'down', 181 } 182 hrPrinterDetectedErrorStateOID = ".1.3.6.1.2.1.25.3.5.1.2.1" # SNMPv2-SMI::mib-2.25.3.5.1.2.1 183 prtConsoleDisplayBufferTextOID = ".1.3.6.1.2.1.43.16.5.1.2.1.1" # SNMPv2-SMI::mib-2.43.16.5.1.2.1.1 172 184 185 # 186 # Documentation taken from RFC 3805 (Printer MIB v2) and RFC 2790 (Host Resource MIB) 187 # 188 # TODO : if hrDeviceStatus==2 and hrPrinterStatus==1 then it's powersave mode. 189 # 173 190 class SNMPAccounter : 174 191 """A class for SNMP print accounting.""" … … 184 201 req.apiAlphaSetCommunity('public') 185 202 req.apiAlphaSetPdu(ver.GetRequestPdu()) 186 req.apiAlphaGetPdu().apiAlphaSetVarBindList((pageCounterOID, ver.Null()), (hrPrinterStatusOID, ver.Null())) 203 req.apiAlphaGetPdu().apiAlphaSetVarBindList((pageCounterOID, ver.Null()), \ 204 (hrPrinterStatusOID, ver.Null())) 187 205 tsp = Manager() 188 206 try :