Changeset 999

Show
Ignore:
Timestamp:
05/22/03 14:56:06 (22 years ago)
Author:
jalet
Message:

Uses SNMP version 1 instead of version 2c by default, which is probably
a safer bet.

Location:
pykota/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/conf/pykota.conf.sample

    r998 r999  
    124124# 
    125125# Example :  
    126 #     requester: external(snmpget -v 2c -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") 
     126#     requester: external(snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") 
    127127# and : 
    128128#     requester: snmp(public, mib-2.43.10.2.1.4.1.1) 
     
    143143# NB : The SNMP oid mib-2.43.10.2.1.4.1.1 works on HP Laserjet Printers, but it may 
    144144#      be different with other brands, refer to your printer's documentation  
    145 #      for details. 
    146 requester: external(snmpget -v 2c -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") 
     145#      for details. Also you may have to specify -v2c or -v3 depending on your  
     146#      printer's support for different versions of the SNMP specification. 
     147requester: external(snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") 
    147148 
    148149# Default policy for inexistant users (e.g. root) 
  • pykota/trunk/pykota/requesters/snmp.py

    r998 r999  
    2121# 
    2222# $Log$ 
     23# Revision 1.10  2003/05/22 12:56:06  jalet 
     24# Uses SNMP version 1 instead of version 2c by default, which is probably 
     25# a safer bet. 
     26# 
    2327# Revision 1.9  2003/05/21 10:07:09  jalet 
    2428# Now works with net-snmp v5.0 and above. 
     
    7680        if hostname is None : 
    7781            raise PyKotaRequesterError, _("Unknown printer address in SNMP(%s, %s) for printer %s") % (self.community, self.oid, self.printername) 
    78         answer = os.popen("snmpget -v 2c -c %s -Ov %s %s" % (self.community, hostname, self.oid)) 
     82        answer = os.popen("snmpget -v1 -c %s -Ov %s %s" % (self.community, hostname, self.oid)) 
    7983        try : 
    8084            pagecounter = int(answer.readline().split()[-1].strip())