Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing mac os agents add command #3207

Merged
merged 4 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to the Wazuh app project will be documented in this file.
### Fixed

- Conflict with the creation of the index pattern when performing the Health Check [#3223](https://github.com/wazuh/wazuh-kibana-app/pull/3223)
- Fixing mac os agents add command [#3207](https://github.com/wazuh/wazuh-kibana-app/pull/3207)

## Wazuh v4.1.5 - Kibana 7.10.0 , 7.10.2 - Revision 4106

Expand Down
30 changes: 23 additions & 7 deletions public/controllers/agent/components/register-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,29 @@ export class RegisterAgent extends Component {
}

optionalDeploymentVariables() {
const deployment = `WAZUH_MANAGER${this.state.selectedOS == 'macos' ? ' ' : '='}'${this.state.serverAddress}' ${this.state.selectedOS == 'win' ? `WAZUH_REGISTRATION_SERVER='${this.state.serverAddress}' ` : ''}${this.state.needsPassword
? `WAZUH_REGISTRATION_PASSWORD='${this.state.wazuhPassword}' `
: ''
}${this.state.udpProtocol
? " WAZUH_PROTOCOL='UDP'"
: ''
}${this.state.selectedGroup.length ? `WAZUH_AGENT_GROUP='${this.state.selectedGroup.map(item => item.label).join(',')}' ` : ''}`
let deployment = `WAZUH_MANAGER='${this.state.serverAddress}' `;

if (this.state.selectedOS == 'win') {
deployment += `WAZUH_REGISTRATION_SERVER='${this.state.serverAddress}' `;
}

if (this.state.wazuhPassword) {
deployment += `WAZUH_REGISTRATION_PASSWORD='${this.state.wazuhPassword}' `;
}

if (this.state.udpProtocol) {
deployment += `WAZUH_PROTOCOL='UDP' `;
}

if (this.state.selectedGroup.length) {
deployment += `WAZUH_AGENT_GROUP='${this.state.selectedGroup.map((item) => item.label).join(',')}' `;
}

// macos doesnt need = param
if (this.state.selectedOS === 'macos') {
return deployment.replaceAll('=', ' ');
}

return deployment;
}

Expand Down