[AGENT++] Agent++ linyx initialization problem...

Fedja Jeleskovic mrawd2 at gmail.com
Thu Jan 27 00:06:27 CET 2005


> > Well, after a bit more of digging down there, now I get failure from
> > the threads and closure of all of them! Any idea what can make those
> > threads just to close pretty soon after the startup?
>
> > 20050125.14:39:47: 14289: (3)DEBUG  : MibContext: adding MIB object
>
> > 20050125.14:41:17: 14289: (1)DEBUG  : Thread: ended (tid):
>
> at least the agent runs exactly 90 seconds. Anything inside your code
> that has such a timeout?
>
> As your're on linux: Maybe starting the agent with "strace" shows
anything.

Well, one of the things that I have figured out so far is about the logging
of the output to the file. That file doesn't flush things all the time, so
you have to wait for the buffer to get full so you could see the output in
the file as well.

The other one about the closing the threads all the time is still a mystery.
One of the strange things that I see in the output file is creation of the
new threads with all IDs with zero(0) value (see below):
20050126.16:05:26: 16391: (1)DEBUG  : Thread: started (tid): (0)
20050126.16:05:26: 16372: (1)DEBUG  : TaskManager: thread started
20050126.16:05:26: 16372: (1)DEBUG  : TaskManager: thread started
20050126.16:05:26: 16392: (1)DEBUG  : Thread: started (tid): (98311)
20050126.16:05:26: 16393: (1)DEBUG  : Thread: started (tid): (0)
20050126.16:05:26: 16372: (1)DEBUG  : TaskManager: thread started
20050126.16:05:26: 16394: (1)DEBUG  : Thread: started (tid): (0)
20050126.16:05:26: 16372: (1)DEBUG  : TaskManager: thread started
This is something that I see happening on the Linux only.

Your remark about 90 sec interval doesn't end up to be all the time. Here is
another example:
20050126.15:41:58: 3232: (1)DEBUG  : TaskManager: thread started
20050126.15:41:58: 3261: (1)DEBUG  : Thread: started (tid): (81926)
20050126.15:41:58: 3263: (1)DEBUG  : Thread: started (tid): (0)
20050126.15:41:58: 3232: (1)DEBUG  : TaskManager: thread started
20050126.15:41:58: 3232: (1)DEBUG  : TaskManager: thread started
20050126.15:41:58: 3267: (1)DEBUG  : Thread: started (tid): (131081)
20050126.15:41:58: 3268: (1)DEBUG  : Thread: started (tid): (0)
20050126.15:41:58: 3232: (1)DEBUG  : TaskManager: thread started
...and closing part:
20050126.15:43:44: 3261: (1)DEBUG  : Thread: ended (tid): (81926)
20050126.15:43:44: 3232: (4)DEBUG  : Thread: joined thread successfully
(tid): (81926)
20050126.15:43:44: 3232: (1)DEBUG  : TaskManager: thread stopped
20050126.15:43:44: 3263: (1)DEBUG  : Thread: ended (tid): (98311)
20050126.15:43:44: 3232: (4)DEBUG  : Thread: joined thread successfully
(tid): (98311)
20050126.15:43:44: 3232: (1)DEBUG  : TaskManager: thread stopped
20050126.15:43:44: 3267: (1)DEBUG  : Thread: ended (tid): (131081)
20050126.15:43:44: 3232: (4)DEBUG  : Thread: joined thread successfully
(tid): (131081)
20050126.15:43:44: 3232: (1)DEBUG  : TaskManager: thread stopped
20050126.15:43:44: 3268: (1)DEBUG  : Thread: ended (tid): (147466)
20050126.15:43:44: 3232: (4)DEBUG  : Thread: joined thread successfully
(tid): (147466)
20050126.15:43:44: 3232: (1)DEBUG  : TaskManager: thread stopped
As you can see above, some of the thread IDs are again wrong, but they seem
right at the closing time.

The question is what can cause closing of those threads in my code? What
happens in my code is basically identical what is in the examples, with the
exception of using my CParser object to coordinate the config file so I can
add users, and their rights, as well, as traps destinations without need to
rebuild the agent.

I have one more thing to ask here. It is about the log types and their use.
If I create an ERROR_LOG message somewhere would that have any side effects
to the running of the agent? Also, When we use that LOG macro, what is the
meaning of the value that is passed with the log type as in example below:
LOG_BEGIN(DEBUG_LOG | 1);

How we should go about selecting the right value at the end? Basically, what
is a difference between the above line and:
LOG_BEGIN(DEBUG_LOG | 4);
besides looking different in the output file?

Thanks a lot!


Fedja









More information about the AGENTPP mailing list