Changeset 999 for pykota/trunk
- Timestamp:
- 05/22/03 14:56:06 (22 years ago)
- Location:
- pykota/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/conf/pykota.conf.sample
r998 r999 124 124 # 125 125 # 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 " ") 127 127 # and : 128 128 # requester: snmp(public, mib-2.43.10.2.1.4.1.1) … … 143 143 # NB : The SNMP oid mib-2.43.10.2.1.4.1.1 works on HP Laserjet Printers, but it may 144 144 # 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. 147 requester: external(snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") 147 148 148 149 # Default policy for inexistant users (e.g. root) -
pykota/trunk/pykota/requesters/snmp.py
r998 r999 21 21 # 22 22 # $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 # 23 27 # Revision 1.9 2003/05/21 10:07:09 jalet 24 28 # Now works with net-snmp v5.0 and above. … … 76 80 if hostname is None : 77 81 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)) 79 83 try : 80 84 pagecounter = int(answer.readline().split()[-1].strip())