On startup, ApMon creates an instance identifier using ApMon.__getInstanceID. This can create an identifier that is out of the 32bit integer range. Sending reports then fails, as the value cannot be packed:
ERROR: [ApMon] Error in sendBgMonitoring: 'l' format requires -2147483648 <= number <= 2147483647
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/apmon.py", line 407, in sendBgMonitoring
self.__directSendParams(destination, self.__defaultSysMonCluster, self.__defaultSysMonNode, -1, sysResults)
File "/usr/lib/python2.7/site-packages/apmon.py", line 795, in __directSendParams
hdrPacker.pack_int(crtSenderRef['INSTANCE_ID'])
File "/usr/lib64/python2.7/xdrlib.py", line 57, in pack_int
self.__buf.write(struct.pack('>l', x))
error: 'l' format requires -2147483648 <= number <= 2147483647
The cause appears to be in ApMon.__getInstanceID. The identifier is created from (pid << 16) | (ip << 8) | rnd. Any pid above 32767 automatically causes the result to be greater than 2147483647.
A simple fix would to wrap either the pid or instance identifier to the valid range of values. Alternatively, a portion of a hash (md5, sha1, ...) of the information could do as well. I do not know whether this must be consistent with other Apmon clients, though.
On startup, ApMon creates an instance identifier using
ApMon.__getInstanceID. This can create an identifier that is out of the 32bit integer range. Sending reports then fails, as the value cannot be packed:The cause appears to be in
ApMon.__getInstanceID. The identifier is created from(pid << 16) | (ip << 8) | rnd. Any pid above 32767 automatically causes the result to be greater than 2147483647.A simple fix would to wrap either the pid or instance identifier to the valid range of values. Alternatively, a portion of a hash (md5, sha1, ...) of the information could do as well. I do not know whether this must be consistent with other Apmon clients, though.