Changeset 2075

Show
Ignore:
Timestamp:
02/20/05 23:58:55 (19 years ago)
Author:
jalet
Message:

Added some informations from RFC3805 and RFC2790

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/accounters/hardware.py

    r2027 r2075  
    2222# 
    2323# $Log$ 
     24# Revision 1.36  2005/02/20 22:58:55  jalet 
     25# Added some informations from RFC3805 and RFC2790 
     26# 
    2427# Revision 1.35  2005/01/12 22:44:06  jalet 
    2528# Tried to fix a problem with printers which are slow to pass into printing mode. 
     
    162165else :     
    163166    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 
    166169    printerStatusValues = { 1 : 'other', 
    167170                            2 : 'unknown', 
     
    170173                            5 : 'warmup', 
    171174                          } 
     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 
    172184                           
     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    # 
    173190    class SNMPAccounter : 
    174191        """A class for SNMP print accounting.""" 
     
    184201            req.apiAlphaSetCommunity('public') 
    185202            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())) 
    187205            tsp = Manager() 
    188206            try :