On Wed, 28 Jan 2015, Michael Jerger wrote:

Am Mittwoch, 28. Januar 2015, 12:09:57 schrieb David Lang:
On Wed, 28 Jan 2015, Michael Jerger wrote:
Hi,

I currently try to write an automated ossec agent deplyment and am
struggeling over setting the agents key. I try on agent system:

/var/ossec/bin/manage_agents -i somekey

but get sth. like:
 <== Agent information:
 <==    ID:14
 <==    Name:xxx.xxxx.xxxx
 <==    IP Address:xxx.xxx.xxx.xxx

 <== Confirm adding it?(y/n):
interactive input is dificult for my config management. So my question is:
Is there a way to set agents-key non-interactive?

what I do is create a file containing ip,hostname and then do
/var/ossec/bin/manage_agents -f file

This is working for agents? If yes cool :-)
Docu says " (Manager only)" for this feature.
Maybe some should fix the docu in this case?

Yes, this must be done on the server. I thought you were needing to create the key.

Before I shifted to this mode, there was a script in place that just blindly echoed the data into manage_agents, including the 'y'. It worked most of the time (but not if anything went wrong and the prompts changes)

Expect is the tool to use for dealing with interactive systems when you want to handle errors.

David Lang

Reply via email to