I finally got back to this. Patch attached. It's definitely a bug in
the agent.
Be sure to back out the last patch before applying this one, or:
$ cd zenossinst
$ rm -rf build/pysnmp
$ cp patch-from-eric externallibs/pysnmp-3.4.3.patch02
$ make pysnmp-install
Restart Zope, and Collect Configuration. Let me know if it works.
-Eric
Juan Pedro Escalona Rueda wrote:
Hello Eric!
I try to change the version of SNMP from v1 to v2c but also fails with
the same error, and later no appear routes, ipServices...
So i try the patch and restart, and now message error doesn't appear but
a TraceBack appear:
Traceback (most recent call last): File
"/usr/local/zenoss/Products/DataCollector/ApplyDataMap.py", line 48, in
processClient datamaps = plugin.process(device, results, log) File
"/usr/local/zenoss/Products/DataCollector/plugins/zenoss/snmp/RouteMap.py",
line 54, in process om.routemask = self.maskToBits(om.routemask) File
"/usr/local/zenoss/Products/DataCollector/plugins/CollectorPlugin.py",
line 46, in maskToBits return iputil.maskToBits(mask) File
"/usr/local/zenoss/Products/ZenUtils/IpUtil.py", line 94, in maskToBits
return int(netmask) ValueError: invalid literal for int(): ΓΏ
Later zenoss don't save IpServices and Interfaces information.
Thanks! Regards!
Eric Newton wrote:
Hi,
I'm fairly certain this is a bug in your SNMP agent. The value in
question has an OID:
1.3.6.1.2.1.4.21.1.1.0.0.0.0
I believe this refers to the default route. The encoded value for
this is:
"@\x08\x00\x00\x00\x00\x00\x00\x00\x00"
This is the part that fails to decode. The "@" is '0x40' which fails
to decode. Basically, it's looking for value which can be things like
a string, or a number, or an IP address. Each kind of value has an
encoded type which should be in the lower 5 bits of 0x40. A value of
zero is undefined for SNMP v1. You could try SNMP v2 against these
devices and see if that fixes the problem.
I've attached a patch to pysnmp to allow this response from an SNMP
client. Give it a try:
$ cd $ZENHOME/lib/python/pysnmp
$ patch -p0 < /the/patch/attached/in/this/mail
Be sure to restart Zope after patching.
-Eric
You could try SNMP v2 by changing the SNMP
Juan Pedro Escalona Rueda wrote:
hello!
I have a problem collecting data. I explain... I have some vserver's
that are monitorized by Zenoss. All Machines are Gentoo. When i collect
information appears the next error:
Collection Log
Time Level Module Message
2006-08-02 10:18:30 INFO zen.ZenModeler loading collector
plugins
from:/usr/local/zenoss/Products/DataCollector/plugins
2006-08-02 10:18:30 WARNING zen.ZenModeler no cmd plugins
found for XY
2006-08-02 10:18:30 INFO zen.ZenModeler snmp collection
device XY
2006-08-02 10:18:30 INFO zen.ZenModeler plugins:
zenoss.snmp.HRFileSystemMap, zenoss.snmp.InterfaceMap,
zenoss.snmp.HRSWInstalledMap, zenoss.snmp.DellDeviceMap,
zenoss.snmp.DeviceMap, zenoss.snmp.DellCPUMap, zenoss.snmp.DellPCIMap,
zenoss.snmp.RouteMap, zenoss.snmp.HPCPUMap,
zenoss.snmp.InformantHardDiskMap, zenoss.snmp.IpServiceMap,
zenoss.snmp.HPDeviceMap
2006-08-02 10:18:30 WARNING twsnmp.protocol Bad response
from
('xxxxxxxxxxx', 1161):
'[EMAIL PROTECTED]@\x08\xff\xff\xff\xe0\x00\x00\x00\x00'
2006-08-02 10:18:30 WARNING twsnmp.protocol Bad response
from
('xxxxxxxxxx', 1161):
'[EMAIL PROTECTED]@[EMAIL PROTECTED]'
2006-08-02 10:18:30 WARNING twsnmp.protocol Bad response
from
('xxxxxxxxxxx', 1161):
'[EMAIL PROTECTED]'
2006-08-02 10:18:31 WARNING twsnmp.protocol Bad response
from
('xxxxxxxxxxx', 1161):
'0=\x02\x01\x00\x04\x07SNMPnet\xa2/[EMAIL PROTECTED]'
2006-08-02 10:18:33 WARNING twsnmp.protocol Bad response
from
('xxxxxxxxxxx', 1161):
'[EMAIL PROTECTED]@\x08\xff\xff\xff\xe0\x00\x00\x00\x00'
2006-08-02 10:18:33 WARNING twsnmp.protocol Bad response
from
('xxxxxxxxxxx', 1161):
'[EMAIL PROTECTED]@[EMAIL PROTECTED]'
2006-08-02 10:18:33 WARNING twsnmp.protocol Bad response
from
('xxxxxxxxxxx', 1161):
'[EMAIL PROTECTED]'
2006-08-02 10:18:33 WARNING twsnmp.protocol Bad response
from
('xxxxxxxxxxx', 1161):
'0=\x02\x01\x00\x04\x07SNMPnet\xa2/[EMAIL PROTECTED]'
2006-08-02 10:18:35 ERROR zen.SnmpClient device XY plugin
zenoss.snmp.InterfaceMap unexpected error: Traceback (most recent call
last): Failure: twisted.internet.defer.TimeoutError: SNMP request
timed out
2006-08-02 10:18:35 ERROR zen.SnmpClient device XY plugin
zenoss.snmp.RouteMap unexpected error: Traceback (most recent call
last): Failure: twisted.internet.defer.TimeoutError: SNMP request
timed out
2006-08-02 10:18:35 ERROR zen.SnmpClient device XY plugin
zenoss.snmp.IpServiceMap unexpected error: Traceback (most recent call
last): Failure: twisted.internet.defer.TimeoutError: SNMP request
timed out
2006-08-02 10:18:36 INFO zen.SnmpClient snmp client finished
collection for XY
2006-08-02 10:18:36 INFO zen.ApplyDataMap processing host
resources
storage device XY
....
Next to try to collect information, no interfaces, no routes and no
ipServices appears in OS.
I check that this error appear only with 64 bits Machine's and reading
log file of net-snmpd appear the next error: snmpd[20117]: send
response: Error building ASN.1 representation (build int size 4: s/b 8).
x86 arch don't have problems.
I read that there are a patch for net-snmp for 64 bits machines for
CentOS... (http://bugs.centos.org/view.php?id=997) but i try it and it
doesn't work. Only delete de error message of log file but no appear
interfaces, routes and ipServices in OS.
Some idea? It's problem of VServer? It's problem of Net-SNMP and 64 bits
machines?
Regards!
Juan Pedro Escalona Rueda wrote:
Hello again!
snmpwalk command works well, i tried it yet. Server is HP, so
zPropertiers may not modify.
I discover another thing important, i try to collect information of
another machine (linux one) or another device that i had recollected
yet, but appears the same error.
so... it's stranger but i'll try to reinstall and try again!
thaks!
Schuran, Sven wrote:
Hi,
make sure windows system is reachable with snmp.
check with snmpwalk -p <snmp_secret> -v 1or2c <IpOfWinSystem>.
Have you installed Informat SNMP on the Windows box?
If the windows system is no HP or DELL, please add HP|DELL to
zProperties->zCollectorIgnorePlugins.
Sven
________________________________
Von: Juan Pedro Escalona Rueda [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 1. August 2006 09:57
An: General discussion of using zenoss system
Betreff: [zenoss-users] Collecting Data Fails
When i try to collect data from a Windows Machine (Windows 2003
Server) it's fails. It's appears into web page when i collect
information of a device...
Zenoss is installed into Gentoo Linux 2006.0. Version of Zenoss is
0.22.0.
Message Error is :
Traceback (most recent call last): File
"/usr/local/zenoss/Products/DataCollector/ApplyDataMap.py", line
48, in processClient datamaps = plugin.process(device, results,
log) File
"/usr/local/zenoss/Products/DataCollector/plugins/zenoss/snmp/HRSWRunMap.py",
line 44, in process filters =
device.getDmdRoot("Processes").getProcFilters() File
"/usr/local/zenoss/Products/ZenModel/ZenModelBase.py", line 190, in
getDmdRoot return dmd._getOb(name) File
"/usr/local/zenoss/lib/python/OFS/ObjectManager.py", line 261, in
_getOb raise AttributeError, id AttributeError: Processes
Note that Zenoss try to collect the information and later don't
save changes.
Regards!
------------------------------------------------------------------------
diff -r -u pysnmp/proto/rfc1155.py
zenoss/install/lib/python/pysnmp/proto/rfc1155.py
--- pysnmp/proto/rfc1155.py 2006-06-26 07:59:28.000000000 -0400
+++ /home/ecn/work/zenoss/install/lib/python/pysnmp/proto/rfc1155.py
2006-08-02 09:44:25.000000000 -0400
@@ -167,8 +167,12 @@
class ApplicationSyntax(Choice):
"""Constructed objects
"""
- choiceNames = [ 'address', 'counter', 'gauge', 'ticks', 'arbitrary' ]
- choiceComponents = [ NetworkAddress, Counter, Gauge, TimeTicks, Opaque ]
+ class Bug(Opaque):
+ """Some SNMP agents send us an application object with tagId = 0x0"""
+ tagId = 0x00
+
+ choiceNames = [ 'address', 'counter', 'gauge', 'ticks', 'arbitrary', 'Bug'
]
+ choiceComponents = [ NetworkAddress, Counter, Gauge, TimeTicks, Opaque,
Bug ]
class ObjectSyntax(Choice):
"""Syntax of objects in MIB
------------------------------------------------------------------------
--- pysnmp/proto/rfc1155.py 2006-08-02 12:28:57.000000000 -0400
+++ pysnmp/proto/rfc1155.py 2006-08-04 15:41:26.000000000 -0400
@@ -90,6 +90,11 @@
return '%d.%d.%d.%d' % (ord(value[0]), ord(value[1]), \
ord(value[2]), ord(value[3]))
+class Bug(IpAddress):
+ sizeConstraint = (4, 8)
+ def _oconv(self, value):
+ return IpAddress._oconv(self, value[:-4])
+
class Counter(Unsigned):
"""SNMP Counter object
"""
@@ -146,8 +151,8 @@
class NetworkAddress(Choice):
"""SMI NetworkAddress
"""
- choiceNames = [ 'internet' ]
- choiceComponents = [ IpAddress ]
+ choiceNames = [ 'internet', 'bug' ]
+ choiceComponents = [ IpAddress, Bug ]
# Initialize to Internet address
initialComponent = choiceComponents[0]
@@ -168,7 +173,7 @@
"""Constructed objects
"""
choiceNames = [ 'address', 'counter', 'gauge', 'ticks', 'arbitrary' ]
- choiceComponents = [ NetworkAddress, Counter, Gauge, TimeTicks, Opaque ]
+ choiceComponents = [ NetworkAddress, Counter, Gauge, TimeTicks, Opaque]
class ObjectSyntax(Choice):
"""Syntax of objects in MIB
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users